How do you publish diagnostics with this library? #12
Replies: 4 comments 1 reply
-
The documentation simply says that you can return a result and an error, the latter being "code and message", which is a little too thin. I interpret this to imply that different implementations might handle the "error" differently... |
Beta Was this translation helpful? Give feedback.
-
But if you had to implement such a functionality, how would you do it?
The ability to perform an action a line of code and edit the current
document to include the result of the action into the page.
…On Sun, Jun 26, 2022, 00:06 Tal Liron ***@***.***> wrote:
The documentation
<https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#workspace_executeCommand>
simply says that you can return a result and an error, the latter being
"code and message", which is a little too thin. I interpret this to imply
that different implementations might handle the "error" differently...
—
Reply to this email directly, view it on GitHub
<#11 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSCVASKLDSH6T5IW2I4GEDVQ57H5ANCNFSM5Z23QXGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have never done so myself. Perhaps other users can chime in with advice? |
Beta Was this translation helpful? Give feedback.
-
I implemented diagnostics with glsp, you can take a look here: I refresh them when receiving It looks like this in Neovim: I didn't use the |
Beta Was this translation helpful? Give feedback.
-
Hi, first of all, thanks for the tremendous amount of work you put into this library.
I'm implementing an LSP for a doctest library which I wrote (https://github.com/apitoolkit/doctests), and the way it should work is such that a user can add golang expressions into their comments, and they can execute those expressions like an inline repl. But the documentation of LSPs has been tough so far. Including on the official lsp spec website. So maybe you can help me better.
I've been able to implement this functionality in 2 ways already, but each way doesn't completely give me what I would like or expect.
I implement the
TextDocumentCodeLens
which triggers code commands. But the problem is that in theWorkspaceExecuteCommand
handler, the return type is just an interface, so I'm completely clueless about how to update the document i'm in like with code actions. So I end up editing the file on disk in the execute command function, but then the user has to reload the file from disk to see the changes i made, or risk making more changes and overwritting the files on disk.Is there a type/data that i can return from executeCommand, to make it edit the current text document instead of by passing the editor to directly edit the file on disk?
Beta Was this translation helpful? Give feedback.
All reactions