microsoft / vscode-languageserver-node

Language server protocol implementation for VSCode. This allows implementing language services in JS/TS running on node.js
MIT License
1.45k stars 325 forks source link

Allow clients of the LSP library to capture all errors and show customized / localized message. #1262

Open Zebsterpasha opened 1 year ago

Zebsterpasha commented 1 year ago

Hi) I've faced with some not localized phrases in products use your module. Some packages throw errors and exceptions without any processing (for example: package vscode-languageserver).

Could you, please, add localization for theese phrases?

For example, I faced with that and some other messages:

https://github.com/microsoft/vscode-languageserver-node/blob/2041784436fed53f4e77267a49396bca22a7aacf/jsonrpc/src/common/connection.ts#L1522

Thanks in advance)

dbaeumer commented 1 year ago

Most of the error message are kept in English since they should only end-up in Logs/Log output channels. We do this since we would not understand localized message otherwise (it for example can't speak Spanish and could not make any use of a Spanish message in the log).

dbaeumer commented 1 year ago

Where do you see these message?

Zebsterpasha commented 1 year ago

Most of the error message are kept in English since they should only end-up in Logs/Log output channels. We do this since we would not understand localized message otherwise (it for example can't speak Spanish and could not make any use of a Spanish message in the log).

Yaeh, I understand it, but some products use your product as a dependency and some messages throws in the UI without any processing, and I can't handle it on my side.

image

Here these messages in the UI. It came from Theia, but in Theia it had come from the vscode-jsonrpc npm dependency module. Some time ago, all of these phrases were in the file "vscode-jsonrpc/lib/common/connection.js", it was like this:

"Pending response rejected since connection got disposed"
"Restarting server failed"
"Server initialization failed."
"${this._name} client: couldn't create connection to server."
"The ${this.client.name} server crashed ${this.maxRestartCount + 1} times in the last 3 minutes. The server will not be restarted. See the output for more information." 

But not I could find just one phrase.

Here another example of how it looks (not mine) in vscode extension: image

Issue where I got last picture: https://github.com/microsoft/pylance-release/issues/3391