Skip to content

Commit

Permalink
Bugfix in Dart Analysis Server completion support, don't call complet…
Browse files Browse the repository at this point in the history
…ion_setSubscriptions() in startServer()

close #860

GitOrigin-RevId: 07ae189d451b2360ddf73aaaff7c89972f5d5b14
  • Loading branch information
alexander-doroshko authored and intellij-monorepo-bot committed Mar 2, 2022
1 parent e8231a1 commit 107f9c3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ public void computedSearchResults(String searchId, List<SearchResult> results, b
@Override
public void serverConnected(@Nullable String version) {
myServerVersion = version != null ? version : "";
// completion_setSubscriptions() are handled here instead of in startServer() as the server version isn't known until this
// serverConnected() call.
if (myServer != null && !shouldUseCompletion2()) {
myServer.completion_setSubscriptions(List.of(CompletionService.AVAILABLE_SUGGESTION_SETS));
}
}

@Override
Expand Down Expand Up @@ -2088,10 +2093,6 @@ else if (!dasSnapshotFile.canRead()) {
startedServer.start();
server_setSubscriptions(startedServer);

if (!shouldUseCompletion2()) {
startedServer.completion_setSubscriptions(List.of(CompletionService.AVAILABLE_SUGGESTION_SETS));
}

if (!myInitializationOnServerStartupDone) {
myInitializationOnServerStartupDone = true;

Expand Down

0 comments on commit 107f9c3

Please sign in to comment.