Skip to content

Commit

Permalink
fix(signature): when loading, attach to existing lsp clients. Fixes #342
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Feb 7, 2023
1 parent a83b5fb commit f69f1a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/noice/lsp/signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ function M.setup()
vim.lsp.handlers["textDocument/signatureHelp"] = M.on_signature

if Config.options.lsp.signature.auto_open.enabled then
-- attach to existing buffers
for _, client in ipairs(vim.lsp.get_active_clients()) do
for _, buf in ipairs(vim.lsp.get_buffers_by_client_id(client.id)) do
M.on_attach(buf, client)
end
end

-- attach to new buffers
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("noice_lsp_signature", { clear = true }),
callback = function(args)
Expand Down

0 comments on commit f69f1a5

Please sign in to comment.