| Commit message (Collapse) | Author | Age |
|
|
|
| |
This makes it easier to find documentation about the on-list-handler
when starting the search term with "lsp".
|
|
|
| |
The `onexit` handler isn't called if `uv.spawn` doesn't return a handle.
|
| |
|
|
|
|
| |
The last line was excluded from formatting via formatexpr because the
character in the params was set to 0 instead of the end of line.
|
| |
|
| |
|
|
|
|
| |
Also changes `@see` to `See` to avoid the break to a dedicated "See
also" block in the generated vimdoc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`code_action` gained extra functions (`filter` and `apply`) which
`range_code_action` didn't have.
To close this gap, this adds a `range` option to `code_action` and
deprecates `range_code_action`.
The option defaults to the current selection if in visual mode.
This allows users to setup a mapping like `vim.keymap.set({'v', 'n'},
'<a-CR>', vim.lsp.buf.code_action)`
`range_code_action` used to use the `<` and `>` markers to get the
_last_ selection which required using a `<Esc><Cmd>lua
vim.lsp.buf.range_code_action()<CR>` (note the `<ESC>`) mapping.
|
|
|
|
|
| |
Without some form of feedback a user cannot easily tell if the server is
still computing the result (which can take a while in large projects),
or whether the server couldn't compute the rename result.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Neovim implements `workspace/configuration`
It should set the capability accordingly.
From https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities:
/**
* The client supports `workspace/configuration` requests.
*
* @since 3.6.0
*/
configuration?: boolean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lists (#19213)
Currently LSP allows only using loclist or quickfix list window. I
normally prefer to review all quickfix items without opening quickfix
window. This fix allows passing `on_list` option which allows full
control what to do with list.
Here is example how to use it with quick fix list:
```lua
local function on_list(options)
vim.fn.setqflist({}, ' ', options)
vim.api.nvim_command('cfirst')
end
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', '<leader>ad', function() vim.lsp.buf.declaration{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>ai', function() vim.lsp.buf.implementation{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>at', function() vim.lsp.buf.type_definition{on_list=on_list} end, bufopts)
vim.keymap.set('n', '<leader>af', function() vim.lsp.buf.references(nil, {on_list=on_list}) end, bufopts)
```
If you prefer loclist do something like this:
```lua
local function on_list(options)
vim.fn.setloclist(0, {}, ' ', options)
vim.api.nvim_command('lopen')
end
```
close #19182
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
|
|
|
|
| |
regression from PR #19283: custom close autocommands for the preview window were
not cleaned up after the window was closed.
|
|
|
|
|
|
|
| |
* refactor(lsp): use autocmd api
* refactor(lsp): inline BufWritePost and VimLeavePre callbacks
|
| |
|
| |
|
| |
|
|
|
| |
fixup for #19283
|
| |
|
|
|
| |
Signed-off-by: Raphael <glephunter@gmail.com>
|
|
|
|
| |
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
|
|
|
|
|
|
|
|
|
| |
This fixes the following bugs:
`${1:else_text}` -> format with if_text: "else_text"
`${1:-else_text}` -> format with if_text: "else_text"
`${1:}` in `format` (eg. empty else_text) -> error.
`${1:}` (eg. empty placeholder) -> error.
Thanks hrsh7th :)
|
|
|
|
|
|
|
| |
docs: fix typos and similarly insignificant changes
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
|
| |
|
|
|
| |
Fixes https://github.com/neovim/neovim/issues/18860
|
| |
|
|
|
|
|
|
|
|
| |
Fix a bug in lsp.buf.rename() where the range returned by the server in
textDocument/prepareRename was interpreted as a byte range directly,
instead of taking the negotiated offset encoding into account. This
caused the placeholder value in vim.ui.input to be incorrect in some
cases, for example when non-ascii characters are used earlier on the
same line.
|
|
|
|
|
|
|
|
| |
Currently the `title`, `message` and `percentage` is stored for a
progress, but there is also an optional `cancellable` that comes in with
both the `WorkDoneProgressBegin` and also `WorkDoneProgressReport`. This
change also stores that value so that a plugin can access it when they
do a lookup in `client.messages`.
|
|
|
| |
Same as https://github.com/neovim/neovim/pull/18458 but for rename
|
|
|
|
|
| |
This makes the common use case easier.
If one really needs access to all clients, they can create a filter
function which manually calls `get_active_clients`.
|
| |
|
|
|
|
|
|
|
| |
Detaching the process seems to have unintended side effects on Windows,
so only do it by default on non-Windows platforms.
Ref: https://github.com/neovim/nvim-lspconfig/issues/1907
Closes https://github.com/neovim/nvim-lspconfig/pull/1913
|
| |
|
|
|
|
| |
Fix vim.lsp.buf.(range_)code_action() to only send diagnostics belonging
to the current buffer and not to other files in the workspace.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
vim.lsp: require("vim.lsp.health").check()
========================================================================
- ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
function health#check, line 20
Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
stack traceback:
...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
[string "luaeval()"]:1: in main chunk
Solution:
Check for nil.
fix #18602
|
|
|
|
|
|
|
|
| |
Implement filtering of actions based on the kind when passing the 'only'
parameter to code_action(). Action kinds are hierachical with a '.' as
the separator, and the filter thus allows, for example, both 'quickfix'
and 'quickfix.foo' when requestiong only 'quickfix'.
Fix https://github.com/neovim/neovim/pull/18221#issuecomment-1110179121
|
|
|
|
|
|
|
|
|
|
|
|
| |
See: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/4f2884e16db35f2962d9b64312917c81be5cb54b
- Move session persistent data to $XDG_STATE_HOME Change 'directory',
'backupdir', 'undodir', 'viewdir' and 'shadafile' default location to
$XDG_STATE_HOME/nvim.
- Move logs to $XDG_STATE_HOME, too.
- Add stdpath('log') support.
Fixes: #14805
|
|\
| |
| | |
CI: format and lint runtime with Stylua
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
LSP servers should be daemonized (detached) so that they run in a
separate process group from Neovim's. Among other things, this ensures
the process does not inherit Neovim's TTY (#18475).
Make this configurable so that clients can explicitly opt-out of
detaching from Nvim.
|
| |
|
|
|
|
|
| |
Follow up to https://github.com/neovim/neovim/pull/18441
This way rename should "just work" in most cases without having to
manually filter the client
|
|
|
|
|
|
|
|
| |
Adds filter and id options to filter the client to use for rename.
Similar to the recently added `format` function.
rename will use all matching clients one after another and can handle a
mix of prepareRename/rename support. Also ensures the right
`offset_encoding` is used for the `make_position_params` calls
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes issues where subsequent calls to vim.lsp.codelens.refresh()
would have no effect due to the buffer not getting cleared from the
active_refresh table.
Examples of how such scenarios would occur are:
- A textDocument/codeLens result yielded an error.
- The 'textDocument/codeLens' handler was overriden in such a way that
it no longer called vim.lsp.codelens.on_codelens().
|
| |
|
|
|
|
|
|
| |
This is primarily intended to act as documentation for the developer so
they know exactly when and what to remove. This will help prevent the
situation of deprecated code lingering for far too long as developers
don't have to worry if a function is safe to remove.
|
| |
|
|
|
|
|
|
|
|
| |
Deprecates the existing `vim.lsp.buf.formatting` function.
With this, `vim.lsp.buf.format` will replace all three:
- vim.lsp.buf.formatting
- vim.lsp.buf.formatting_sync
- vim.lsp.buf.formatting_seq_sync
|
| |
|