Skip to content

Commit

Permalink
feat: add new lsp semantic token highlight groups (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnvgr committed Mar 11, 2023
1 parent 3f647a5 commit a8044b0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/nightfox/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ local defaults = {
background = true,
},
treesitter = util.is_nvim,
lsp_semantic_tokens = util.is_nvim,
},
}

Expand All @@ -73,6 +74,7 @@ M.module_names = {
"illuminate",
"lightspeed",
"lsp_saga",
"lsp_semantic_tokens",
"lsp_trouble",
"mini",
"modes",
Expand Down
20 changes: 20 additions & 0 deletions lua/nightfox/group/modules/lsp_semantic_tokens.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- https://neovim.io/doc/user/lsp.html#lsp-semantic-highlight

local M = {}

function M.get(spec, config, opts)
return {
-- LSP Semantic token highlight groups
["@lsp.type.enum"] = { link = "@type" },
["@lsp.type.keyword"] = { link = "@keyword" },
["@lsp.type.interface"] = { link = "@interface" },
["@lsp.type.namespace"] = { link = "@namespace" },
["@lsp.type.parameter"] = { link = "@parameter" },
["@lsp.type.property"] = { link = "@property" },
["@lsp.type.variable"] = {}, -- use treesitter styles for regular variables
["@lsp.typemod.function.defaultLibrary"] = { link = "Special" },
["@lsp.typemod.variable.defaultLibrary"] = { link = "@variable.builtin" },
}
end

return M

0 comments on commit a8044b0

Please sign in to comment.