Skip to content

Commit 21845ae

Browse files
committed
Server status filtering should be performed by the caller.
1 parent e7920b1 commit 21845ae

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/com/redhat/devtools/lsp4ij/LanguageServiceAccessor.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ public void processLanguageServers(@NotNull PsiFile file,
236236
return;
237237
}
238238
for (var startedServer : startedServers) {
239-
if (ServerStatus.started.equals(startedServer.getServerStatus())) {
240-
processor.accept(startedServer);
241-
}
239+
processor.accept(startedServer);
242240
}
243241
}
244242

@@ -293,7 +291,7 @@ public void processLanguageServers(@NotNull PsiFile file,
293291
@Nullable LanguageServerDefinition matchServerDefinition) {
294292
// Collect started (or not) language servers which matches the given file.
295293
CompletableFuture<Collection<LanguageServerWrapper>> matchedServers = getMatchedLanguageServersWrappers(psiFile, matchServerDefinition, beforeStartingServerFilter);
296-
var matchedServersNow= matchedServers.getNow(Collections.emptyList());
294+
var matchedServersNow = matchedServers.getNow(Collections.emptyList());
297295
if (matchedServers.isDone() && matchedServersNow.isEmpty()) {
298296
// None language servers matches the given file
299297
return CompletableFuture.completedFuture(Collections.emptyList());
@@ -364,7 +362,7 @@ private static Map<LanguageServerWrapper, LanguageServerWrapper.LSPFileConnectio
364362
if (uri != null && !ls.isConnectedTo(uri)) {
365363
// The file is not connected to the current language server
366364
// Get the required information for the didOpen (text and languageId) which requires a ReadAction.
367-
if(document != null) {
365+
if (document != null) {
368366
if (connectionFileInfo == null) {
369367
connectionFileInfo = new HashMap<>();
370368
}
@@ -431,7 +429,7 @@ private CompletableFuture<Collection<LanguageServerWrapper>> getMatchedLanguageS
431429
/**
432430
* Get or create a language server wrapper for the given server definitions and add then to the given matched servers.
433431
*
434-
* @param psiFile the file.
432+
* @param psiFile the file.
435433
* @param serverDefinitions the server definitions.
436434
* @param matchedServers the list to update with get/created language server.
437435
* @param beforeStartingServerFilter
@@ -504,7 +502,7 @@ public CompletableFuture<Set<LanguageServerDefinition>> getAsyncMatched() {
504502
/**
505503
* Returns the matched language server definitions for the given file.
506504
*
507-
* @param psiFile the file.
505+
* @param psiFile the file.
508506
* @param ignoreMatch true if {@link DocumentMatcher} must be ignored when mapping matches the given file and false otherwise.
509507
* @return the matched language server definitions for the given file.
510508
*/

0 commit comments

Comments
 (0)