disabled formatting for all lsp

This commit is contained in:
2025-02-23 12:14:50 -06:00
parent 50ef05d4e8
commit 5e9fef9a01
+4 -3
View File
@@ -506,6 +506,10 @@ function M.lsp_zero()
}) })
lsp.on_attach(function(client, _) lsp.on_attach(function(client, _)
-- diagnostics for other lsp get messed up when formatting is enabled
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
if client.name == "svelte" then if client.name == "svelte" then
vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" }, pattern = { "*.js", "*.ts" },
@@ -513,9 +517,6 @@ function M.lsp_zero()
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file }) client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file })
end, end,
}) })
elseif client.name == "html" then
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end end
end) end)