@@ -74,7 +74,6 @@ public class BSLLanguageServer implements LanguageServer, ProtocolExtension {
74
74
private final BSLWorkspaceService workspaceService ;
75
75
private final ServerContext context ;
76
76
private final ServerInfo serverInfo ;
77
- private final DocumentSelector documentSelector ;
78
77
private boolean shutdownWasCalled ;
79
78
80
79
@ Override
@@ -83,7 +82,7 @@ public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
83
82
setConfigurationRoot (params );
84
83
CompletableFuture .runAsync (context ::populateContext );
85
84
86
- ServerCapabilities capabilities = new ServerCapabilities ();
85
+ var capabilities = new ServerCapabilities ();
87
86
capabilities .setTextDocumentSync (getTextDocumentSyncOptions ());
88
87
capabilities .setDocumentRangeFormattingProvider (getDocumentRangeFormattingProvider ());
89
88
capabilities .setDocumentFormattingProvider (getDocumentFormattingProvider ());
@@ -100,7 +99,7 @@ public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
100
99
capabilities .setSelectionRangeProvider (getSelectionRangeProvider ());
101
100
capabilities .setColorProvider (getColorProvider ());
102
101
103
- InitializeResult result = new InitializeResult (capabilities , serverInfo );
102
+ var result = new InitializeResult (capabilities , serverInfo );
104
103
105
104
return CompletableFuture .completedFuture (result );
106
105
}
@@ -161,14 +160,14 @@ public WorkspaceService getWorkspaceService() {
161
160
}
162
161
163
162
private static TextDocumentSyncOptions getTextDocumentSyncOptions () {
164
- TextDocumentSyncOptions textDocumentSync = new TextDocumentSyncOptions ();
163
+ var textDocumentSync = new TextDocumentSyncOptions ();
165
164
166
165
textDocumentSync .setOpenClose (Boolean .TRUE );
167
166
textDocumentSync .setChange (TextDocumentSyncKind .Full );
168
167
textDocumentSync .setWillSave (Boolean .FALSE );
169
168
textDocumentSync .setWillSaveWaitUntil (Boolean .FALSE );
170
169
171
- SaveOptions save = new SaveOptions ();
170
+ var save = new SaveOptions ();
172
171
save .setIncludeText (Boolean .FALSE );
173
172
174
173
textDocumentSync .setSave (save );
@@ -198,10 +197,9 @@ private static DocumentSymbolOptions getDocumentSymbolProvider() {
198
197
return documentSymbolOptions ;
199
198
}
200
199
201
- private FoldingRangeProviderOptions getFoldingRangeProvider () {
200
+ private static FoldingRangeProviderOptions getFoldingRangeProvider () {
202
201
var foldingRangeProviderOptions = new FoldingRangeProviderOptions ();
203
202
foldingRangeProviderOptions .setWorkDoneProgress (Boolean .FALSE );
204
- foldingRangeProviderOptions .setDocumentSelector (documentSelector .asList ());
205
203
206
204
return foldingRangeProviderOptions ;
207
205
}
@@ -249,10 +247,9 @@ private static ReferenceOptions getReferencesProvider() {
249
247
return referenceOptions ;
250
248
}
251
249
252
- private CallHierarchyRegistrationOptions getCallHierarchyProvider () {
250
+ private static CallHierarchyRegistrationOptions getCallHierarchyProvider () {
253
251
var callHierarchyRegistrationOptions = new CallHierarchyRegistrationOptions ();
254
252
callHierarchyRegistrationOptions .setWorkDoneProgress (Boolean .FALSE );
255
- callHierarchyRegistrationOptions .setDocumentSelector (documentSelector .asList ());
256
253
return callHierarchyRegistrationOptions ;
257
254
}
258
255
@@ -262,17 +259,15 @@ private static WorkspaceSymbolOptions getWorkspaceProvider() {
262
259
return workspaceSymbolOptions ;
263
260
}
264
261
265
- private SelectionRangeRegistrationOptions getSelectionRangeProvider () {
262
+ private static SelectionRangeRegistrationOptions getSelectionRangeProvider () {
266
263
var selectionRangeRegistrationOptions = new SelectionRangeRegistrationOptions ();
267
264
selectionRangeRegistrationOptions .setWorkDoneProgress (Boolean .FALSE );
268
- selectionRangeRegistrationOptions .setDocumentSelector (documentSelector .asList ());
269
265
return selectionRangeRegistrationOptions ;
270
266
}
271
267
272
- private ColorProviderOptions getColorProvider () {
268
+ private static ColorProviderOptions getColorProvider () {
273
269
var colorProviderOptions = new ColorProviderOptions ();
274
270
colorProviderOptions .setWorkDoneProgress (Boolean .FALSE );
275
- colorProviderOptions .setDocumentSelector (documentSelector .asList ());
276
271
return colorProviderOptions ;
277
272
}
278
273
}
0 commit comments