fix: upgrade formatting setup to new syntax

This commit is contained in:
Michael Mandl 2022-12-20 08:47:32 +01:00
parent 0b5b7049f5
commit fa8a934a2b
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7

View file

@ -15,7 +15,7 @@ local on_attach = function(client, bufnr)
nnoremap("K", vim.lsp.buf.hover) nnoremap("K", vim.lsp.buf.hover)
nnoremap("<leader>rn", vim.lsp.buf.rename) nnoremap("<leader>rn", vim.lsp.buf.rename)
nnoremap("<leader>ca", vim.lsp.buf.code_action) nnoremap("<leader>ca", vim.lsp.buf.code_action)
nnoremap("<leader>f", vim.lsp.buf.formatting) nnoremap("<leader>f", vim.lsp.buf.format)
nnoremap("<leader>d", telescope.diagnostics) nnoremap("<leader>d", telescope.diagnostics)
nnoremap("<leader>D", require("lsp_lines").toggle) nnoremap("<leader>D", require("lsp_lines").toggle)
nnoremap("<C-p>", vim.diagnostic.goto_prev) nnoremap("<C-p>", vim.diagnostic.goto_prev)
@ -23,7 +23,7 @@ local on_attach = function(client, bufnr)
-- disable tsserver formatting -- disable tsserver formatting
if client.name == "tsserver" then if client.name == "tsserver" then
client.resolved_capabilities["document_formatting"] = false client.server_capabilities.document_formatting = false
end end
if client.supports_method("textDocument/formatting") then if client.supports_method("textDocument/formatting") then