forked from catppuccin/nvim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnative_lsp.lua
99 lines (88 loc) · 6.43 KB
/
native_lsp.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
local M = {}
function M.get()
local virtual_text = O.integrations.native_lsp.virtual_text
local underlines = O.integrations.native_lsp.underlines
local inlay_hints = O.integrations.native_lsp.inlay_hints
local error = C.red
local warning = C.yellow
local info = C.sky
local hint = C.rosewater
local darkening_percentage = 0.095
return {
-- These groups are for the native LSP client. Some other LSP clients may
-- use these groups, or use their own. Consult your LSP client's
-- documentation.
LspReferenceText = { bg = C.surface1 }, -- used for highlighting "text" references
LspReferenceRead = { bg = C.surface1 }, -- used for highlighting "read" references
LspReferenceWrite = { bg = C.surface1 }, -- used for highlighting "write" references
-- highlight diagnostics in numberline
DiagnosticVirtualTextError = {
bg = O.transparent_background and C.none or U.darken(error, darkening_percentage, C.base),
fg = error,
style = virtual_text.errors,
}, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticVirtualTextWarn = {
bg = O.transparent_background and C.none or U.darken(warning, darkening_percentage, C.base),
fg = warning,
style = virtual_text.warnings,
}, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticVirtualTextInfo = {
bg = O.transparent_background and C.none or U.darken(info, darkening_percentage, C.base),
fg = info,
style = virtual_text.information,
}, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticVirtualTextHint = {
bg = O.transparent_background and C.none or U.darken(hint, darkening_percentage, C.base),
fg = hint,
style = virtual_text.hints,
}, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticError = { bg = C.none, fg = error, style = virtual_text.errors }, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticWarn = { bg = C.none, fg = warning, style = virtual_text.warnings }, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticInfo = { bg = C.none, fg = info, style = virtual_text.information }, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
DiagnosticHint = { bg = C.none, fg = hint, style = virtual_text.hints }, -- Used as the mantle highlight group. Other Diagnostic highlights link to this by default
-- for nvim nightly
DiagnosticUnderlineError = { style = underlines.errors, sp = error }, -- Used to underline "Error" diagnostics
DiagnosticUnderlineWarn = { style = underlines.warnings, sp = warning }, -- Used to underline "Warn" diagnostics
DiagnosticUnderlineInfo = { style = underlines.information, sp = info }, -- Used to underline "Info" diagnostics
DiagnosticUnderlineHint = { style = underlines.hints, sp = hint }, -- Used to underline "Hint" diagnostics
DiagnosticFloatingError = { fg = error }, -- Used to color "Error" diagnostic messages in diagnostics float
DiagnosticFloatingWarn = { fg = warning }, -- Used to color "Warn" diagnostic messages in diagnostics float
DiagnosticFloatingInfo = { fg = info }, -- Used to color "Info" diagnostic messages in diagnostics float
DiagnosticFloatingHint = { fg = hint }, -- Used to color "Hint" diagnostic messages in diagnostics float
DiagnosticSignError = { fg = error }, -- Used for "Error" signs in sign column
DiagnosticSignWarn = { fg = warning }, -- Used for "Warn" signs in sign column
DiagnosticSignInfo = { fg = info }, -- Used for "Info" signs in sign column
DiagnosticSignHint = { fg = hint }, -- Used for "Hint" signs in sign column
LspDiagnosticsDefaultError = { fg = error }, -- Used as the mantle highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
LspDiagnosticsDefaultWarning = { fg = warning }, -- Used as the mantle highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
LspDiagnosticsDefaultInformation = { fg = info }, -- Used as the mantle highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
LspDiagnosticsDefaultHint = { fg = hint }, -- Used as the mantle highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
LspSignatureActiveParameter = { fg = C.peach },
-- LspDiagnosticsFloatingError = { }, -- Used to color "Error" diagnostic messages in diagnostics float
-- LspDiagnosticsFloatingWarning = { }, -- Used to color "Warning" diagnostic messages in diagnostics float
-- LspDiagnosticsFloatingInformation = { }, -- Used to color "Information" diagnostic messages in diagnostics float
-- LspDiagnosticsFloatingHint = { }, -- Used to color "Hint" diagnostic messages in diagnostics float
LspDiagnosticsError = { fg = error },
LspDiagnosticsWarning = { fg = warning },
LspDiagnosticsInformation = { fg = info },
LspDiagnosticsHint = { fg = hint },
LspDiagnosticsVirtualTextError = { fg = error, style = virtual_text.errors }, -- Used for "Error" diagnostic virtual text
LspDiagnosticsVirtualTextWarning = { fg = warning, style = virtual_text.warnings }, -- Used for "Warning" diagnostic virtual text
LspDiagnosticsVirtualTextInformation = { fg = info, style = virtual_text.warnings }, -- Used for "Information" diagnostic virtual text
LspDiagnosticsVirtualTextHint = { fg = hint, style = virtual_text.hints }, -- Used for "Hint" diagnostic virtual text
LspDiagnosticsUnderlineError = { style = underlines.errors, sp = error }, -- Used to underline "Error" diagnostics
LspDiagnosticsUnderlineWarning = { style = underlines.warnings, sp = warning }, -- Used to underline "Warning" diagnostics
LspDiagnosticsUnderlineInformation = { style = underlines.information, sp = info }, -- Used to underline "Information" diagnostics
LspDiagnosticsUnderlineHint = { style = underlines.hints, sp = hint }, -- Used to underline "Hint" diagnostics
LspCodeLens = { fg = C.overlay0 }, -- virtual text of the codelens
LspInlayHint = {
-- fg of `Comment`
fg = C.overlay0,
-- bg of `CursorLine`
bg = (O.transparent_background or not inlay_hints.background) and C.none
or U.vary_color({ latte = U.lighten(C.mantle, 0.70, C.base) }, U.darken(C.surface0, 0.64, C.base)),
}, -- virtual text of the inlay hints
LspInfoBorder = { link = "FloatBorder" }, -- LspInfo border
}
end
return M