| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* feat: support unnamed buffer with single_file_support
* fix: make some code simple clear
* feat: update doc
* fix: grammar
* fix: grammar
|
| | |
|
| |
|
| |
when user what to set cmd to vim.rpc.connect, but it is a function
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
This reverts commit 99e0dc9937b124dee7d8107185e804ff96466279.
|
| |
|
|
|
|
|
|
|
| |
* fix: remove the config.commands
* fix: format by stylua and remove comamnds test
* fix: remove commands from doc
* fix: remove unused function
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| | |
|
| |
|
|
|
|
|
| |
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
|
| |
|
| |
on_attach is a nontrivial callback so it makes sense to check the bufnr.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
* 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
|
| | |
|
| |
|
|
| |
* Escape paths used to autocommands
* Always normalize windows path to forward slash for internal use
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
| |
* 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`
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
* match buftype instead of filetype against 'nofile'
* clarify variable naming to make buffer filetype clear from buftype
|
| |
|
| |
Co-authored-by: christianchiarulli <chrisatmachine@gmail.com>
|
| |
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| | |
rename launch -> autostart, add documentation
|
| | | |
|
| |\|
| |
| | |
Add option to disable autostart
|
| | | |
|
| |/ |
|