From b17cfa01cf0517cc3614602df39e8433dc116fab Mon Sep 17 00:00:00 2001 From: nullchilly Date: Thu, 19 Jan 2023 00:37:14 +0700 Subject: [PATCH] feat: support semantic tokens Closes #367 --- .../groups/integrations/treesitter.lua | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lua/catppuccin/groups/integrations/treesitter.lua b/lua/catppuccin/groups/integrations/treesitter.lua index cc7586e8..05263a61 100644 --- a/lua/catppuccin/groups/integrations/treesitter.lua +++ b/lua/catppuccin/groups/integrations/treesitter.lua @@ -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 @@ -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 @@ -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 @@ -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