home: vim: lspconfig: configure diagnostics once
All checks were successful
ci/woodpecker/push/check Pipeline was successful
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:
parent
2f03d92dd9
commit
cecb7d9bb4
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue