File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,16 @@ export function onDidChangeConfiguration(client: LanguageClient) {
3030 updateDecorations ( ) ;
3131}
3232
33+ let timeoutToReqAnn : NodeJS . Timer ;
34+
3335export function requestAnnotators ( editor : vscode . TextEditor , client : LanguageClient ) {
36+ clearTimeout ( timeoutToReqAnn ) ;
37+ timeoutToReqAnn = setTimeout ( ( ) => {
38+ requestAnnotatorsImpl ( editor , client ) ;
39+ } , 300 ) ;
40+ }
41+
42+ function requestAnnotatorsImpl ( editor : vscode . TextEditor , client : LanguageClient ) {
3443 if ( ! D_PARAM ) {
3544 updateDecorations ( ) ;
3645 }
Original file line number Diff line number Diff line change @@ -60,10 +60,8 @@ function onDidChangeWorkspaceFolders(event: vscode.WorkspaceFoldersChangeEvent)
6060}
6161
6262function onDidChangeTextDocument ( event : vscode . TextDocumentChangeEvent ) {
63- if ( activeEditor ) {
64- setTimeout ( ( ) => {
65- Annotator . requestAnnotators ( activeEditor , client ) ;
66- } , 0.1 ) ;
63+ if ( activeEditor && activeEditor . document === event . document ) {
64+ Annotator . requestAnnotators ( activeEditor , client ) ;
6765 }
6866}
6967
@@ -110,7 +108,7 @@ function startClient() {
110108 }
111109 } ;
112110
113- let socketMode = false ;
111+ let socketMode = true ;
114112 let serverOptions : ServerOptions ;
115113 if ( socketMode ) {
116114 // The server is a started as a separate app and listens on port 5007
You can’t perform that action at this time.
0 commit comments