mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-07 07:54:38 +02:00
refactor: diag
This commit is contained in:
parent
4e52d31187
commit
b7bcac9c9d
2 changed files with 4 additions and 9 deletions
|
@ -7,9 +7,9 @@ return {
|
||||||
"mason.nvim",
|
"mason.nvim",
|
||||||
{ "williamboman/mason-lspconfig.nvim", config = function() end },
|
{ "williamboman/mason-lspconfig.nvim", config = function() end },
|
||||||
},
|
},
|
||||||
---@class PluginLspOpts
|
|
||||||
opts = function()
|
opts = function()
|
||||||
return {
|
---@class PluginLspOpts
|
||||||
|
local ret = {
|
||||||
-- options for vim.diagnostic.config()
|
-- options for vim.diagnostic.config()
|
||||||
---@type vim.diagnostic.Opts
|
---@type vim.diagnostic.Opts
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
|
@ -114,6 +114,7 @@ return {
|
||||||
-- ["*"] = function(server, opts) end,
|
-- ["*"] = function(server, opts) end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
return ret
|
||||||
end,
|
end,
|
||||||
---@param opts PluginLspOpts
|
---@param opts PluginLspOpts
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
|
|
@ -112,17 +112,11 @@ M.number = {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local enabled = true
|
|
||||||
---@type lazyvim.Toggle
|
---@type lazyvim.Toggle
|
||||||
M.diagnostics = {
|
M.diagnostics = {
|
||||||
name = "Diagnostics",
|
name = "Diagnostics",
|
||||||
get = function()
|
get = function()
|
||||||
if vim.diagnostic.is_enabled then
|
return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled()
|
||||||
enabled = vim.diagnostic.is_enabled()
|
|
||||||
elseif vim.diagnostic.is_disabled then
|
|
||||||
enabled = not vim.diagnostic.is_disabled()
|
|
||||||
end
|
|
||||||
return enabled
|
|
||||||
end,
|
end,
|
||||||
set = vim.diagnostic.enable,
|
set = vim.diagnostic.enable,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue