| Age | Commit message (Collapse) | Author | Files |
|
Problem:
LSP CompletionItem.preselect is not supported.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionClientCapabilities
Solution:
- Add "preselect" field to complete-items and "preselect" flag
to 'completeopt'.
- Set preselectSupport=true in LSP client capabilities.
|
|
Problem: CompletionItem.labelDetails is ignored, losing
function signatures and module info in the completion menu.
Solution: Append labelDetails.detail to abbr and use
labelDetails.description for menu with fallback to item.detail.
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemLabelDetails
|
|
Problem:
No completionItem/resolve handler.
Solution:
If completeopt=popup is set, invoke completionItem/resolve when
a completion item is selected. Show resolved documentation in popup next
to the completion menu.
|
|
|
|
|
|
|
|
- Refactor LSP client to use unified provider-based capability lookup for
diagnostics and other features.
- Introduce `_provider_value_get` to abstract capability retrieval,
supporting both static and dynamic registrations.
- Update diagnostic handling and protocol mappings to leverage
provider-centric logic.
|
|
From the LSP Spec:
> There are two uses cases where it can be beneficial to only compute
> semantic tokens for a visible range:
>
> - for faster rendering of the tokens in the user interface when a user
> opens a file. In this use case, servers should also implement the
> textDocument/semanticTokens/full request as well to allow for flicker
> free scrolling and semantic coloring of a minimap.
> - if computing semantic tokens for a full document is too expensive,
> servers can only provide a range call. In this case, the client might
> not render a minimap correctly or might even decide to not show any
> semantic tokens at all.
This commit unifies the usage of range and full/delta requests as
recommended by the LSP spec and aligns neovim with the way other LSP
clients use these request types for semantic tokens.
When a server supports range requests, neovim will simultaneously send a
range request and a full/delta request when first opening a file, and
will continue to issue range requests until a full response is
processed. At that point, range requests cease and full (or delta)
requests are used going forward. The range request should allow servers
to return a result faster for quicker highlighting of the file while it
works on the potentially more expensive full result. If a server decides
the full result is too expensive, it can just error out that request,
and neovim will continue to use range requests.
This commit also fixes and cleans up some other things:
- gen_lsp: registrationMethod or registrationOptions imply dynamic
registration support
- move autocmd creation/deletion to on_attach/on_detach
- debounce requests due to server refresh notifications
- fix off by one issue in tokens_to_ranges() iteration
|
|
|
|
Work on #37166
- Dynamic Registration Tracking via Provider
- Supports_Method
- Multiple Registrations
- RegistrationOptions may dictate support for a method
|
|
#36754" (#36865)
This reverts commit 03d6cf7aae4a72c7221a4fb8ebb14a7c8603ba18.
See https://github.com/neovim/neovim/pull/36754#issuecomment-3626115697
The change was supposed to avoid showing stale diagnostics but had the
opposite effect.
|
|
|
|
Problem:
Our LSP type system didnt have a concept of RegistrationMethods, this is where the method to dynamically register for a capability is sent to a different method endpoint then is used to call it. Eg `textDocument/semanticTokens` rather than the specific full/range/delta methods
Solution:
Extended generator to create `vim.lsp.protocol.Methods.Registration` with these registration methods. Also extend `_request_name_to_client_capability` to cover these methods. Adjust typing to suit
|
|
|
|
Problem:
Nvim supports `textDocument/semanticTokens/full` and `…/full/delta`
already, but most servers don't support `…/full/delta` and Nvim will try
to request and process full semantic tokens response on every buffer
change. Even though the request is debounced, there is noticeable lag if
the token response is large (in a big file).
Solution:
Support `textDocument/semanticTokens/range`, which requests semantic
tokens for visible screen only.
|
|
This commit makes it so that push diagnostics received for an outdated
document version are ignored.
|
|
Problem:
With the typescript LSes typescript-language-server and vtsls,
omnicompletion on partial tokens for certain types, such as array
methods, and functions that are attached as attributes to other
functions, either results in no entries populated in the completion menu
(typescript-language-server), or an unfiltered completion menu with all
array methods included, even if they don't share the same prefix as the
partial token being completed (vtsls).
Solution:
Enable insertReplaceSupport and uses the insert portion of the lsp
completion response in adjust_start_col if it's included in the
response.
Completion results are still filtered client side.
|
|
|
|
|
|
|
|
|
|
Implements [on-type
formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting)
using a `vim.on_key()` approach to listen to typed keys. It will listen
to keys on the *left hand side* of mappings. The `on_key` callback is
cleared when detaching the last on-type formatting client. This feature
is disabled by default.
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
|
|
|
|
|
|
|
|
|
|
ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange
|
|
|
|
|
|
Also remove `serverErrorStart/End` as [the spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#errorCodes)
says that they're deprecated and don't even represent a real error code.
|
|
|
|
This commit also makes it so that folds which have an unsupported fold
kind have their `kind` ignored.
|
|
This commit also makes it so that disabled code actions are not
displayed unless the trigger kind is "Invoked".
|
|
|
|
|
|
Select outwards with "an" and inwards with "in" in Visual mode.
Ranges are reset when leaving Visual mode.
|
|
This commit also adds a type annotation to the returned client
capabilities table, because without it lua_ls does not provide
autocompletion for the fields within the table.
|
|
* refactor(lsp): remove underscore prefix from local variables
* feat(lsp): workspace diagnostic support
|
|
|
|
|
|
|
|
test(lsp): add tests form `vim.lsp.document_color`
|
|
This change modifies gen_lsp.lua so alias types are generated for
various types of lsp methods to distinguish between notifications
and requests:
- vim.lsp.protocol.Method.ServerToClient.Request
- vim.lsp.protocol.Method.ServerToClient.Notification
- vim.lsp.protocol.Method.ClientToServer.Request
- vim.lsp.protocol.Method.ClientToServer.Notification
These types are then used instead of `string` where appropriate.
|
|
Problem:
vim.lsp.completion with "autotrigger" enabled, does not send
completion context, even though it has all the necessary info.
Solution:
Include the context for "autotrigger".
trigger() also optionally accepts context when manually invoked.
|
|
* fix(lsp): don't call codeAction_resolve with commands
* feat(lsp): support for resolving code action command
|
|
|
|
|
|
`command` was already resolved via a `completionItem/resolve` request
but only if `additionalTextEdits` were also present, and the
`resolveSupport` capability wasn't listed.
Closes https://github.com/neovim/neovim/issues/32406
|
|
|
|
* refactor(shared): extract `vim._list_insert` and `vim._list_remove`
* feat(lsp): add `vim.lsp.foldexpr()`
* docs(lsp): add a todo for state management
* feat(lsp): add `vim.lsp.folding_range.foldclose()`
* feat(lsp): schedule `foldclose()` if the buffer is not up-to-date
* feat(lsp): add `vim.lsp.foldtext()`
* feat(lsp): support multiple folding range providers
* refactor(lsp): expose all folding related functions under `vim.lsp.*`
* perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once
|