aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* fix: single_file_mode should be single_file_support (#1489)Michael Lingelbach2021-11-261-4/+4
|
* chore: clean up importsMichael Lingelbach2021-11-251-1/+1
|
* fix: only set cmd_cwd if filepath exists (#1485)Michael Lingelbach2021-11-251-1/+2
|
* fix: set correct cwd config key when unset (#1483)Julian Berman2021-11-251-2/+4
| | | pass `cmd_cwd` instead of `cwd` in `config` to start_client
* chore: remove executable check (#1477)Michael Lingelbach2021-11-241-5/+8
| | | | | | * start_client handles checking if the server is executable, it is redundant to check this in lspconfig * vim.fn.executable does not respect cmd_env, which can allow injecting servers via a local PATH override
* chore: internally switch to sending workspaceFolders (#1453)Michael Lingelbach2021-11-191-0/+1
|
* feat: add worktree support to find_git_ancestor (#1450)Michael Lingelbach2021-11-191-1/+2
| | | | | * find_git_ancestor previously only checked for `.git ` directories * git worktrees use a `.git` file with reference to the original git directory
* chore: clean up unused function args (#1426)Michael Lingelbach2021-11-151-1/+1
|
* fix: update error message (#1406)William Boman2021-11-111-1/+1
| | | * point at server_configurations.md instead of CONFIG.md
* feat: spawn the language server in resolved root directory (#1407)Michael Lingelbach2021-11-111-0/+4
|
* feat: add single file mode (#1385)Michael Lingelbach2021-11-111-8/+25
| | | | | | | | | | | | * This adds a "single file mode" option for each language server * Currently, if a root is not detected, a new language server is started for each file opened. * Root directory is set to `nil` in start_client. Some servers will refuse to start, or otherwise panic. This is opt-in per server. * Some servers, such as rust-analyzer, explicitly have a "single file mode", we will not support that until it is officially part of the LSP specification Co-authored-by: Peter Lithammer <peter.lithammer@gmail.com>
* feat: improve interface for `:Lsp*` commands (#1324)Vsevolod2021-10-171-0/+11
|
* fix: add compat shim for handler change in core (#1248)Christian Clason2021-09-101-0/+21
| | | | | | Add a compatibility shim to `util.lua` adapting to change in handler signature and use it where needed. (Skip `rust-analyzer` and `denols` since their requests don't use handlers.)
* fix(ui): gracefully handle nil filetypes (#1217)kylo2522021-09-031-6/+9
|
* feat(lspinfo): improve layout (#1186)kylo2522021-08-281-0/+28
|
* Revert "feat(ui): lspinfo: better layout #1184)" (#1185)Michael Lingelbach2021-08-251-11/+0
| | | This reverts commit d6e78ef013a57761226df5b842d52912f15011dd.
* feat(ui): lspinfo: better layout #1184)kylo2522021-08-251-0/+11
|
* chore: remove modeline (#1177)Michael Lingelbach2021-08-241-1/+0
|