forked from projekt0n/github-nvim-theme
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagnostic.lua
35 lines (29 loc) · 1.41 KB
/
diagnostic.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
local M = {}
---@param spec GhTheme.Spec
---@param _config GhTheme.Config.Options
---@param opts GhTheme.Config.Module.Diagnostic
function M.get(spec, _config, opts)
local d = spec.diag
local dbg = spec.diag_bg
-- stylua: ignore
---@type table<string, GhTheme.HighlightGroup>
return {
DiagnosticError = { fg = d.error },
DiagnosticWarn = { fg = d.warn },
DiagnosticInfo = { fg = d.info },
DiagnosticHint = { fg = d.hint },
DiagnosticSignError = { link = 'DiagnosticError' },
DiagnosticSignWarn = { link = 'DiagnosticWarn' },
DiagnosticSignInfo = { link = 'DiagnosticInfo' },
DiagnosticSignHint = { link = 'DiagnosticHint' },
DiagnosticVirtualTextError = { fg = d.error, bg = opts.background and dbg.error or 'NONE' },
DiagnosticVirtualTextWarn = { fg = d.warn, bg = opts.background and dbg.warn or 'NONE' },
DiagnosticVirtualTextInfo = { fg = d.info, bg = opts.background and dbg.info or 'NONE' },
DiagnosticVirtualTextHint = { fg = d.hint, bg = opts.background and dbg.hint or 'NONE' },
DiagnosticUnderlineError = { style = 'undercurl', sp = d.error },
DiagnosticUnderlineWarn = { style = 'undercurl', sp = d.warn },
DiagnosticUnderlineInfo = { style = 'undercurl', sp = d.info },
DiagnosticUnderlineHint = { style = 'undercurl', sp = d.hint },
}
end
return M