@@ -11,6 +11,7 @@ import {
11
11
DidChangeTextDocumentNotification ,
12
12
DidCloseTextDocumentNotification ,
13
13
DidChangeConfigurationNotification ,
14
+ InitializeParams ,
14
15
} from "vscode-languageserver-protocol" ;
15
16
import * as utils from "./utils" ;
16
17
import * as codeActions from "./codeActions" ;
@@ -281,8 +282,6 @@ if (process.argv.includes("--stdio")) {
281
282
process . on ( "message" , onMessage ) ;
282
283
}
283
284
284
- askForAllCurrentConfiguration ( ) ;
285
-
286
285
function hover ( msg : p . RequestMessage ) {
287
286
let params = msg . params as p . HoverParams ;
288
287
let filePath = fileURLToPath ( params . textDocument . uri ) ;
@@ -860,8 +859,14 @@ function onMessage(msg: m.Message) {
860
859
askForAllCurrentConfiguration ( ) ;
861
860
} , 10_000 ) ;
862
861
863
- // Pull config right away as we've initied.
864
- askForAllCurrentConfiguration ( ) ;
862
+ // Save initial configuration, if present
863
+ let initParams = msg . params as InitializeParams ;
864
+ let initialConfiguration = initParams . initializationOptions
865
+ ?. extensionConfiguration as extensionConfiguration | undefined ;
866
+
867
+ if ( initialConfiguration != null ) {
868
+ extensionConfiguration = initialConfiguration ;
869
+ }
865
870
866
871
send ( response ) ;
867
872
} else if ( msg . method === "initialized" ) {
0 commit comments