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

Unnecessary pop-ups following multiple language server failures. #3131

Closed
hopehadfield opened this issue Jun 2, 2023 · 1 comment · Fixed by #3132
Closed

Unnecessary pop-ups following multiple language server failures. #3131

hopehadfield opened this issue Jun 2, 2023 · 1 comment · Fixed by #3132
Assignees
Milestone

Comments

@hopehadfield
Copy link
Contributor

Upon five language server failures, up to five error messages appear, including the following:

"The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted."
"Language Support for Java client: couldn't create connection to server."
"Connection to server got closed. Server will not be restarted."
"Language Support for Java (Syntax Server) client: couldn't create connection to server."
"Restarting server failed"

Looking to suppress some of the messages as the current amount is overkill.

@rgrunber
Copy link
Member

rgrunber commented Jun 5, 2023

For those interested, the key here was finding that the ClientErrorHandler's error() and closed() callbacks return a CloseHandlerResult/ErrorHandlerResult. They take an optional handled boolean field : https://github.com/microsoft/vscode-languageserver-node/blob/release/client/8.1.0/client/src/common/client.ts#L159-L165 :

/**
* If set to true the client assumes that the corresponding
* close handler has presented an appropriate message to the
* user and the message will only be log to the client's
* output channel.
*/
handled?: boolean;

So setting that to true should suppress the additional popups in quite a few cases. Note that his handles errors/closes after the connection has been established and not those in the process of establishing a connection (that gets handled by InitializationFailedHandler which we've addressed in https://github.com/redhat-developer/vscode-java/pull/3123/files#diff-04bba6a35cad1c794cbbe677678a51de13441b7a6ee8592b7b50be1f05c6f626L243-L246.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants