| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
`vim.lsp.buf.format()` silently did nothing if no servers supported
`textDocument/rangeFormatting` when formatting with a range.
Issue found by `@hwrd:matrix.org` in the Matrix chat.
|
| |
|
| |
|
| |
|
|
|
| |
Follow up to https://github.com/neovim/neovim/pull/21337
|
| |
|
| |
|
|
|
|
| |
(#20551)
|
| |
|
|
|
|
|
| |
Fix those naughty single quotes.
closes #20159
|
|
|
| |
fix: use correct function name in deprecated message
|
| |
|
|
|
|
| |
This makes it easier to find documentation about the on-list-handler
when starting the search term with "lsp".
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
|
|
|
| |
* reformat Lua runtime to make lint CI pass
* reduce max line length to 100
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
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`.
|
|
|
|
| |
Fix vim.lsp.buf.(range_)code_action() to only send diagnostics belonging
to the current buffer and not to other files in the workspace.
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
CI: format and lint runtime with Stylua
|
| | |
|
|/ |
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat(lsp)!: remove capabilities sanitization
Users must now access client.server_capabilities which matches the same
structure as the protocol.
https://microsoft.github.io/language-server-protocol/specification
client.resolved_capabilities is no longer used to gate capabilities, and
will be removed in a future release.
BREAKING CHANGE
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement two new options to vim.lsp.buf.code_action():
- filter (function): predicate taking an Action as input, and returning
a boolean.
- apply (boolean): when set to true, and there is just one remaining
action (after filtering), the action is applied without user query.
These options can, for example, be used to filter out, and automatically
apply, the action indicated by the server to be preferred:
vim.lsp.buf.code_action({
filter = function(action)
return action.isPreferred
end,
apply = true,
})
Fix #17514.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This removes the "fallback" to utf-16 in many of our helper functions. We
should always explicitly pass these around when possible except in two
locations:
* generating params with help utilities called by buf.lua functions
* the buf.lua functions themselves
Anything that is called by the handler should be passed the offset encoding.
|
| |
|
|
|
|
|
|
|
| |
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sebastian Volland <seb@baunz.net>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
|
| |
The examples are relevant and applicable for both Lua and Vimscript
configurations and the `vim.api.nvim_command` prefixes just add noise
that doesn't contribute to the example.
|
| |
|
| |
|
|
|
|
| |
* internally represent no workspaceFolders as nil instead of vim.NIL
* rename workspaceFolders -> workspace_folders for consistency
|
|
|
| |
* handle when workspaceFolder is nil in buf.list_workspace_folders and buf.add_workspace_folder
|
|
|
|
|
|
| |
* vim.ui.input is an overridable function that prompts for user input
* take an opts table and the `on_confirm` callback, see `:help vim.ui.input` for more details
* defaults to a wrapper around vim.fn.input(opts)
* switches the built-in client's rename handler to use vim.ui.input by default
|
| |
|