File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/jupyterlab-lsp/src/adapters Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import {
1212import {
1313 ILSPCodeExtractorsManager ,
1414 ILSPFeatureManager ,
15- ILSPDocumentConnectionManager
15+ ILSPDocumentConnectionManager ,
16+ IEditorChangedData
1617} from '@jupyterlab/lsp' ;
1718
1819import { ILSPCodeOverridesManager } from '../overrides/tokens' ;
@@ -28,6 +29,18 @@ export class FileEditorAdapter extends UpstreamFileEditorAdapter {
2829 protected options : IAdapterOptions
2930 ) {
3031 super ( editorWidget , options ) ;
32+ // Workaround to ensure `_editorAdded` is not called twice once upstream
33+ // adopts patch https://github.com/jupyterlab/jupyterlab/pull/15873
34+ let emitted = false ;
35+ const emit = this . _editorAdded . emit ;
36+ this . _editorAdded . emit = ( args : IEditorChangedData ) => {
37+ if ( emitted ) {
38+ return ;
39+ }
40+ emitted = true ;
41+ console . log ( 'call' ) ;
42+ emit . call ( this . _editorAdded , args ) ;
43+ } ;
3144 }
3245
3346 protected async initOnceReady ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments