Open ratmice opened 2 years ago
The LSP that I am working generates some extremely long diagnostics, unfortunately diagnostics are typically displayed by editors in a fashion which is only suitable for extremely short messages.
Have you considered shortening the messages, and then referring to "more in-depth" via CodeDescription?
The LSP that I am working generates some extremely long diagnostics, unfortunately diagnostics are typically displayed by editors in a fashion which is only suitable for extremely short messages.
Have you considered shortening the messages, and then referring to "more in-depth" via CodeDescription?
It not static text, but entirely generated with information derived from the source text. If you are familiar with parsers, yacc and the like it essentially contains a representation of the parsing stack which arises from a conflict in the grammar (where my lsp is dealing with yacc files.).
The rust-analyzer
extension has a workaround for dynamically-generated codeDescription
fields. In these parts of their code they create a TextDocumentContentProvider.
However, this is a fix for just VS Code and rust-analyzer, so it's not an ideal solution for the LSP as a whole.
@RobbyCBennett Yeah, implementing a TextDocumentContentProvider
is exactly what I ended up doing as well eventually.
@RobbyCBennett I believe your second comment was actually intended for #1461
Okay. I'll move it to there.
I was curious if there were any plans for a server to client mechanism for sending
TextDocumentItem
's from server to client, currently which I understand is only used for sending client documents to the server.As well as a mechanism for specifying a uri for each active lsp presumably the uri could be sent to the client in the
serverInfo
of aInitializeResult
from which a client can then recognize documents from the server insideTextDocumentIdentifiers
. And a new request by which clients could retrieve a server document.The LSP that I am working generates some extremely long diagnostics, unfortunately diagnostics are typically displayed by editors in a fashion which is only suitable for extremely short messages. In these cases of excessively long diagnostics, it would be nice if we could then refer to server generated documents via their URL in via the
relatedDocuments
component of the diagnostic.