| Commit message (Collapse) | Author | Age |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
If `vim.lsp.enable()` fails with an error, either because `'*'` is one
of the provided names or because there is an error in a config,
`vim.lsp.enable()` will still have side-effects:
- All names before the one that encountered an error will still be added
to `lsp._enabled_configs`, but the autocommand will not get added or
run.
- Any name which makes `vim.lsp.config[name]` error will be added to
`lsp._enabled_configs`, causing all future calls to `vim.lsp.enable()`
to fail. This will also break `:che vim.lsp`.
Solution:
- Check all names for errors before modifying `lsp._enabled_configs`.
- Check `vim.lsp.config[name]` does not raise an error before enabling
the name.
|
| | |
|
| |
|
|
|
|
|
| |
Close #37289
Close #37348
Co-authored-by: Marc Jakobi <marc@jakobi.dev>
Co-authored-by: Anton Kesy <anton@kesy.de>
|
| |
|
|
|
|
|
|
| |
Work on #37166
- Dynamic Registration Tracking via Provider
- Supports_Method
- Multiple Registrations
- RegistrationOptions may dictate support for a method
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
claims to be a "data-only" plugin, in fact it still provides some
user-facing commands because they haven't been upstreamed to Nvim.
Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
restart`, `:lsp start` and `:lsp stop` respectively.
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
|
|
|
|
| |
fix https://github.com/neovim/neovim.github.io/issues/419
Co-authored-by: Rob Pilling <robpilling@gmail.com>
|
| |
|
|
|
|
|
|
| |
Problem:
The `flags` field calls its sub-fields "experimental".
But `exit_timeout` is now used for multiple purposes.
Solution:
Graduate `exit_timeout` to a top-level ClientConfig field.
|
| |
|
|
|
|
|
| |
Problem:
LSP server may not exit even after the client was stopped/disabled via enable(false).
Solution:
Automatically force-stop after a timeout, unless `client.flags.exit_timeout = false`.
|
| | |
|
| |
|
|
|
| |
* feat(lsp): deprecate `vim.lsp.stop_client`
* fix(tests): fix nil variable in diagnostic_spec.lua
|
| | |
|
| | |
|
| |
|
|
|
|
| |
- mention "lua_ls", not "luals". https://github.com/neovim/neovim/discussions/36182
Co-authored-by: Maria Solano <majosolano99@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
This warning doesn't really make sense, since the `enable()` call is
meant to be run before the `lsp.config` calls. It will be logged many
times (once for each enabled LSP) at startup.
This is especially annoying because calling `enable()` after
configuration causes the first opened buffer not to have its filetype
set in some situations. This is a separate bug which really needs to be
fixed, and makes this superfluous logging more likely.
|
| |
|
|
|
| |
where appropriate. (#36180)
fix(lsp): replace `string` types with LSP method alias where appropriate
|
| |
|
|
|
|
|
| |
function" #36183
This reverts commit 97ab24b9c7d9327740f0692f8076fed5737a52dc.
See discussion in https://github.com/neovim/neovim/pull/36071
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
If a client doesn't have a config then an error may be thrown.
Probably caused by: 2f78ff816b03661b5f74d0624e973eaca0d64ef1
Lua callback: …/lsp.lua:442: attempt to index local 'config' (a nil value)
stack traceback:
…/lsp.lua:442: in function 'can_start'
…/lsp.lua:479: in function 'lsp_enable_callback'
…/lsp.lua:566: in function <…/lsp.lua:565>
Solution:
Not all clients necessarily have configs.
- Handle `config=nil` in `can_start`.
- If user "enables" an invalid name that happens to match a *client*
name, don't auto-detach the client.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix(lsp): type of root_dir should be annotated with string|fun|nil
* feat(lsp): support root_dir as function in _get_workspace_folders
* feat(lsp): let checkhealth support root_dir() function
Examples:
vim.lsp: Active Clients ~
- lua_ls (id: 1)
- Version: <Unknown>
- Root directories:
~/foo/bar
~/dev/neovim
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| | |
|
| |
|
|
|
|
|
| |
Close #35926
Close #35818
Co-authored-by: skewb1k <skewb1kunix@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
|
| |
|
|
|
|
|
| |
Problem: The registerCapability handler re-enables document_color,
making it impossible to disable it in LspAttach.
Solution: Enable it once on initialization and avoid re-enabling
on registerCapability.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
LSP logs show misleading "cannot start" messages when editing a filetype
NOT listed in the `config.filetypes` field.
[ERROR][2025-09-13 18:55:56] …/runtime//lua/vim/lsp/log.lua:151
"cannot start cssls due to config error: …/runtime//lua/vim/lsp.lua:423:
cmd: expected expected function or table with executable command,
got table: 0x0104701b18. Info: vscode-css-language-server is not executable"
Solution:
- `can_start`: check `config.filetypes` before checking the rest of the
config.
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Closes #31453
Solution:
Introduce `vim.lsp.Capability`, which may serve as the base class for
all LSP features that require caching data. it
- was created if there is at least one client that supports the specific method;
- was destroyed if all clients that support the method were detached.
- Apply the refactor for `folding_range.lua` and `semantic_tokens.lua`.
- Show active features in :checkhealth.
Future:
I found that these features that are expected to be refactored by
`vim.lsp.Capability` have one characteristic in common: they all send
LSP requests once the document is modified. The following code is
different, but they are all for this purpose.
- semantic tokens:
https://github.com/neovim/neovim/blob/fb8dba413f2bcaa61c15d1854b28112e3e91a035/runtime/lua/vim/lsp/semantic_tokens.lua#L192-L198
- inlay hints, folding ranges, document color
https://github.com/neovim/neovim/blob/fb8dba413f2bcaa61c15d1854b28112e3e91a035/runtime/lua/vim/lsp/inlay_hint.lua#L250-L266
I think I can sum up this characteristic as the need to keep certain
data synchronized with the latest version computed by the server.
I believe we can handle this at the `vim.lsp.Capability` level, and
I think it will be very useful.
Therefore, my next step is to implement LSP request sending and data
synchronization on `vim.lsp.Capability`, rather than limiting it to the
current create/destroy data approach.
|
| | |
|
| |
|
|
| |
The type annotation for `vim.lsp.ClientConfig.cmd` was changed,
but the update was not propagated to `vim.lsp.Config`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
The cancel function returned by `vim.lsp.buf_request` tries to cancel
all the requests, including those that have already been completed,
causing "Cannot find request with id ... whilst attempting to cancel"
errors to be logged when it is called.
Solution:
Only cancel the requests that are present in `client.requests`.
|
| | |
|
| |
|
|
| |
Type fixes caught by emmylua
|
| |
|
|
|
|
|
| |
Problem: A custom server (initialized through `vim.lsp.start`) gets
unexpectedly detached.
Solution: Only auto-detach the clients enabled through `vim.lsp.enable`
to prevent unexpected behavior.
|
| | |
|
| |
|
|
|
|
|
| |
Problem:
vim.validate does not handle `message` param.
Solution:
Add the missing logic.
|
| |
|
|
|
|
|
| |
Problem:
Stopping a language server and then calling vim.lsp.start() with the same name/root will return the old language server that's in the middle of shutting down. vim.lsp.start() won't return a new server until the old process has terminated.
Solution:
Introducing a client._is_stopping field that tracks the shutdown phase, preventing the client from being reused.
|
| |
|
|
|
|
|
|
| |
Problem:
enable() routine detaches clients even if they were manually started
and not managed by vim.lsp.config.
Solution:
Skip clients that aren't managed by vim.lsp.config.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
When the buffer 'filetype' changes, invalid or non-applicable LSP
clients are not detached.
https://github.com/neovim/neovim/issues/33443
https://github.com/neovim/nvim-lspconfig/issues/3326
Solution:
In the enable() routine, check can_start() on _existing_ clients.
|
| |
|
|
|
|
|
|
|
| |
Problem:
No way to check if a LSP config is enabled without causing it to
resolve. E.g. `vim.lsp.config['…'] ~= nil` will resolve the config,
which could be an unwanted and somewhat expensive side-effect.
Solution:
Introduce `vim.lsp.is_enabled()`.
|
| |
|
| |
closes #33761
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
enable() could be more flexible, so that it works even if called "late".
Solution:
- enable(true) calls `doautoall nvim.lsp.enable FileType`.
- enable(false) calls `client:stop()` on matching clients.
This will be useful for e.g. :LspStop/:LspStart also.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
root_markers cannot specify "equal priority filenames.
Solution:
Support nesting:
{
...
root_markers = { { ".stylua.toml", ".luarc.json" }, { ".git "} }
...
}
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: Gregory Anders <github@gpanders.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|