microsoft/vscode-languageserver-node

Error handler unable to intercept and suppress error notification

开放

#1,608 创建于 2025年2月3日

 (5 条评论) (2 个反应) (0 位负责人)TypeScript (397 个派生)auto 404
feature-requesthelp wanted

仓库指标

星标
 (1,776 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南