microsoft / microsoft/vscode-languageserver-node

Error handler unable to intercept and suppress error notification

Open
#1,608 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted
Dominant language
TypeScript
Stars
1.8k
Forks
404
Avg merge
2d 8h
Merged PRs (30d)
14

Description

https://github.com/microsoft/vscode-languageserver-node/blob/dadd73f7fc283b4d0adb602adadcf4be16ef3a7b/client/src/common/client.ts#L1793-L1803

I am developing a language server with an external dependency so I want to start/stop it myself. Unfortunately, if the dependency goes missing then the "Connection to server got closed. Server will not be restarted." message will appear if this.$state === ClientState.Stopping because I can't use the this._clientOptions.errorHandler to try to suppress it. Now when the dependency comes back the language server will restart even though the notification claimed that it "will not be restarted".

Essentially, I do not want the vscode-languageclient to popup any errors about the server being dead because I want to control everything myself but I can't avoid this particular notification (there may be others I have not encountered yet...?) because of this if statement.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in client/src/common/client.ts at lines 1793-1803 and trace how the error handler interacts with ClientState.Stopping. Reproduce the missing-dependency case and determine how suppression should behave when the client is being controlled externally. Done means the unwanted notification can be suppressed without contradicting the later language-server restart behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.