Open remcohaszing opened 1 week ago
Recommended a default severity to use in the specification.
This makes sense to me. I suggest you raise an issue about this in microsoft/language-server-protocol.
We can add a recommendation however enforcing it would be a breaking change. What we could do is to add the default severity used by the client to the initialize request so that servers at least know what the value is.
I will transfer the issue since the work as to start in the lsp repository.
I agree enforcing it would be a breaking change and we should stick with recommendations. I have my doubts about the usefulness of communicating the default severity used by the client in the initialize request though. What would the server use it for? Instead, I think it would be better to strongly recommend servers to always specify the severity explicitly.
Also what would the recommended default be? I’m leaning towards Error
, as vscode-languageclient
is used to integrate a lot of language servers already. Meanwhile the Monaco editor implementation is only used to integrate language services that are owned by Microsoft. I don’t know what other clients do.
The LSP specification for diagnostics specifies:
I find this a bit odd to be honest. Why would anyone want a diagnostic to be an error in one client, but a hint in another? I noticed this is interpreted differently even within the VSCode ecosystem. In
vscode-languageclient
, the severity defaults toError
. In Monaco editor however, it defaults toInfo
.In my own package
monaco-languageserver-types
I made the default configurable, with a default toError
. This feels weird though. Why would anyone deviate from Monaco editor? On the other hand, why would anyone deviate from VSCode?I suggest to:
vscode-languageclient
.