Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command "Restart Language Server" #539

Closed
GitMensch opened this issue Jun 29, 2021 · 7 comments · Fixed by #551
Closed

add command "Restart Language Server" #539

GitMensch opened this issue Jun 29, 2021 · 7 comments · Fixed by #551
Labels
enhancement New feature or request
Milestone

Comments

@GitMensch
Copy link
Contributor

... as seen in the Python extension python.analysis.restartLanguageServer.

Not a priority at all, but something to possibly consider.

Reasoning: sometimes the server seems to hang and if it doesn't restart its own (which may take some seconds to be triggered, I don't know if there are other cases when this happens apart from "server chrashed") you have three options: a command like this or a manual killing of the process tree (after you've found the correct java process) or (which will loose your undo and position history) the reload window command.

@AlexXuChen
Copy link
Contributor

After doing some digging, I've found some references to a VSCode issue:

microsoft/vscode/issues/76405

I'm currently investigating, and it seems doable by simply issuing a deactivate and activate in succession, I am just encountering a weird interaction with restarting the Telemetry service.

@rgrunber rgrunber added the enhancement New feature or request label Jul 15, 2021
@rgrunber
Copy link
Member

Related to #540 .

The language server should stop on its own in most cases (client exits). If the client crashes, or is brought down abruptly, the language server may continue to run for at most 30s before finally exiting. A (hacky) solution would be to use the ErrorHandler to restart.

@GitMensch
Copy link
Contributor Author

The only option to do so currently that seems to work is to completely close vscode, then restart it again.
I've stumbled over this when updating the vsix form 0.20 to 0.21, which provided a query by vscode to restart the window which I did, but the results from the validation were still identical - until I've completely restarted vscode.

BTW: Shouldn't a vsix update trigger a restart of the language server in any case? Should this be moved out to a new issue?

@rgrunber
Copy link
Member

rgrunber commented Jul 20, 2022

Eventually when we update to vscode-language-server node client v8 (had to revert due to lack of support in Theia), we should see if restart() works. I think Alex will be trying it out to see if it works as expected.

@GitMensch
Copy link
Contributor Author

Sounds good - but the user-provided command can still be added in the meantime, can't it?

@AlexXuChen
Copy link
Contributor

Eventually when we update to vscode-language-server node client v8 (had to revert due to lack of support in Theia), we should see if restart() works. I think Alex will be trying it out to see if it works as expected.

See the fix in #551 (comment)

@rgrunber rgrunber added this to the 0.22.0 milestone Jul 20, 2022
@AlexXuChen
Copy link
Contributor

Thanks @GitMensch for the suggestion! Apologies for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants