add @lsp.type highlight groups (add support for lsp semantic token groups) (#141)

This commit is contained in:
Егор Мартынов 2023-03-08 22:09:04 +07:00 committed by GitHub
commit b3afc8e6a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -261,6 +261,18 @@ function M._load(options)
h('@type', { link = 'Type' })
h('@variable', { fg = p.text, italic = maybe.italic })
h('@variable.builtin', { fg = p.love })
h('@namespace', { link = '@include' })
-- LSP Semantic Token Groups
h('@lsp.type.enum', { link = '@type' })
h('@lsp.type.keyword', { link = '@keyword' })
h('@lsp.type.interface', { link = '@interface' })
h('@lsp.type.namespace', { link = '@namespace' })
h('@lsp.type.parameter', { link = '@parameter' })
h('@lsp.type.property', { link = '@property' })
h('@lsp.type.variable', {}) -- use treesitter styles for regular variables
h('@lsp.typemod.function.defaultLibrary', { link = 'Special' })
h('@lsp.typemod.variable.defaultLibrary', { link = '@variable.builtin' })
-- vim.lsp.buf.document_highlight()
h('LspReferenceText', { bg = p.highlight_med })