diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2021-09-26 23:40:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 23:40:28 +0200 |
commit | 73280a7987dac01be77f787ab4a5880babdee391 (patch) | |
tree | 7d53f91efeb1afc1ccda7c2be9735fc6c0add47c /runtime/doc/lsp.txt | |
parent | c217766f7c32f17598563b16ef260322ce80bfc9 (diff) | |
download | rneovim-73280a7987dac01be77f787ab4a5880babdee391.tar.gz rneovim-73280a7987dac01be77f787ab4a5880babdee391.tar.bz2 rneovim-73280a7987dac01be77f787ab4a5880babdee391.zip |
feat(lsp): allow subset of CodeActionContext as arg to code_action methods (#15793)
This makes it easier to filter the code actions. For example:
vim.lsp.buf.code_action { only = 'refactor' }
Diffstat (limited to 'runtime/doc/lsp.txt')
-rw-r--r-- | runtime/doc/lsp.txt | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index c434f6db66..5b2a8d68b4 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -869,12 +869,17 @@ clear_references() *vim.lsp.buf.clear_references()* Removes document highlights from current buffer. code_action({context}) *vim.lsp.buf.code_action()* - Selects a code action from the input list that is available at - the current cursor position. + Selects a code action available at the current cursor + position. Parameters: ~ - {context} (table, optional) Valid `CodeActionContext` - object + {context} table|nil `CodeActionContext` of the LSP specification: + • diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not + provided. + • only: (string|nil) LSP `CodeActionKind` used + to filter the code actions. Most language + servers support values like `refactor` or + `quickfix` . See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction @@ -1015,8 +1020,13 @@ range_code_action({context}, {start_pos}, {end_pos}) Performs |vim.lsp.buf.code_action()| for a given range. Parameters: ~ - {context} (table, optional) Valid `CodeActionContext` - object + {context} table|nil `CodeActionContext` of the LSP specification: + • diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not + provided. + • only: (string|nil) LSP `CodeActionKind` + used to filter the code actions. Most + language servers support values like + `refactor` or `quickfix` . {start_pos} ({number, number}, optional) mark-indexed position. Defaults to the start of the last visual selection. |