mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 09:48:59 +02:00
feat(lsp): simpler API to deal with code actions
This commit is contained in:
parent
e0a0123b18
commit
1bd4d2fc72
5 changed files with 20 additions and 45 deletions
|
@ -324,4 +324,17 @@ function M.words.jump(count, cycle)
|
|||
end
|
||||
end
|
||||
|
||||
M.action = setmetatable({}, {
|
||||
__index = function(_, action)
|
||||
return function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { action },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue