feat: add lsp semantic tokens

This commit is contained in:
Michael Chris Lopez
2023-04-09 13:49:26 +08:00
parent 910b8c240c
commit 519fc82156
2 changed files with 32 additions and 0 deletions

View File

@@ -168,6 +168,8 @@ local function generate(p, opt)
DiagnosticWarn { WarningMsg },
DiagnosticInfo { fg = p.water },
DiagnosticHint { fg = p.blossom },
DiagnosticDeprecated { DiagnosticWarn },
DiagnosticUnnecessary { DiagnosticWarn },
DiagnosticSignError { SignColumn, fg = DiagnosticError.fg },
DiagnosticSignWarn { SignColumn, fg = DiagnosticWarn.fg },
@@ -265,6 +267,20 @@ local function generate(p, opt)
sym "@text.literal.markdown" { Type },
sym "@text.uri.markdown" { SpecialComment },
-- LSP Semantic Token Groups
sym "@lsp.type.comment" { sym "@comment" },
sym "@lsp.type.enum" { sym "@type" },
sym "@lsp.type.keyword" { sym "@keyword" },
sym "@lsp.type.namespace" { sym "@namespace" },
sym "@lsp.type.parameter" { sym "@parameter" },
sym "@lsp.type.property" { sym "@property" },
sym "@lsp.typemod.method.defaultLibrary" { sym "@function.builtin" },
sym "@lsp.typemod.function.defaultLibrary" { sym "@function.builtin" },
sym "@lsp.typemod.operator.injected" { sym "@operator" },
sym "@lsp.typemod.string.injected" { sym "@string" },
sym "@lsp.typemod.variable.defaultLibrary" { sym "@variable.builtin" },
sym "@lsp.typemod.variable.injected" { sym "@variable" },
-- Syntax
diffAdded { fg = p.leaf },
diffRemoved { fg = p.rose },