more updates?
This commit is contained in:
parent
b2986af869
commit
de19c7bc39
@ -36,6 +36,7 @@ return {
|
|||||||
require("lazyvim.functions").on_attach(function(client, buffer)
|
require("lazyvim.functions").on_attach(function(client, buffer)
|
||||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
||||||
|
require("lazyvim.plugins.lsp.misc").on_attach(client, buffer)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- diagnostics
|
-- diagnostics
|
||||||
|
|||||||
33
.config/nvim/lua/lazyvim/plugins/lsp/misc.lua
Normal file
33
.config/nvim/lua/lazyvim/plugins/lsp/misc.lua
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.disable_deno_formatting(client)
|
||||||
|
if client.name == "denols" then
|
||||||
|
require("null-ls").disable({ "prettier" })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.resolve_tsserver_deno(client)
|
||||||
|
local active_clients = vim.lsp.get_active_clients()
|
||||||
|
if client.name == "denols" then
|
||||||
|
for _, client_ in pairs(active_clients) do
|
||||||
|
-- stop tsserver if denols 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 denols is already active
|
||||||
|
if client_.name == "denols" then
|
||||||
|
client.stop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.on_attach(client, bufnr)
|
||||||
|
M.disable_deno_formatting(client)
|
||||||
|
M.resolve_tsserver_deno(client)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@ -110,10 +110,6 @@ return {
|
|||||||
lualine_y = { "filetype " },
|
lualine_y = { "filetype " },
|
||||||
lualine_z = { "%l:%c", "%p%%/%L" },
|
lualine_z = { "%l:%c", "%p%%/%L" },
|
||||||
}),
|
}),
|
||||||
inactive_sections = {
|
|
||||||
lualine_c = { "%f %y %m" },
|
|
||||||
lualine_x = {},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,17 +3,17 @@ return {
|
|||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
event = "BufReadPost",
|
event = "BufReadPost",
|
||||||
ensure_installed = "all",
|
opts = {
|
||||||
config = function(plugin)
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
ensure_installed = plugin.ensure_installed,
|
|
||||||
matchup = { enable = true },
|
matchup = { enable = true },
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
autopairs = { enable = true },
|
autopairs = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
context_commentstring = { enable = true, enable_autocmd = false },
|
context_commentstring = { enable = true, enable_autocmd = false },
|
||||||
})
|
ensure_installed = "all",
|
||||||
|
},
|
||||||
|
config = function(plugin, opts)
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user