mirror of
https://github.com/neovim/neovim.git
synced 2025-12-05 14:13:10 +00:00
feat(lsp): options to filter and auto-apply code actions (#18221)
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 commit is contained in:
@@ -645,6 +645,7 @@ function protocol.make_client_capabilities()
|
||||
end)();
|
||||
};
|
||||
};
|
||||
isPreferredSupport = true;
|
||||
dataSupport = true;
|
||||
resolveSupport = {
|
||||
properties = { 'edit', }
|
||||
|
||||
Reference in New Issue
Block a user