feat: add lsp range code actions (#297)
https://github.com/neovim/neovim/pull/12962 authored by: @windwp
This commit is contained in:
@@ -68,7 +68,7 @@ lsp.document_symbols = function(opts)
|
||||
end
|
||||
|
||||
lsp.code_actions = function(opts)
|
||||
local params = vim.lsp.util.make_range_params()
|
||||
local params = opts.params or vim.lsp.util.make_range_params()
|
||||
|
||||
params.context = {
|
||||
diagnostics = vim.lsp.diagnostic.get_line_diagnostics()
|
||||
@@ -134,6 +134,11 @@ lsp.code_actions = function(opts)
|
||||
}):find()
|
||||
end
|
||||
|
||||
lsp.range_code_actions = function(opts)
|
||||
opts.params = vim.lsp.util.make_given_range_params()
|
||||
lsp.code_actions(opts)
|
||||
end
|
||||
|
||||
lsp.workspace_symbols = function(opts)
|
||||
opts.shorten_path = utils.get_default(opts.shorten_path, true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user