aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/configs.lua
Commit message (Collapse)AuthorAgeFilesLines
* refactor!: deprecate old framework/configs, Nvim 0.10 #4077Justin M. Keyes2025-09-171-1/+1
|
* perf: execute sanitize_cmd only on Windows to speed up WSL #3808luca-sartore-prorob2025-04-301-0/+5
| | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* Revert "fix(configs): remove sanitize_cmd #3806Justin M. Keyes2025-04-291-0/+13
| | | This reverts commit 8bb2facd6fa664fe200d2d491f9f7734202426fd.
* fix(configs): remove sanitize_cmd #3778jrop2025-04-261-13/+0
| | | | | | | Problem: exepath is slow on WSL/Windows. Solution: Remove sanitize_cmd: absolute paths are nice, but not necessary.
* refactor: replace vim.loop with vim.uv #3703v2.0.0Chris Bandy2025-04-101-1/+1
| | | | | | The former is deprecated in neovim 0.10. Remove the check added in 9b89ba5f158f73779cd58d0bb2783dfb40b28b0e. See: https://github.com/neovim/neovim/blob/v0.10.0/runtime/doc/deprecated.txt#L55
* fix: remove validation from configs.luadundargoc2025-01-231-40/+2
| | | | | | | | | | | This is because using the old syntax for vim.validate causes `:checkhealth vim.deprecated` to be flooded with deprecated messages. It would also be possible to do a version check and use the newer syntax for vim.validate, but since configs.lua will be replaced by vim.lsp.config in the future there is little need to future-proof it. Closes https://github.com/neovim/nvim-lspconfig/issues/3583.
* refactor: silence luals warningsdundargoc2025-01-221-0/+5
|
* fix(types): lspconfig.Config commands (#3490)andrew snelling2024-12-041-0/+3
|
* refactor: replace all instances of vim.uv with vim.loopdundargoc2024-12-021-2/+2
| | | | | We still support neovim 0.9 currently, so we can't use vim.uv. Also add a check so we don't accidentally reintroduce it.
* refactor: remove internal implementation of `util.path.sanitize` #3464dundargoc2024-11-261-3/+3
| | | Return value from `vim.fs.normalize` instead.
* refactor: remove implementation of util.path.dirname #3460dundargoc2024-11-261-1/+1
| | | Instead, just return the result of vim.fs.dirname.
* feat: add silent on error optionMaria José Solano2024-11-231-2/+3
|
* fix: correct type annotation on lspconfig.Config::on_new_config (#3411)Tristan Partin2024-10-311-1/+1
| | | | | It takes a new_root_dir parameter as documented in the help docs. Signed-off-by: Tristan Partin <tristan@partin.io>
* chore(config): improve on_new_config type (#3392)andrew snelling2024-10-231-1/+1
|
* Revert "fix: autostart=false: attach when editing new, nonexistent file ↵glepnir2024-10-041-13/+4
| | | | | #2712" (#3347) This reverts commit fb453a1a443b6ea6b54a1e4c101b1160c9d37950.
* fix: autostart=false: attach when editing new, nonexistent file #2712Iain King-Speir2024-10-031-4/+13
| | | | | | | | | | | | | | | | ## Problem Currently, `nvim-lspconfig` tries to attach servers automatically via two autocommands: 1. Created if `config.autostart == true` and triggered by `FileType`, if `config.filetypes` is set, else `BufReadPost`. Calls `try_add()`. 2. Created for each workspace root, triggered by `BufReadPost` matching paths starting with the root. Calls `try_add_wrapper()`. `BufReadPost` does not fire when creating a buffer for a file that doesn't exist. This means that if `config.autostart == true` and `config.filetypes` is set and includes the detected filetype for the buffer, the server is attached automatically regardless of whether the file exists, but in all other cases the server is only attached for existing files. ## Solution 1. Where these autocommands trigger on `BufReadPost`, also trigger on `BufNewFile`. 2. Wrap the autocommand callbacks in `vim.schedule()` to ensure `filetype` is set first, as the `BufReadPost`/`BufNewFile` autocommands will trigger before `FileType` if `nvim-lspconfig` is set up early enough during Nvim init (see https://github.com/neovim/neovim/issues/7367 and https://github.com/neovim/nvim-lspconfig/pull/2712#discussion_r1261063555). I did consider including a test with this PR, but there doesn't seem to be any existing test infrastructure for tests involving actually running a language server (or a mock of one). Fixes #2711
* fix(health): support Nvim 0.9Justin M. Keyes2024-10-021-1/+1
| | | | fix #3342
* refactor: replace deprecated vim.loop with vim.uvdundargoc2024-10-021-1/+1
|
* feat: expose config definition as `config_def` #3335Justin M. Keyes2024-10-021-2/+7
| | | | | | | | | | | | | | Problem: Users/plugins may want to use the config definition without actually activating the config via setup(). Solution: - Expose `config_def` field and document it. - Also undeprecate some stuff that doesn't yet have a documented alternative. TODO: configs.lua sets `M.filetypes = config.filetypes` and other fields in ad-hoc fashion "for :LspInfo" but it's not clear when those fields are actually populated, and they don't source from `config_def`...
* fix: root_dir support string value directly (#3313)glepnir2024-09-231-2/+4
| | | | | | root_dir in `vim.lsp.ClientConfig` can be a string type and in our annoation also mentioned `string|function` type. but actually root_dir does not support string type. add a type check of root_dir and then we can use `vim.fs.root` directly.
* docs: `lspconfig.Config` class not modifying inherited `root_dir` (#3243)Chris Grieser2024-07-221-0/+1
|
* fix: update lua types to match latest nightly (#3048)Carlo Sala2024-03-051-2/+2
|
* fix: let core handle 'workspace/didChangeConfiguration' after init (#3023)Maria José Solano2024-02-241-3/+0
|
* fix: disable autostart after :LspStop #2987brook hong2024-01-281-0/+3
| | | | | | | | | | Problem: The `BufReadPost` handler may autostart LSP, even after `:LspStop`. Solution: Remove the `BufReadPost` handler if there are no clients (assuming that `:LspStop` stopped them). Note: The `BufReadPost` handler will be recreated if user runs `:LspStart`.
* fix(launch): check buffer is valid before get_name (#2852)Saltaformajo2023-10-041-0/+3
| | | Co-authored-by: coffeebar <corp@dev.null>
* refactor: add sanitize_cmd()Lewis Russell2023-08-221-8/+12
|
* refactor: move manager to separate moduleLewis Russell2023-08-221-91/+29
| | | | | | - Move manager logic to own module - Move async logic to own module - Improve type annotations
* fix(command): LspRestart should attached before buffers (#2674)Raphael2023-06-141-2/+2
|
* fix: check cmd not empty (#2602)Raphael2023-05-101-1/+1
|
* fix: vim.lsp.rpc.connect is not allowed in cmd (#2597)Access2023-05-091-1/+1
| | | I think only table need to expand
* fix: use exepath on server command (#2595)Raphael2023-05-091-0/+8
|
* feat: wrap get root dir in coroutine . (#2565)Raphael2023-05-061-79/+97
| | | Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
* fix: remove vim.schedule for on_attach (#2546)Raphael2023-04-071-2/+2
|
* fix(sqls): deprecate sqls suggest sqlls instead (#2544)Raphael2023-04-051-0/+11
|
* fix: not register workspace when in single file mode (#2367)Raphael2022-12-291-2/+2
|
* fix: check workspace after client initial (#2356)Raphael2022-12-261-9/+3
| | | | | | | | | | | | | | | | | | | * fix: some server need restart * fix: improve * fix: async start client * fix: remove session file * fix: improve logic * fix: improve logic * fix: check the root already in workspace * fix: improve check * fix: add start_new_client into the if branch
* fix: typo of vim.loop.cwd (#2293)Raphael2022-12-071-1/+1
|
* feat: support unnamed buffer with single_file_support (#2226)Raphael2022-12-061-8/+16
| | | | | | | | | | | * feat: support unnamed buffer with single_file_support * fix: make some code simple clear * feat: update doc * fix: grammar * fix: grammar
* perf: use alias api variable (#2260)Raphael2022-11-261-10/+10
|
* fix: cmd vim.lsp.rpc.connect by user (#2213)Access2022-10-231-1/+5
| | | when user what to set cmd to vim.rpc.connect, but it is a function
* feat: pass user config to the on_setup hook (#2114)William Boman2022-09-081-11/+11
| | | | | | | This is to allow 3rd party plugins to discern between what is lspconfig's vendored server config and what the user provided. Currently, these are merged into a single table which is passed to the on_setup hook. Passing user_config as a 2nd argument would allow 3rd party plugins to apply a more sensible precedence of configs.
* Revert "fix: remove the config.commands (#2092)" (#2093)Raphael2022-08-261-0/+27
| | | This reverts commit 99e0dc9937b124dee7d8107185e804ff96466279.
* fix: remove the config.commands (#2092)Raphael2022-08-261-27/+0
| | | | | | | | | * fix: remove the config.commands * fix: format by stylua and remove comamnds test * fix: remove commands from doc * fix: remove unused function
* feat!: 0.7 API update (#1984)Ranjith Hegde2022-08-231-28/+33
| | | | | | | | | | | * switch to lua api for autocommands * switch to nvim_create_user_command * move to lua plugin initialization NOTICE: Defining commands in server configurations will be deprecated in future releases. See `:help lspconfig.txt` to setup the same in an `on_attach` function. Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
* style: fix bad formatting (#1944)Peter Lithammer2022-06-021-1/+1
|
* fix: no-argument :LspStop, :LspRestart with standalone files #1785Rishikesh Vaishnav2022-06-011-1/+8
| | | | | | | The no-argument versions of `:LspStop` and `:LspRestart` currently only apply to buffers that have a valid root directory. It seems that these commands should stop/restart all clients, including those associated with standalone files. Closes #1784
* fix: buffer may be invalid during on_attach #1822Tomasz N2022-05-221-8/+10
| | | on_attach is a nontrivial callback so it makes sense to check the bufnr.
* feat(configs): use client capabilities by default, deep-extend user-provided ↵jdrouhard2022-05-041-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | capabilities #1889 Previously, vim.lsp.protocol.make_client_capabilities() was used if no capabilities were specified in either the user-provided config or the default config (base or server). Now, the base default config table has a capabilities key with the value of make_client_capabilities(). When creating the finalized configuration for a server, it simply uses the finalized config which is the user-provided config deep extended by the default config (which now contains the default capabilities). This means that users will no longer have to create their own customized capabilities tables seeded from vim.lsp.protocol.make_client_capabilities(). They simply need to create the parts that are new or different from the defaults and pass that as the capabilities. The rest of the defaults are filled in automatically. For this to work properly, some tbl_extend calls were changed to tbl_deep_extend. tbl_extend will not recursively update nested tables, so using it wipes out any server provided defaults in nested config keys (such as capabilities) and won't properly fill in the "rest" of the capabilities if the user provided a smaller capabilities key in their config. Changing to tbl_deep_extend ensures server-specific configuration values are preserved and that the finalized config at least contains defaults for all client-supported capabilities. For example, clangd's config default has: ``` local default_capabilities = { textDocument = { completion = { editsNearCursor = true, }, }, offsetEncoding = { 'utf-8', 'utf-16' }, } ``` Prior to this commit, this was the full vim.lsp.protocol.make_client_capabilities() extended with those extra values. However, if a user provided their _own_ capabilities to the setup() function, tbl_extend wiped these extra values out and replaced it with the users' capabilities, which was likely only vim.lsp.protocol.make_client_capabilities() with some _other_ tweaks. Now, clangd can simply provide the extras, and the setup() function will normalize the config with all of user-provided, server-specific, and base default capabilities.
* ci: fix new luacheck v0.26.0 errorsPeter Lithammer2022-03-281-9/+9
| | | | | | | | | See https://github.com/lunarmodules/luacheck/releases/tag/v0.26.0 lua/lspconfig/util.lua:225:40: used variable _make_config lua/lspconfig/configs.lua:207:63: used variable _root_dir lua/lspconfig/configs.lua:260:19: 'not (x == y)' can be replaced by 'x ~= y' (if neither side is a table or NaN)
* feat: remove warning when server fails to start (#1711)Michael Lingelbach2022-02-111-8/+0
|