Skip to content

Move initial part of LSP loading off the UI thread.#53662

Merged
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi:lspLoad
May 25, 2021
Merged

Move initial part of LSP loading off the UI thread.#53662
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi:lspLoad

Conversation

@CyrusNajmabadi
Copy link
Contributor

Fixes #53573

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 25, 2021 03:01
@ghost ghost added the Area-IDE label May 25, 2021
@CyrusNajmabadi CyrusNajmabadi requested a review from dibarbet May 25, 2021 03:01
var token = this._asynchronousOperationListener.BeginAsyncOperation("LoadAsync");
// Trigger a fire and forget request to the VS LSP client to load our ILanguageClient.
// This needs to be done with .Forget() as the LoadAsync (VS LSP client) synchronously stores the result task of OnLoadedAsync.
// The synchronous execution happens under the sln load threaded wait dialog, so user actions cannot be made in between triggering LoadAsync and storing the result task from OnLoadedAsync.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @gundermanc - this bit is no longer happening synchronously so unless the implementation has changed with the LSP client refactor, there could be cases where ctrl+Q search returns no results if it's called before the OnLoadedAsync task is stored.

We can't do this on the UI thread so ctrl+Q may need to be updated to be resilient where possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gundermanc if we need that scenario to work, and for features like ctrl-q to be able to wait for servers to start up, then we'll need some mechanism for the client to asynchronously call in and wait for the server to be totally loaded.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge May 25, 2021 03:12
@CyrusNajmabadi CyrusNajmabadi merged commit a933a4a into dotnet:main May 25, 2021
@ghost ghost added this to the Next milestone May 25, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the lspLoad branch June 23, 2021 21:03
@RikkiGibson RikkiGibson modified the milestones: Next, 17.0.P2 Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Responsiveness] AlwaysActiveLanguageClientEventListener.StartListening consumed 5% of the UI thread during solution open

3 participants