@@ -97,7 +97,7 @@ export function activate(context: ExtensionContext) {
97
97
"ReScriptLSP" ,
98
98
"ReScript Language Server" ,
99
99
serverOptions ,
100
- clientOptions
100
+ createClientOptions ( )
101
101
) ;
102
102
attachCodeAnalysis ( client ) ;
103
103
return client ;
@@ -122,21 +122,20 @@ export function activate(context: ExtensionContext) {
122
122
} ,
123
123
} ;
124
124
125
- // Options to control the language client
126
- let clientOptions : LanguageClientOptions = {
127
- // Register the server for plain text documents
128
- documentSelector : [ { scheme : "file" , language : "rescript" } ] ,
129
- synchronize : {
130
- // Notify the server about file changes to '.clientrc files contained in the workspace
131
- fileEvents : workspace . createFileSystemWatcher ( "**/.clientrc" ) ,
132
- } ,
133
- // We'll send the initial configuration in here, but this might be
134
- // problematic because every consumer of the LS will need to mimic this.
135
- // We'll leave it like this for now, but might be worth revisiting later on.
136
- initializationOptions : {
137
- extensionConfiguration : workspace . getConfiguration ( "rescript.settings" ) ,
138
- } ,
139
- } ;
125
+ function createClientOptions ( ) {
126
+ // Options to control the language client
127
+ let clientOptions : LanguageClientOptions = {
128
+ documentSelector : [ { scheme : "file" , language : "rescript" } ] ,
129
+ // We'll send the initial configuration in here, but this might be
130
+ // problematic because every consumer of the LS will need to mimic this.
131
+ // We'll leave it like this for now, but might be worth revisiting later on.
132
+ initializationOptions : {
133
+ extensionConfiguration : workspace . getConfiguration ( "rescript.settings" ) ,
134
+ } ,
135
+ } ;
136
+
137
+ return clientOptions ;
138
+ }
140
139
141
140
// Create the language client and start the client.
142
141
client = createLanguageClient ( ) ;
0 commit comments