neovim: disable tsserver formatting

This commit is contained in:
2023-10-31 22:11:48 +03:00
parent 427b1f3a1e
commit 0e5a5a5248

View File

@@ -38,6 +38,12 @@ null_ls.setup({
local function on_attach(client, bufnr)
local opts = { buffer = bufnr, remap = false }
-- disable tsserver formatting here because i don't understand how lsp configuration works
if client.name == "tsserver" then
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end
vim.keymap.set("n", "gd", ts.lsp_definitions, opts)
vim.keymap.set("n", "gr", ts.lsp_references, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)