Skip to content

Commit

Permalink
Set server receiver to initialized at the end of the initialize r…
Browse files Browse the repository at this point in the history
…equest (#589)
  • Loading branch information
andyleejordan authored May 20, 2021
1 parent d1daf4b commit 3f56706
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Server/LanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,15 @@ await LanguageProtocolEventingHelper.Run(
).ConfigureAwait(false);


// Allow the server receiver to start processing incoming notifications and requests. It
// is necessary to do this now, and not in the Initialized handler, because otherwise
// clients can enter a race with the receiver and have their notifications and requests
// erroneously dropped.
_serverReceiver.Initialized();

// TODO:
if (_clientVersion == ClientVersion.Lsp2)
{
_serverReceiver.Initialized();
_initializeComplete.OnNext(result);
_initializeComplete.OnCompleted();
}
Expand All @@ -328,7 +333,6 @@ public Task<Unit> Handle(InitializedParams @params, CancellationToken token)
{
if (_clientVersion == ClientVersion.Lsp3)
{
_serverReceiver.Initialized();
_initializeComplete.OnNext(ServerSettings);
_initializeComplete.OnCompleted();
}
Expand Down

0 comments on commit 3f56706

Please sign in to comment.