Skip to content

Commit

Permalink
feat: support semantic tokens Closes #367
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchilly committed Jan 18, 2023
1 parent 01d11b6 commit b17cfa0
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions lua/catppuccin/groups/integrations/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@function.builtin"] = { fg = C.peach, style = O.styles.functions or {} }, -- For builtin functions: table.insert in Lua.
["@function.call"] = { link = "@function" }, -- function calls
["@function.macro"] = { fg = C.teal, style = O.styles.functions or {} }, -- For macro defined functions (calls and definitions): each macro_rules in RusC.
["@method"] = { fg = C.blue, style = O.styles.functions or {} }, -- For method calls and definitions.
["@method"] = { fg = C.peach, style = O.styles.functions or {} }, -- For method calls and definitions.

["@method.call"] = { link = "@method" }, -- method calls

Expand Down Expand Up @@ -75,19 +75,19 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci

["@storageclass"] = { link = "StorageClass" }, -- visibility/life-time/etc. modifiers (e.g. `static`)
["@attribute"] = { link = "Constant" }, -- attribute annotations (e.g. Python decorators)
["@field"] = { fg = C.teal }, -- For fields.
["@property"] = { fg = C.teal, style = O.styles.properties or {} }, -- Same as TSField.
["@field"] = { fg = C.lavender }, -- For fields.
["@property"] = { fg = C.lavender, style = O.styles.properties or {} }, -- Same as TSField.

-- Identifiers

["@variable"] = { fg = C.text, style = O.styles.variables or {} }, -- Any variable name that does not have another highlighC.
["@variable"] = { fg = C.text, style = O.styles.variables or {} }, -- Any variable name that does not have another highlight.
["@variable.builtin"] = { fg = C.red }, -- Variable names that are defined by the languages, like this or self.

["@constant"] = { fg = C.peach }, -- For constants
["@constant.builtin"] = { fg = C.peach, style = O.styles.keywords or {} }, -- For constant that are built in the language: nil in Lua.
["@constant.macro"] = { link = "Macro" }, -- For constants that are defined by macros: NULL in C.

["@namespace"] = { fg = C.blue, style = { "italic" } }, -- For identifiers referring to modules and namespaces.
["@namespace"] = { fg = C.lavender, style = { "italic" } }, -- For identifiers referring to modules and namespaces.
["@symbol"] = { fg = C.flamingo },

-- Text
Expand Down Expand Up @@ -120,6 +120,18 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@tag.attribute"] = { fg = C.teal, style = { "italic" } }, -- Tags like html tag names.
["@tag.delimiter"] = { fg = C.sky }, -- Tag delimiter like < > /

-- Semantic tokens
["@class"] = { fg = C.blue },
["@struct"] = { fg = C.blue },
["@enum"] = { fg = C.teal },
["@enumMember"] = { fg = C.flamingo },
["@event"] = { fg = C.flamingo },
["@interface"] = { fg = C.flamingo },
["@modifier"] = { fg = C.flamingo },
["@regexp"] = { fg = C.pink },
["@typeParameter"] = { fg = C.yellow },
["@decorator"] = { fg = C.flamingo },

-- Language specific:

-- css
Expand All @@ -138,7 +150,6 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
["@label.json"] = { fg = C.blue }, -- For labels: label: in C and :label: in Lua.

-- lua
["@field.lua"] = { fg = C.lavender },
["@constructor.lua"] = { fg = C.flamingo }, -- For constructor calls and definitions: = { } in Lua, and Java constructors.

-- typescript
Expand Down

0 comments on commit b17cfa0

Please sign in to comment.