more updates?

This commit is contained in:
Solomon Laing 2023-01-10 09:19:58 +10:30
parent b2986af869
commit de19c7bc39
4 changed files with 45 additions and 15 deletions

View File

@ -36,6 +36,7 @@ return {
require("lazyvim.functions").on_attach(function(client, buffer)
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
require("lazyvim.plugins.lsp.misc").on_attach(client, buffer)
end)
-- diagnostics

View 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

View File

@ -110,10 +110,6 @@ return {
lualine_y = { "filetype " },
lualine_z = { "%l:%c", "%p%%/%L" },
}),
inactive_sections = {
lualine_c = { "%f %y %m" },
lualine_x = {},
},
}
end,
}

View File

@ -3,17 +3,17 @@ return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "BufReadPost",
ensure_installed = "all",
config = function(plugin)
require("nvim-treesitter.configs").setup({
opts = {
sync_install = false,
ensure_installed = plugin.ensure_installed,
matchup = { enable = true },
highlight = { enable = true },
autopairs = { enable = true },
indent = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false },
})
ensure_installed = "all",
},
config = function(plugin, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
}