| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
| |
Co-authored-by: Jesse <github@jessebakker.com>
|
|
|
|
| |
Resolves #30034
|
|
|
|
|
|
|
|
|
|
| |
- Partition the handlers in vim.lsp.handlers as:
- client to server response handlers (RCS)
- server to client request handlers (RSC)
- server to client notification handlers (NSC)
Note use string indexes instead of protocol.methods for improved
typing in LuaLS (tip: use hover on RCS, RSC or NSC).
|
| |
|
| |
|
|
|
| |
Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
|
|
|
|
|
|
|
| |
The codelens implementation can resolve command via `codeLens/resolve`.
The spec added client capabilities for that:
https://github.com/microsoft/language-server-protocol/pull/1979
|
|
|
|
|
|
| |
Problem: CompletionItem in lsp spec mentioned the deprecated attribute
Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated
in complete function
|
|
|
|
|
|
|
|
|
|
| |
While this relies on a proposed LSP 3.18 feature, it's fully backwards
compatible, so IMO there's no harm in adding this already.
Looks like some servers already support for this e.g.
- gopls: https://go-review.googlesource.com/c/tools/+/510235
- clangd: https://github.com/llvm/llvm-project/pull/80180
Fixes #27293
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The file watcher backends for Linux have too many limitations and
doesn't work reliably.
Solution:
disable didChangeWatchedFiles on Linux
Ref: #27807, #28058, #23291, #26520
|
| |
|
|
|
|
|
|
| |
Fixup for #27628
Closes #27669
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Currently `deepcopy` hashes every single tables it copies so it can be
reused. For tables of mostly unique items that are non recursive, this
hashing is unnecessarily expensive
Solution:
Port the `noref` argument from Vimscripts `deepcopy()`.
The below benchmark demonstrates the results for two extreme cases of
tables of different sizes. One table that uses the same table lots of
times and one with all unique tables.
| test | `noref=false` (ms) | `noref=true` (ms) |
| -------------------- | ------------------ | ----------------- |
| unique tables (50) | 6.59 | 2.62 |
| shared tables (50) | 3.24 | 6.40 |
| unique tables (2000) | 23381.48 | 2884.53 |
| shared tables (2000) | 3505.54 | 14038.80 |
The results are basically the inverse of each other where `noref` is
much more performance on tables with unique fields, and `not noref` is
more performant on tables that reuse fields.
|
|
|
|
|
|
|
|
|
|
| |
The purpose of this commit is to make diff clean and easy to read; to
see the diff resulted from actual changes in gen_lsp.lua, not from the
updated LSP protocol JSON data.
Ran: `nvim -l scripts/gen_lsp.lua gen --methods`
Based on 3.18.0 (2023-12-23)
|
| |
|
|
|
|
| |
This ensures workspace/didChangeConfiguration notification sent after init is correctly handled
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()`
Problem:
The LSP specification allows inlay hints to include tooltips, clickable
label parts, and code actions; but Neovim provides no API to query for
these.
Solution:
Add minimal viable extension point from which plugins can query for
inlay hints in a range, in order to build functionality on top of.
Possible Next Steps
---
- Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for
usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
|
|
|
|
|
| |
To reduce cross-chatter between modules and for https://github.com/neovim/neovim/issues/25272
Also preparing for https://github.com/neovim/neovim/issues/25714
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
- Notifications are missing from `lsp.Methods`.
- Need a way to represent `$/` prefixed methods.
Solution:
- Generate notifications.
- Use "dollar_" prefix for `$/` methods.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Neovim already passed `data` element from published diagnostic to code action, but failed to announce it in client capabilities.
Here is the test that shows that `data` element is returned by `vim.lsp.diagnostic.get_line_diagnostics()`:
https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/test/functional/plugin/lsp/diagnostic_spec.lua#L103-L115
and then `get_line_diagnostics()` is used to construct the context for code action request:
https://github.com/neovim/neovim/blob/f56c1848091bb64c63b5bc25ec74bcbd2f52bdde/runtime/lua/vim/lsp/buf.lua#L742
|
| |
|
|
|
| |
'hierarchicalWorkspaceSymbolSupport' is not part of the LSP Specification
|
|
|
|
|
| |
- fix lint / analysis warnings
- locations_to_items(): get default offset_encoding from active client
- character_offset(): get default offset_encoding from active client
|
|
|
|
|
| |
Since https://github.com/neovim/neovim/pull/23681 there is dynamic
registration support. We should use that for new features unless there
is a good reason to turn it off.
|
|
|
| |
initial support; public API left for a follow-up PR
|
| |
|
|
|
|
| |
The Nvim client does not yet support multiple offset encodings for
clients in the same buffer. Until it does, stick to utf-16 by default.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- `client.dynamic_capabilities` is an object that tracks client register/unregister
- `client.supports_method` will additionally check if a dynamic capability supports the method, taking document filters into account. But only if the client enabled `dynamicRegistration` for the capability
- updated the default client capabilities to include dynamicRegistration for:
- formatting
- rangeFormatting
- hover
- codeAction
- hover
- rename
|
| |
|
|
|
|
| |
Now that we have builtin EditorConfig support and a formatting check in
CI, these are not necessary.
|
|
|
|
|
|
| |
The LSP spec supports two tags that can be added to diagnostics:
unnecessary and deprecated. Extend vim.diagnostic to be able to handle
these.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit 5732aa706c639b3d775573d91d1139f24624629c.
Causes editor to freeze in projects with many watcher registrations
|
| |
|
| |
|
|
|
|
|
| |
(#21665)
Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
|