From b20b0afb88d2681ea84f70a98eb22cfa1cc30f56 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Tue, 22 Feb 2022 11:18:59 +0100 Subject: [PATCH] feat: disable conflicting auto-formatters --- lua/plugins/lspconfig.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 5329850..da98442 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -80,6 +80,11 @@ local function custom_on_attach(client, buffer_nr) -- Open all project diagnostics in quickfix list bufnnoremap("", "lua vim.diagnostic.setqflist()") + -- disable conflicting formatters + if client.name == "tsserver" or client.name == "html" then + client.resolved_capabilities.document_formatting = false + end + if client.resolved_capabilities.document_formatting then vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync()") end