refesh directory tree

This commit is contained in:
2024-10-31 11:33:13 +01:00
parent 5b69c9bdc3
commit ee6b74e5bd
410 changed files with 3793 additions and 5033 deletions

View File

@@ -0,0 +1,50 @@
local lsp_conficts, _ = pcall(vim.api.nvim_get_autocmds, { group = "LspAttach_conflicts" })
if not lsp_conficts then
vim.api.nvim_create_augroup("LspAttach_conflicts", {})
end
vim.api.nvim_create_autocmd("LspAttach", {
group = "LspAttach_conflicts",
desc = "prevent tsserver and volar competing",
callback = function(args)
if not (args.data and args.data.client_id) then
return
end
local active_clients = vim.lsp.get_active_clients()
local client = vim.lsp.get_client_by_id(args.data.client_id)
-- prevent tsserver and volar competing
-- if client.name == "volar" or require("lspconfig").util.root_pattern("nuxt.config.ts")(vim.fn.getcwd()) then
-- OR
if client.name == "volar" then
for _, client_ in pairs(active_clients) do
-- stop tsserver if volar is already active
if client_.name == "tsserver" then
client_.stop()
end
end
elseif client.name == "tsserver" then
for _, client_ in pairs(active_clients) do
-- prevent tsserver from starting if volar is already active
if client_.name == "volar" then
client.stop()
end
end
end
end,
})
return {
{
"neovim/nvim-lspconfig",
opts = {
servers = {
volar = {
filetypes = {
"javascript",
"typescript",
"vue",
},
},
},
},
},
{},
}