From cde37f523581cecfe8cd708f964f2d34934c6907 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Sun, 24 Jul 2022 20:46:17 +0200 Subject: Update config to mason, lsp lines, remove old plugins --- after/plugin/lsp.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'after/plugin/lsp.lua') diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 8b8d1b2..d025ad1 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -1,14 +1,18 @@ local telescope_mapper = require("alpha.telescope.mappings") -local filetype_attach = setmetatable({ - go = function(_) +local format_on_save = function(_) vim.cmd([[ augroup lsp_buf_format au! BufWritePre - autocmd BufWritePre :lua vim.lsp.buf.formatting_sync() + autocmd BufWritePre :lua vim.lsp.buf.format({ async = true }) augroup END ]]) - end, + end + +local filetype_attach = setmetatable({ + go = format_on_save, + php = format_on_save, + lua = format_on_save, gdscript = function(_) end, }, { @@ -42,12 +46,12 @@ local function on_attach(client) filetype_attach[filetype](client) end -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - underline = true, - update_in_insert = false, - virtual_text = { spacing = 2, prefix = "●" }, - severity_sort = true, -}) +-- vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { +-- underline = true, +-- update_in_insert = false, +-- virtual_text = { spacing = 2, prefix = "●" }, +-- severity_sort = true, +-- }) local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } for type, icon in pairs(signs) do -- cgit v1.2.3