-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lsp): implement textDocument/diagnostic #24128
Conversation
2376041
to
2d622f7
Compare
ef51d39
to
e4b5532
Compare
I wonder if the requests for diagnostics is better done within the changetracking functionality in |
3dc4d67
to
959385c
Compare
I would consider this a blocker. We can't keep duplicating non-trivial caching/debounce/timer logic. |
I was thinking that we could trigger a autocmd when the client sends a |
Could add a |
This comment was marked as resolved.
This comment was marked as resolved.
bdb3556
to
a256b5b
Compare
Does this approach of using |
Is there a way to set something like |
Not really. Why can't
Not currently. But we already are attaching stuff in the neovim/runtime/lua/vim/lsp.lua Line 1506 in 8a788e2
data field instead of bothering with v:event .
|
Would that mean that any autocmds created for |
That seems fine to me. Ideally the event system would allow subscribers to opt-in more granularly, but that's a bigger topic. |
+1 for adding the
Also keep in mind that
I think that can also happen in a separate PR to keep the scope of this one smaller. Helps with review and getting it merged faster. |
66d95a3
to
f131755
Compare
@@ -550,6 +551,27 @@ to the callback in the "data" table. The token fields are documented in | |||
Note: doing anything other than calling | |||
|vim.lsp.semantic_tokens.highlight_token()| is considered experimental. | |||
|
|||
LspNotify *LspNotify* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we sort these entries alphabetically?
e65e764
to
2d43f83
Compare
0df12b5
to
ce3186e
Compare
Looks like this breaks inlay hints, (even) if not enabled:
|
Ok, I think I fixed that up, and tested it with rust-analyzer. The problem was that |
6d6b697
to
a18dfda
Compare
Is there anything left to do before we can merge this in? |
|
||
local result = rpc.notify(method, params) | ||
|
||
if result then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If result is falsy (i.e. rpc.notify failed?) is that reflected in the logs somehow? If not, should it be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result is false if the client stopped. In that case no notification is sent.
Other failures would point to client bugs and probably bubble up, or if the payload is wrong, hopefully get handled in a decent way on the server side - since there are no responses to notifications the client probably won't receive an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe client_active
is a better name for this variable
if result then | |
if client_active then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied that suggestion in the PR here: #24411
This comment was marked as resolved.
This comment was marked as resolved.
This should be fixed by #24469 |
I'm trying to implement the textDocument/diagnostic capability introduced in LSP 3.17.0 (#22838)
The client initiates a request for diagnostics to the server, instead of having the server push diagnostics to the client.
I took a lot of the code from the inlayHints implementation since that also seemed to poll the server in similar way.
Current status:
diagnosticProvider
capabilityTODO:
ruby-lsp
attaches. Does this go into lspconfig?[DiagnosticRegistrationOptions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticRegistrationOptions)
for namespace determination - LSP diagnostics: support dynamic registration #24412inlay_hint
to useLspNotify
- refactor(lsp): use LspNotify for inlay_hint #24411lsp.Client
as per this comment below.