Skip to content

Commit

Permalink
Merge pull request #2 from nvim-lua/master
Browse files Browse the repository at this point in the history
Move LspDetach handler near kickstart-lsp-highlight group (nvim-lua#900)
  • Loading branch information
ZaneFerns360 authored May 4, 2024
2 parents ce8e788 + 6f6f38a commit 1229ab4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,14 @@ require('lazy').setup({
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})

vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event2)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
end,
})
end

-- The following autocommand is used to enable inlay hints in your
Expand All @@ -562,14 +570,6 @@ require('lazy').setup({
end,
})

vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf }
end,
})

-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
Expand Down

0 comments on commit 1229ab4

Please sign in to comment.