diff options
| author | Yi Ming <ofseed@foxmail.com> | 2025-04-27 00:09:20 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-26 09:09:20 -0700 |
| commit | f486f1742e5403c3e0604fb2e8cf8761ffb316c3 (patch) | |
| tree | 9da84f8c02645cfbbcc57514fc993aca33ee2e78 /runtime/lua/vim/_ftplugin | |
| parent | 83156974497df69a5f449c15d1fb472afdf7b6ff (diff) | |
| download | rneovim-f486f1742e5403c3e0604fb2e8cf8761ffb316c3.tar.gz rneovim-f486f1742e5403c3e0604fb2e8cf8761ffb316c3.tar.bz2 rneovim-f486f1742e5403c3e0604fb2e8cf8761ffb316c3.zip | |
perf(lsp): include `previousResultId` in `DocumentDiagnosticParams` #32887
Problem:
Users of the Roslyn (C#) LSP have encountered significant delays when
retrieving pull diagnostics in large documents while using Neovim. For
instance, diagnostics in a 2000-line .cs file can take over 20 seconds
to display after edits in Neovim, whereas in VS Code, diagnostics for
the same file are displayed almost instantly.
As [mparq noted](https://github.com/seblj/roslyn.nvim/issues/93#issuecomment-2508940330)
in https://github.com/seblj/roslyn.nvim/issues/93, VS Code leverages
additional parameters specified in the [LSP documentation for
textDocument/diagnostic](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#documentDiagnosticParams),
specifically:
- previousResultId
- identifier
Solution:
When requesting diagnostics, Neovim should include the
`previousResultId` and `identifier` parameters as part of the request.
These parameters enable the server to utilize caching and return
incremental results.
Support for maintaining state is already present in the
[textDocument/semanticTokens implementation](https://github.com/neovim/neovim/blob/8f84167c30692555d3332565605e8a625aebc43c/runtime/lua/vim/lsp/semantic_tokens.lua#L289).
A similar mechanism can be implemented in `textDocument/diagnostic` handler.
Diffstat (limited to 'runtime/lua/vim/_ftplugin')
0 files changed, 0 insertions, 0 deletions