| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
| |
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
|
| |
|
| |
This reverts commit 8bb2facd6fa664fe200d2d491f9f7734202426fd.
|
| |
|
|
|
|
|
| |
Problem:
exepath is slow on WSL/Windows.
Solution:
Remove sanitize_cmd: absolute paths are nice, but not necessary.
|
| |
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
| |
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.
|
| |
|
| |
Return value from `vim.fs.normalize` instead.
|
| |
|
| |
Instead, just return the result of vim.fs.dirname.
|
| | |
|
| |
|
|
|
| |
It takes a new_root_dir parameter as documented in the help docs.
Signed-off-by: Tristan Partin <tristan@partin.io>
|
| | |
|
| |
|
|
|
| |
#2712" (#3347)
This reverts commit fb453a1a443b6ea6b54a1e4c101b1160c9d37950.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
## 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 #3342
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`...
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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`.
|
| |
|
| |
Co-authored-by: coffeebar <corp@dev.null>
|
| | |
|
| |
|
|
|
|
| |
- Move manager logic to own module
- Move async logic to own module
- Improve type annotations
|
| | |
|
| | |
|
| |
|
| |
I think only table need to expand
|
| | |
|
| |
|
| |
Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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)
|
| | |
|