aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/configs.lua
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* fix: do not index nil config.filestypes in try_add (#1673)kyoh862022-01-221-4/+8
|
* fix: try_add_wrapper errors if passed nil for bufnr (#1648)v0.1.1oncomouse2022-01-091-0/+1
|
* fix: properly handle sanitizing bufname in .launch() (#1608)Michael Lingelbach2021-12-251-5/+4
|
* fix: attach to buffer when manually launching in single file mode (#1599)v0.1.0Michael Lingelbach2021-12-231-1/+2
|
* fix: only attempt to attach to valid bufnames (#1598)Michael Lingelbach2021-12-231-12/+13
| | | | * 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: do not attach server to buffers with nil or missing name (#1597)Michael Lingelbach2021-12-231-4/+20
|
* fix: internally use forward delineated paths cross-platform (#1593)Michael Lingelbach2021-12-231-7/+9
| | | | * Escape paths used to autocommands * Always normalize windows path to forward slash for internal use
* chore: fix missing [lspconfig] prefix for vim.notify (#1546)William Boman2021-12-061-1/+1
|
* chore: prefix all vim.notify message with [lspconfig] (#1496)William Boman2021-11-271-2/+6
|
* chore: clean up importsMichael Lingelbach2021-11-251-1/+1
|
* chore: format with stylua (#1457)Michael Lingelbach2021-11-191-4/+6
|
* chore: internally switch to sending workspaceFolders (#1453)Michael Lingelbach2021-11-191-0/+4
|
* fix: support single file mode when no default root pattern setMichael Lingelbach2021-11-151-3/+11
|
* feat: add single file mode (#1385)Michael Lingelbach2021-11-111-15/+34
| | | | | | | | | | | | * 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>
* fix: disambiguate autostart option from function name (#1356)kylo2522021-11-081-11/+19
| | | | | | * make `config.autostart` separate from `config.launch()` * simplify handling of `config.autostart` * check for `true` instead of `not false` * replace `trigger` with the conventional `event` and `pattern`
* fix: set offset encoding by default (#1360)Michael Lingelbach2021-10-311-1/+7
| | | | | | Some servers (clangd, rust-analyzer) support using byte ranges (utf-8 encodings). Currently this logic is handled in the configuration's on_init. This is moved into the on_init wrapper to avoid being overridden accidentally by users.
* chore: remove modeline (#1177)Michael Lingelbach2021-08-241-1/+0
|
* fix: unsilent autocmd to print warning (#1171)Michael Lingelbach2021-08-241-2/+4
|
* feat(lspinfo): display autostart status (#964)Matthieu Coudron2021-08-061-0/+1
|
* feat: added global on_setup hookFolke Lemaitre2021-07-191-0/+4
|
* fix: expose get_root_dir instead of config.root_dirFolke Lemaitre2021-07-191-1/+1
|
* chore: change stylua to single quotes (#1068)Michael Lingelbach2021-07-131-29/+29
|
* fix: do not attach server if buftype is 'nofile' (#1064)Michael Lingelbach2021-07-121-3/+3
| | | | * match buftype instead of filetype against 'nofile' * clarify variable naming to make buffer filetype clear from buftype
* fix: check client is not nil in _setup_buffer()Christian Chiarulli2021-07-041-0/+3
| | | Co-authored-by: christianchiarulli <chrisatmachine@gmail.com>
* fix: be less strict about cmd validationMichael Lingelbach2021-07-031-1/+1
| | | | Some language servers lazily build cmd based on a parameter passed to setup, like powershell_es. We should change this eventually, but for now be less strict.
* ci: lint and format with styluaMichael Lingelbach2021-07-031-44/+46
|
* fix: validate cmd is of type tableMichael Lingelbach2021-07-031-0/+1
|
* bug: bufnr not passed to on_attachMichał Nowotnik2021-04-201-1/+2
|
* autostart: print error when root directory nilMichael Lingelbach2021-04-091-0/+4
|
* Remove duplicated tbl_deep_extendMichael Lingelbach2021-03-281-4/+4
|
* Automatically reattach to buffers after reloadingMichael Lingelbach2021-02-171-0/+7
|
* Merge pull request #738 from mjlbach/fix_autostartMichael Lingelbach2021-02-171-1/+1
|\ | | | | rename launch -> autostart, add documentation
| * rename launch -> autostart, add documentationMichael Lingelbach2021-02-171-1/+1
| |
* | Merge pull request #721 from mjlbach/disable_autostartMichael Lingelbach2021-02-171-9/+37
|\| | | | | Add option to disable autostart
| * Add option to disable autostartMichael Lingelbach2021-02-161-9/+37
| |
* | fix on_attach to correctly pass bufnr as second argumentMichael Lingelbach2021-02-141-3/+3
|/