feat(typescript): open locations from lsp execute command with trouble for vtsls
This commit is contained in:
@ -337,4 +337,24 @@ M.action = setmetatable({}, {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
---@class LspCommand: lsp.ExecuteCommandParams
|
||||
---@field open? boolean
|
||||
|
||||
---@param opts LspCommand
|
||||
function M.execute(opts)
|
||||
local params = {
|
||||
command = opts.command,
|
||||
arguments = opts.arguments,
|
||||
}
|
||||
if opts.open then
|
||||
require("trouble").open({
|
||||
mode = "lsp_command",
|
||||
params = params,
|
||||
})
|
||||
else
|
||||
return vim.lsp.buf_request(0, "workspace/executeCommand", params)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user