home: vim: lspconfig: configure diagnostics once
All checks were successful
ci/woodpecker/push/check Pipeline was successful

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 client native client configuration
-- @param bufnr int? buffer number of the attched client -- @param bufnr int? buffer number of the attched client
M.on_attach = function(client, bufnr) 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 -- Format on save
lsp_format.on_attach(client, bufnr) lsp_format.on_attach(client, bufnr)

View file

@ -2,6 +2,22 @@ local lspconfig = require("lspconfig")
local lsp = require("ambroisie.lsp") local lsp = require("ambroisie.lsp")
local utils = require("ambroisie.utils") 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... -- Inform servers we are able to do completion, snippets, etc...
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()