mirror of
https://github.com/ksyasuda/rice.git
synced 2024-11-22 03:19:58 -08:00
15 lines
430 B
Lua
15 lines
430 B
Lua
|
local M = {}
|
||
|
|
||
|
local lsp_util = vim.lsp.util
|
||
|
|
||
|
function M.code_action_listener()
|
||
|
local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
|
||
|
local params = lsp_util.make_range_params()
|
||
|
params.context = context
|
||
|
vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result)
|
||
|
-- do something with result - e.g. check if empty and show some indication such as a sign
|
||
|
end)
|
||
|
end
|
||
|
|
||
|
return M
|