Repository navigation
Retry language server start-up when its locale script fails to load - #1409
Merged
Merged
Conversation
Pyright fetches its messages for the locale as the first step of initialize. When that fetch failed while the browser reported being online, the error was rethrown and the rejected promise kept, so the session had no completions, signature help or diagnostics until a reload. This is most of PYTHON-EDITOR-NEXT-3SJ. Retry initialize with the same back-off as other lazy loads. Nothing else has happened in the server at that point, so it can be sent again on the same connection. If every attempt fails, a later call starts afresh rather than replaying the failure. The offline fallback to the precached locale now awaits its second attempt and no longer loops if that fails too.
|
Preview build will be at |
pyright() awaited the cached client's initialize before comparing languages. Now that a failed initialize can be tried again, a language change after a failure would run a full round of retries for the old locale, and give up without creating the new client if they failed. Compare first and dispose a client for another language straight away. Drop the handlersRegistered flag: vscode-jsonrpc keys handlers by method, so registering again replaces them. Relax the e2e request count so it doesn't depend on how many workers Pyright starts.
Collaborator
Author
|
Tested basic initialisation and language switching and all seems good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pyright fetches its messages for the locale as the first step of
initialize. When that fetch failed while the browser reported being
online, the error was rethrown and the rejected promise kept, so the
session had no completions, signature help or diagnostics until a
reload. This is most of PYTHON-EDITOR-NEXT-3SJ.
Retry initialize with the same back-off as other lazy loads. Nothing
else has happened in the server at that point, so it can be sent again
on the same connection. If every attempt fails, a later call starts
afresh rather than replaying the failure.
The offline fallback to the precached locale now awaits its second
attempt and no longer loops if that fails too.