feat(lsp): make diagnostics configurable with {"neovim/nvim-lspconfig", opts = {diagnostics = {}}}. Fixes #55

This commit is contained in:
Folke Lemaitre
2023-01-13 09:37:31 +01:00
parent 40113b2639
commit 1efc925d16

View File

@ -12,6 +12,12 @@ return {
},
---@class PluginLspOpts
opts = {
diagnostics = {
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, prefix = "" },
severity_sort = true,
},
---@type lspconfig.options
servers = {
jsonls = {},
@ -61,12 +67,7 @@ return {
name = "DiagnosticSign" .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end
vim.diagnostic.config({
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, prefix = "" },
severity_sort = true,
})
vim.diagnostic.config(opts.diagnostics)
local servers = opts.servers
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())