aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
Commit message (Collapse)AuthorAgeFilesLines
...
* fix: use new version as check condition (#3157)glepnir2024-05-171-3/+3
|
* refactor: add compatible tbl_flatten and lsp_get_clients for new version ↵glepnir2024-05-171-4/+14
| | | | 0.10 (#3154)
* refactor: general cleanupLewis Russell2024-03-071-3/+16
|
* fix: util.root_pattern prioritises pattern order (#2885)Emilio Ziniades2023-11-181-8/+11
| | | | | | | | | | | | * fix: util.root_pattern prioritises pattern order Instead of traversing the filesystem upwards once and returning the first match of all the patterns, it traverses the filesystem upwards once for each pattern. This means that the order of the patterns provided matters, and the highest priority patterns should be put first. Also updated corresponding tests. * docs: update util.root_pattern description
* fix: lsprestart command faild (#2779)Raphael2023-08-231-2/+1
|
* refactor: move async_run_command()Lewis Russell2023-08-221-34/+0
|
* refactor: move manager to separate moduleLewis Russell2023-08-221-185/+6
| | | | | | - Move manager logic to own module - Move async logic to own module - Improve type annotations
* perf(gopls): make get go mod cache path async (#2673)Raphael2023-06-181-0/+34
|
* fix: check root already in workspace (#2590)Raphael2023-05-071-47/+38
| | | | | | * fix: check root already in workspace --------- Co-authored-by: github-actions <github-actions@github.com>
* fix(eslint): get root patterns by given path (#2556)Raphael2023-04-121-3/+4
|
* fix: register workspace before attaching to buffer (#2525)kylo2522023-03-241-1/+1
|
* fix(util): update `is_windows` detection (#2492)Wuelner Martínez2023-03-051-1/+1
| | | | | Fixes https://github.com/neovim/nvim-lspconfig/commit/641a71e381e23f1d1d6a0722a8b796fda896b55b#commitcomment-102642580 Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com>
* fix: eslint errors on start (regression) (#2452)Jose Veiga2023-02-121-1/+2
|
* fix(stylelint_lsp): update root directory pattern (#2447)Wuelner Martínez2023-02-121-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix(stylelint_lsp): update root directory pattern Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> * feat(util): add `add_package_json_to_config_files_if_field_exists` function Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> * fix(stylelint_lsp): update update root directory pattern implementation Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> * fix(eslint): update update root directory pattern implementation Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> * fix(util): update `is_windows` detection Co-authored-by: Raphael <glephunter@gmail.com> * fix(util): update new function name Co-authored-by: Raphael <glephunter@gmail.com> * fix(server_configurations): update new function name implementation Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> * fix(stylelint_lsp): fix duplicate equals Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> --------- Signed-off-by: Wuelner Martínez <wuelner.martinez@outlook.com> Co-authored-by: Raphael <glephunter@gmail.com>
* fix: check client when get client from cache (#2429)Raphael2023-01-311-2/+2
|
* fix: check server support workspacefolders (#2418)Raphael2023-01-271-79/+100
| | | | | | | add server workspaceFolder check, if server not have workspacefolders.supported field will spawn a new server instance. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_workspaceFolders
* refactor: rewrite client reuse logic (#2371)Raphael2022-12-301-37/+28
| | | | | * refactor: rewrite client reuse logic * fix: not register workspace after new start
* fix: not register workspace when in single file mode (#2367)Raphael2022-12-291-1/+3
|
* fix: get all client from clients cache in manager.clients (#2365)Raphael2022-12-281-4/+6
|
* fix: generate correct workspace didchange request params (#2361)Raphael2022-12-271-68/+67
| | | | | | | | | * fix: generate correct workspace didchange request params * fix: logic rewrite * fix: logic rewrite * fix: spell
* fix: check workspace after client initial (#2356)Raphael2022-12-261-56/+107
| | | | | | | | | | | | | | | | | | | * 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: use client config capabilities to check server support workspae (#2354)Raphael2022-12-251-2/+3
|
* fix: check client exist supports_method (#2351)Raphael2022-12-251-1/+6
|
* fix: check client support workspaceFolders (#2350)Raphael2022-12-251-8/+1
|
* fix: check server_capabilities field exist (#2348)Yuki Ito2022-12-241-1/+6
|
* refactor: remove single_clients and improve clients reuse (#2334)Raphael2022-12-241-80/+83
| | | | | | | | | | | | | | | | | * refactor: remove single_clients and improve clients reuse * fix: remove unused param * chore: correct check * fix: improve * fix: remove debug print * fix: add comment * chore: don't insert workspace when single file mode * chore: add comment
* fix: send the lsp method request after insert workspace folders (#2330)Raphael2022-12-201-1/+8
| | | | | | | * fix: send the lsp method request after insert workspace folders * fix: use client do rpc request * fix: check client support workspace
* fix: run all matched client in LspStart (#2314)Raphael2022-12-131-1/+15
|
* feat: support multiple workspaceFolders and show correct root in Lspinfo (#2304)Raphael2022-12-111-10/+26
| | | | | | | | | | | | | * feat: support multiple workspaceFolders and show correct root in Lspinfo * fix: add return branch * fix: convert path before compare * fix: improve find root dir in LspInfo * fix: check logic * fix: remove unnecessary code
* fix: check client is available and get client id from cache (#2303)Raphael2022-12-101-4/+5
|
* fix: add new root into the workspace folders (#2298)Raphael2022-12-091-6/+9
| | | | | * fix: add the new root to workspaceFolders * fix: add the new root to workspaceFolders
* feat: support unnamed buffer with single_file_support (#2226)Raphael2022-12-061-3/+0
| | | | | | | | | | | * feat: support unnamed buffer with single_file_support * fix: make some code simple clear * feat: update doc * fix: grammar * fix: grammar
* fix(lsp): don't spawn new lsp client if already persent (#2287)sigmaSd2022-12-041-0/+8
|
* fix: escape wildcards patterns when calling glob (#2111) (#2122)emmanueltouzery2022-09-091-1/+6
|
* Revert "fix: remove the config.commands (#2092)" (#2093)Raphael2022-08-261-0/+35
| | | This reverts commit 99e0dc9937b124dee7d8107185e804ff96466279.
* fix: remove the config.commands (#2092)Raphael2022-08-261-35/+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-39/+38
| | | | | | | | | | | * 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>
* feat: allow attaching to paths inside archives (#1687)Stéphan Kochen2022-08-231-3/+15
|
* feat: root finder for Mercurial repo #1847Florin Iucha2022-06-281-0/+8
|
* fix: no-argument :LspStop, :LspRestart with standalone files #1785Rishikesh Vaishnav2022-06-011-2/+4
| | | | | | | 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(glint): detect project dir inside `on_new_config` hook rather than at ↵William Boman2022-05-061-0/+3
| | | | module import
* feat(configs): use client capabilities by default, deep-extend user-provided ↵jdrouhard2022-05-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | 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)
* fix(lspstop): make LspStop behave as described in the docs (#1764)Federico Igne2022-03-091-1/+1
| | | | | | | | | | | | | This bug was introduced in #1324. When calling `:LspStop <args>`, the current code tries to match a string with the format "123 (blablabla)", which will result in terminating the server with ID 123. This is fine when using autocompletion, but if doing this programmatically (or just following the docs) something like `:LspStop 1` will not match anything, resulting in terminating *all* managed servers. This should be enough to fix the bug, allow terminating multiple servers at once and keeping the nice UX provided by the autocompletion.
* fix: only attempt to attach to valid bufnames (#1598)Michael Lingelbach2021-12-231-0/+8
| | | | * Check that a bufname begins with a filesystem root specifier such as a drive letter (Windows) or "/" (Unix) * Unify with check that buf name is not "" or nil
* fix: internally use forward delineated paths cross-platform (#1593)Michael Lingelbach2021-12-231-34/+37
| | | | * Escape paths used to autocommands * Always normalize windows path to forward slash for internal use
* fix: only stop/restart managed clients on :LspStop/:LspRestart (#1591)Jose Alvarez2021-12-211-1/+12
|
* chore!: remove compat shims for pre-0.5.1 handlers (#1530)Christian Clason2021-12-021-21/+0
|
* chore: use client.request instead of buf_request (#1503)ranjithshegde2021-11-291-0/+8
| | | | | | | * Use client.request directly instead of vim.lsp.buf_request to call methods that are outside the official LSP specification, such as clangd's "textDocument/switchSourceHeader". * This avoids sending an inapplicable request to all servers, as we cannot ahead of time validate the methods a given server supports.
* chore: prefix all vim.notify message with [lspconfig] (#1496)William Boman2021-11-271-2/+3
|