home: vim: lspconfig: configure diagnostics once
ci/woodpecker/push/check Pipeline was successful Details

There's no need to configure it on each LSP attach, this is wasted work
and could change options that have since been changed.
This commit is contained in:
Bruno BELANYI 2023-06-22 15:35:30 +00:00
parent 2f03d92dd9
commit cecb7d9bb4
2 changed files with 16 additions and 16 deletions

View File

@ -44,22 +44,6 @@ end
-- @param client native client configuration
-- @param bufnr int? buffer number of the attched client
M.on_attach = function(client, bufnr)
-- Diagnostics
vim.diagnostic.config({
-- Disable virtual test next to affected regions
virtual_text = false,
-- Also disable virtual diagnostics under the affected regions
virtual_lines = false,
-- Show diagnostics signs
signs = true,
-- Underline offending regions
underline = true,
-- Do not bother me in the middle of insertion
update_in_insert = false,
-- Show highest severity first
severity_sort = true,
})
-- Format on save
lsp_format.on_attach(client, bufnr)

View File

@ -2,6 +2,22 @@ local lspconfig = require("lspconfig")
local lsp = require("ambroisie.lsp")
local utils = require("ambroisie.utils")
-- Diagnostics
vim.diagnostic.config({
-- Disable virtual test next to affected regions
virtual_text = false,
-- Also disable virtual diagnostics under the affected regions
virtual_lines = false,
-- Show diagnostics signs
signs = true,
-- Underline offending regions
underline = true,
-- Do not bother me in the middle of insertion
update_in_insert = false,
-- Show highest severity first
severity_sort = true,
})
-- Inform servers we are able to do completion, snippets, etc...
local capabilities = require("cmp_nvim_lsp").default_capabilities()