fix(typescript): implemented move to new file. Fixes #3534
This commit is contained in:
@ -22,12 +22,13 @@ function M.get_clients(opts)
|
||||
end
|
||||
|
||||
---@param on_attach fun(client:vim.lsp.Client, buffer)
|
||||
function M.on_attach(on_attach)
|
||||
---@param name? string
|
||||
function M.on_attach(on_attach, name)
|
||||
return vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local buffer = args.buf ---@type number
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client then
|
||||
if client and (not name or client.name == name) then
|
||||
return on_attach(client, buffer)
|
||||
end
|
||||
end,
|
||||
@ -340,6 +341,7 @@ M.action = setmetatable({}, {
|
||||
|
||||
---@class LspCommand: lsp.ExecuteCommandParams
|
||||
---@field open? boolean
|
||||
---@field handler? lsp.Handler
|
||||
|
||||
---@param opts LspCommand
|
||||
function M.execute(opts)
|
||||
@ -353,7 +355,7 @@ function M.execute(opts)
|
||||
params = params,
|
||||
})
|
||||
else
|
||||
return vim.lsp.buf_request(0, "workspace/executeCommand", params)
|
||||
return vim.lsp.buf_request(0, "workspace/executeCommand", params, opts.handler)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user