From e0d32a7cf915b8a9acc303f142ec0c4f6a817306 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Fri, 3 May 2024 15:48:55 +0530 Subject: [PATCH 01/11] chore(treesitter): `@parameter` -> `@variable.parameter` --- lua/github-theme/group/modules/lsp_semantic_tokens.lua | 2 +- lua/github-theme/group/modules/treesitter.lua | 10 +++++----- queries/solidity/highlights.scm | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/github-theme/group/modules/lsp_semantic_tokens.lua b/lua/github-theme/group/modules/lsp_semantic_tokens.lua index 2dd0378d..66f1c9ad 100644 --- a/lua/github-theme/group/modules/lsp_semantic_tokens.lua +++ b/lua/github-theme/group/modules/lsp_semantic_tokens.lua @@ -9,7 +9,7 @@ function M.get(spec, config, opts) ['@lsp.type.keyword'] = { link = '@keyword' }, ['@lsp.type.interface'] = { link = '@interface' }, ['@lsp.type.namespace'] = { link = '@namespace' }, - ['@lsp.type.parameter'] = { link = '@parameter' }, + ['@lsp.type.parameter'] = { link = '@variable.parameter' }, ['@lsp.type.class'] = { link = '@function' }, ['@lsp.type.property'] = {}, -- use treesitter styles for regular properties ['@lsp.type.variable'] = {}, -- use treesitter styles for regular variables diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index 044a9596..ff956c98 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -83,7 +83,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@method.call'] = { link = '@method' }, -- Method calls ['@constructor'] = { fg = pl.syntax.variable}, -- Constructor calls & defs: {} in Lua, new Type() (js/php), constructor() {} - ['@parameter'] = { fg = syn.param, stl.variables }, -- For parameters of a function + ['@variable.parameter'] = { fg = syn.param, stl.variables }, -- For parameters of a function -- Keywords -- ['@keyword'] = { link = 'Keyword' }, -- For keywords that don't fall in previous categories @@ -228,7 +228,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Nix ['@variable.member.nix'] = { link = '@field' }, - ['@variable.parameter.nix'] = { link = '@parameter' }, + ['@variable.parameter.nix'] = { link = '@variable.parameter' }, ['@string.special.path.nix'] = { link = '@string' }, -- PHP @@ -256,7 +256,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- SCSS ['@property.scss'] = { link = '@constant' }, - ['@variable.scss'] = { link = '@parameter' }, + ['@variable.scss'] = { link = '@variable.parameter' }, -- SQL ['@field.sql'] = { link = '@constant' }, @@ -271,9 +271,9 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@variable.typescript'] = { link = '@constant' }, -- VimDoc (vim help files/docs) - ['@parameter.vimdoc'] = { fg = pl.syntax.variable }, + ['@variable.parameter.vimdoc'] = { fg = pl.syntax.variable }, ['@label.vimdoc'] = { link = '@keyword' }, -- `*sometag*` - -- ['@string.special.vimdoc'] = { link = '@parameter.vimdoc' }, -- `CTRL-W`, etc. (unused atm, not well-defined) + -- ['@string.special.vimdoc'] = { link = '@variable.parameter.vimdoc' }, -- `CTRL-W`, etc. (unused atm, not well-defined) -- Yaml ['@field.yaml'] = { link = '@tag' }, diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index 9ec6ce13..6897b78d 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -77,12 +77,12 @@ ; Function parameters (call_struct_argument name: (identifier) @field) -(event_paramater name: (identifier) @parameter) +(event_paramater name: (identifier) @variable.parameter) (parameter name: (identifier) @variable.parameter) ; Yul functions (yul_function_call function: (yul_identifier) @function) -(yul_function_definition . (yul_identifier) @function (yul_identifier) @parameter) +(yul_function_definition . (yul_identifier) @function (yul_identifier) @variable.parameter) ; Structs and members From 4eee9f7757be9fe14b33ed685a057d8ee26d1ab0 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Mon, 6 May 2024 20:22:58 +0530 Subject: [PATCH 02/11] chore(treesitter): `@field` -> `@variable.member` --- lua/github-theme/group/modules/cmp.lua | 6 +++--- lua/github-theme/group/modules/treesitter.lua | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/github-theme/group/modules/cmp.lua b/lua/github-theme/group/modules/cmp.lua index 81adc92c..3a965a86 100644 --- a/lua/github-theme/group/modules/cmp.lua +++ b/lua/github-theme/group/modules/cmp.lua @@ -41,9 +41,9 @@ function M.get(spec, config, opts) CmpItemKindModule = { link = has_ts and '@namespace' or 'Identifier' }, CmpItemKindProperty = { link = has_ts and '@property' or 'Identifier' }, - CmpItemKindField = { link = has_ts and '@field' or 'Identifier' }, - CmpItemKindTypeParameter = { link = has_ts and '@field' or 'Identifier' }, - CmpItemKindEnumMember = { link = has_ts and '@field' or 'Identifier' }, + CmpItemKindField = { link = has_ts and '@variable.member' or 'Identifier' }, + CmpItemKindTypeParameter = { link = has_ts and '@variable.member' or 'Identifier' }, + CmpItemKindEnumMember = { link = has_ts and '@variable.member' or 'Identifier' }, CmpItemKindOperator = { link = 'Operator' }, CmpItemKindSnippet = { fg = spec.fg2 }, } diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index ff956c98..c7f0bbd5 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -105,8 +105,8 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@storageclass'] = { link = 'StorageClass' }, -- Visibility/life-time/etc. modifiers (e.g. `static`) ['@attribute'] = { link = 'Constant' }, -- Attribute annotations (e.g. Python decorators) - ['@field'] = { fg = syn.field }, -- For fields - ['@property'] = { link = '@field' }, -- Same as @field + ['@variable.member'] = { fg = syn.field }, -- For fields + ['@property'] = { link = '@variable.member' }, -- Same as @field -- Identifiers ['@variable'] = { fg = syn.variable, style = stl.variables }, -- Any variable name that does not have another highlighC. @@ -148,7 +148,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Tags ['@tag'] = { fg = syn.tag }, -- Tags like html tag names - ['@tag.attribute'] = { link = '@field' }, -- Tag attributes (e.g. HTML element attributes) + ['@tag.attribute'] = { link = '@variable.member' }, -- Tag attributes (e.g. HTML element attributes) ['@tag.delimiter'] = FALLBACK_OR_NONE, -- Tag delimiter like `<`, `>`, `/`, etc. -- Language specific ------------------------------------------------------- @@ -175,7 +175,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Go -- ['@function.call.go'] = { link = '@constant' }, - -- ['@function.go'] = { link = '@field' }, + -- ['@function.go'] = { link = '@variable.member' }, -- ['@method.call.go'] = { link = '@constant' }, ['@namespace.go'] = FALLBACK_OR_NONE, @@ -227,7 +227,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@text.quote.markdown'] = { fg = syn.tag }, -- Nix - ['@variable.member.nix'] = { link = '@field' }, + ['@variable.member.nix'] = { link = '@variable.member' }, ['@variable.parameter.nix'] = { link = '@variable.parameter' }, ['@string.special.path.nix'] = { link = '@string' }, From 7cdb43045a8778a45ff680ffd4f18f707467ce34 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Mon, 6 May 2024 20:34:03 +0530 Subject: [PATCH 03/11] chore(treesitter): `@namespace` -> `@module` --- lua/github-theme/group/modules/cmp.lua | 2 +- lua/github-theme/group/modules/treesitter.lua | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/github-theme/group/modules/cmp.lua b/lua/github-theme/group/modules/cmp.lua index 3a965a86..ba3ab3bd 100644 --- a/lua/github-theme/group/modules/cmp.lua +++ b/lua/github-theme/group/modules/cmp.lua @@ -38,7 +38,7 @@ function M.get(spec, config, opts) CmpItemKindClass = { link = 'Type' }, CmpItemKindStruct = { link = 'Type' }, - CmpItemKindModule = { link = has_ts and '@namespace' or 'Identifier' }, + CmpItemKindModule = { link = has_ts and '@module' or 'Identifier' }, CmpItemKindProperty = { link = has_ts and '@property' or 'Identifier' }, CmpItemKindField = { link = has_ts and '@variable.member' or 'Identifier' }, diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index c7f0bbd5..a8486a29 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -116,7 +116,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@constant.builtin'] = { fg = syn.builtin2, style = stl.keywords }, -- 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 = syn.builtin1 }, -- For identifiers referring to modules and namespaces + ['@module'] = { fg = syn.builtin1 }, -- For identifiers referring to modules and namespaces ['@symbol'] = { fg = syn.preproc }, -- Text @@ -171,13 +171,13 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- C_sharp -- ['@type.c_sharp'] = { link = '@function' }, - ['@namespace.c_sharp'] = { fg = pl.syntax.variable }, + ['@module.c_sharp'] = { fg = pl.syntax.variable }, -- Go -- ['@function.call.go'] = { link = '@constant' }, -- ['@function.go'] = { link = '@variable.member' }, -- ['@method.call.go'] = { link = '@constant' }, - ['@namespace.go'] = FALLBACK_OR_NONE, + ['@module.go'] = FALLBACK_OR_NONE, -- Html ['@text.title.html'] = { fg = spec.fg1 }, @@ -210,7 +210,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@field.lua'] = { fg = syn.variable }, ['@function.call.lua'] = { fg = syn.const }, ['@method.call.lua'] = { link = '@function.call.lua' }, - ['@namespace.builtin.lua'] = { fg = syn.const }, -- `table`, `io`, `_G` + ['@module.builtin.lua'] = { fg = syn.const }, -- `table`, `io`, `_G` ['@label.lua'] = { fg = syn.const }, -- The `LABEL` in `::LABEL::` and `goto LABEL` ['@field.luadoc'] = { link = '@field.lua' }, ['@operator.luadoc'] = { fg = spec.fg1 }, -- The `|` in `string|number` @@ -233,7 +233,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- PHP -- ['@type.php'] = { link = '@function' }, - ['@namespace.php'] = { link = '@constructor.php' }, + ['@module.php'] = { link = '@constructor.php' }, -- Python ['@field.python'] = { fg = spec.fg1 }, @@ -249,7 +249,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Rust -- ['@field.rust'] = { fg = spec.fg2 }, ['@constant.builtin.rust'] = { fg = pl.syntax.variable }, - ['@namespace.rust'] = FALLBACK_OR_NONE, + ['@module.rust'] = FALLBACK_OR_NONE, ['@preproc.rust'] = { fg = syn.const }, ['@storageclass.lifetime.rust'] = { link = '@tag.rust' }, ['@storageclass.lifetime.punctuation.rust'] = { link = '@punctuation.special.rust' }, From 959b78b5a371e59f92c1e1c675ef163b0061ae72 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Tue, 7 May 2024 15:14:08 +0530 Subject: [PATCH 04/11] chore(treesitter): `@float` -> `@number.float` --- lua/github-theme/group/modules/treesitter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index a8486a29..4a46711c 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -72,7 +72,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@boolean'] = { link = 'Boolean' }, -- For booleans -- ['@number'] = { link = 'Number' }, -- For all numbers - -- ['@float'] = { link = 'Float' }, -- For floats + -- ['@number.float'] = { link = 'Float' }, -- For floats -- Functions -- ['@function'] = { link = 'Function' }, -- For function (calls and definitions) From dbf077a8e4cef3c02561188d7be4566f088b73d8 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Tue, 7 May 2024 15:18:32 +0530 Subject: [PATCH 05/11] chore(treesitter): `@symbol` -> `@string.special.symbol` --- lua/github-theme/group/modules/treesitter.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index 4a46711c..73b88e7c 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -66,6 +66,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@string.regex'] = { fg = syn.regex, style = stl.strings }, -- Regular expression literals ['@string.escape'] = { fg = syn.regex, style = 'bold' }, -- Escape characters within a string: `\n`, `\t`, etc. ['@string.special'] = { link = 'Special' }, -- Other special strings (e.g. dates) + ['@string.special.symbol'] = { fg = syn.preproc }, -- ['@character'] = { link = 'Character' }, -- character literals -- ['@character.special'] = { link = 'SpecialChar' }, -- special characters (e.g. wildcards) @@ -117,7 +118,6 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@constant.macro'] = { link = 'Macro' }, -- For constants that are defined by macros: NULL in C ['@module'] = { fg = syn.builtin1 }, -- For identifiers referring to modules and namespaces - ['@symbol'] = { fg = syn.preproc }, -- Text ['@text'] = { fg = spec.fg1 }, -- For strings considerated text in a markup language @@ -217,8 +217,8 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@punctuation.special.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?` -- Make - -- ['@operator.make'] = { link = '@constant' }, - ['@symbol.make'] = { link = '@function' }, + -- ['@operator.make'] = { link = '@constant' }, + ['@string.special.symbol.make'] = { link = '@function' }, ['@function.builtin.make'] = { link = '@constant' }, -- Markdown @@ -244,7 +244,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Ruby ['@label.ruby'] = { fg = syn.const }, - ['@symbol.ruby'] = { link = '@constant' }, + ['@string.special.symbol.ruby'] = { link = '@constant' }, -- Rust -- ['@field.rust'] = { fg = spec.fg2 }, From 83a71b63ceadef3e1cbe6aca93ad10d3829b7116 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Tue, 7 May 2024 15:19:26 +0530 Subject: [PATCH 06/11] chore(treesitter): `@string.regex` -> `@string.regexp` --- lua/github-theme/group/modules/treesitter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index 73b88e7c..d2014e95 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -63,7 +63,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Literals -- ['@string'] = { link = 'String' }, -- For strings - ['@string.regex'] = { fg = syn.regex, style = stl.strings }, -- Regular expression literals + ['@string.regexp'] = { fg = syn.regex, style = stl.strings }, -- Regular expression literals ['@string.escape'] = { fg = syn.regex, style = 'bold' }, -- Escape characters within a string: `\n`, `\t`, etc. ['@string.special'] = { link = 'Special' }, -- Other special strings (e.g. dates) ['@string.special.symbol'] = { fg = syn.preproc }, From 04b10956615e35e7ef0994c48f1ce841fae5cf97 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Tue, 7 May 2024 15:44:30 +0530 Subject: [PATCH 07/11] chore(treesitter): `@text.*` -> `@markup.*` All highlights changes: - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below) - `@text.title` -> `@markup.heading` - `@text.literal` -> `@markup.raw` - `@text.reference` -> `@markup.link` - `@text.uri` -> `@markup.link.url` (in markup links) - `@string.special` -> `@markup.link.label` (non-url links) - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`) Related to #315 --- lua/github-theme/group/modules/treesitter.lua | 42 +++++++++---------- queries/bash/highlights.scm | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index d2014e95..ec980c29 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -59,13 +59,11 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Punctuation -- ['@punctuation.delimiter'] = { fg = syn.bracket }, -- For delimiters (e.g. `.`) ['@punctuation.bracket'] = { fg = syn.bracket }, -- For brackets and parenthesis - ['@punctuation.special'] = { fg = syn.builtin2, style = stl.operators }, -- For special punctutation that does not fall in the catagories before -- Literals -- ['@string'] = { link = 'String' }, -- For strings ['@string.regexp'] = { fg = syn.regex, style = stl.strings }, -- Regular expression literals ['@string.escape'] = { fg = syn.regex, style = 'bold' }, -- Escape characters within a string: `\n`, `\t`, etc. - ['@string.special'] = { link = 'Special' }, -- Other special strings (e.g. dates) ['@string.special.symbol'] = { fg = syn.preproc }, -- ['@character'] = { link = 'Character' }, -- character literals @@ -119,19 +117,21 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@module'] = { fg = syn.builtin1 }, -- For identifiers referring to modules and namespaces - -- Text - ['@text'] = { fg = spec.fg1 }, -- For strings considerated text in a markup language - ['@text.strong'] = { fg = spec.fg1, style = 'bold' }, -- Bold - ['@text.emphasis'] = { fg = spec.fg1, style = 'italic' }, -- Italic - -- ['@text.underline'] = { link = 'Underlined' }, -- Underlined text - ['@text.strike'] = { fg = spec.fg1, style = 'strikethrough' }, -- Strikethrough text - -- ['@text.title'] = { link = 'Title'}, -- Titles like: # Example - ['@text.literal'] = { fg = syn.ident, style = 'italic' }, -- Used for inline code in markdown and for doc in python (''') - ['@text.uri'] = { fg = syn.const, style = 'italic,underline' }, -- Urls, links and emails - ['@text.math'] = { fg = syn.func }, -- Math environments (e.g. `$ ... $` in LaTeX) - ['@text.environment'] = { fg = syn.preproc }, -- Text environments of markup languages - ['@text.environment.name'] = { fg = syn.func }, -- Text indicating the type of an environment - ['@text.reference'] = { fg = spec.fg1, style = 'underline' }, -- References + -- Markup + ['@markup'] = { fg = spec.fg1 }, -- For strings considerated text in a markup language + ['@markup.environment'] = { fg = syn.preproc }, -- Text environments of markup languages + ['@markup.environment.name'] = { fg = syn.func }, -- Text indicating the type of an environment + ['@markup.list'] = { fg = syn.builtin2, style = stl.operators }, -- For special punctutation that does not fall in the catagories before + ['@markup.strong'] = { fg = spec.fg1, style = 'bold' }, -- Bold + ['@markup.emphasis'] = { fg = spec.fg1, style = 'italic' }, -- Italic + -- ['@markup.underline'] = { link = 'Underlined' }, -- Underlined text + ['@markup.strike'] = { fg = spec.fg1, style = 'strikethrough' }, -- Strikethrough text + -- ['@markup.heading'] = { link = 'Title'}, -- Titles like: # Example + ['@markup.raw'] = { fg = syn.ident, style = 'italic' }, -- Used for inline code in markdown and for doc in python (''') + ['@markup.math'] = { fg = syn.func }, -- Math environments (e.g. `$ ... $` in LaTeX) + ['@markup.link'] = { fg = spec.fg1, style = 'underline' }, -- References + ['@markup.link.uri'] = { fg = syn.const, style = 'italic,underline' }, -- Urls, links and emails + ['@markup.link.label'] = { link = 'Special' }, -- Other special strings (e.g. dates) ['@text.todo'] = { fg = spec.bg1, bg = spec.diag.hint }, -- Todo notes ['@text.note'] = { fg = spec.bg1, bg = spec.diag.info }, @@ -160,7 +160,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@number.bash'] = FALLBACK_OR_NONE, -- ['@punctuation.bracket.bash'] = { fg = syn.string }, -- $(, (, ), [, ], ((, )) ['@punctuation.delimiter.bash'] = { fg = syn.keyword }, -- ; and ;; - ['@punctuation.special.bash'] = { link = "@punctuation.bash" }, -- $ + ['@markup.list.bash'] = { link = "@punctuation.bash" }, -- $ -- C ['@type.c'] = { fg = spec.variable }, @@ -180,7 +180,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@module.go'] = FALLBACK_OR_NONE, -- Html - ['@text.title.html'] = { fg = spec.fg1 }, + ['@markup.heading.html'] = { fg = spec.fg1 }, ['@constant.html'] = { link = '@tag' }, -- Java @@ -214,7 +214,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@label.lua'] = { fg = syn.const }, -- The `LABEL` in `::LABEL::` and `goto LABEL` ['@field.luadoc'] = { link = '@field.lua' }, ['@operator.luadoc'] = { fg = spec.fg1 }, -- The `|` in `string|number` - ['@punctuation.special.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?` + ['@markup.list.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?` -- Make -- ['@operator.make'] = { link = '@constant' }, @@ -224,7 +224,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Markdown ['@punctuation.delimiter.markdown'] = { fg = spec.fg1 }, ['@punctuation.delimiter.markdown_inline'] = { fg = spec.fg1 }, - ['@text.quote.markdown'] = { fg = syn.tag }, + ['@markup.quote.markdown'] = { fg = syn.tag }, -- Nix ['@variable.member.nix'] = { link = '@variable.member' }, @@ -252,7 +252,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@module.rust'] = FALLBACK_OR_NONE, ['@preproc.rust'] = { fg = syn.const }, ['@storageclass.lifetime.rust'] = { link = '@tag.rust' }, - ['@storageclass.lifetime.punctuation.rust'] = { link = '@punctuation.special.rust' }, + ['@storageclass.lifetime.punctuation.rust'] = { link = '@markup.list.rust' }, -- SCSS ['@property.scss'] = { link = '@constant' }, @@ -273,7 +273,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- VimDoc (vim help files/docs) ['@variable.parameter.vimdoc'] = { fg = pl.syntax.variable }, ['@label.vimdoc'] = { link = '@keyword' }, -- `*sometag*` - -- ['@string.special.vimdoc'] = { link = '@variable.parameter.vimdoc' }, -- `CTRL-W`, etc. (unused atm, not well-defined) + -- ['@markup.link.label.vimdoc'] = { link = '@variable.parameter.vimdoc' }, -- `CTRL-W`, etc. (unused atm, not well-defined) -- Yaml ['@field.yaml'] = { link = '@tag' }, diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm index 5ab2ab17..9940340c 100644 --- a/queries/bash/highlights.scm +++ b/queries/bash/highlights.scm @@ -17,4 +17,4 @@ "$" @variable) (subscript - index: (word) @punctuation.special (#any-of? @punctuation.special "@" "*")) + index: (word) @markup.list (#any-of? @punctuation.special "@" "*")) From ff8d53a9088f6162f62337b22d733a0b12f87a92 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Tue, 7 May 2024 16:06:14 +0530 Subject: [PATCH 08/11] chore(treesitter): Updated Helix syntax captures - `@method` -> `@function.method` - `@method.call` -> `@function.method.call` - `@preproc` -> `@keyword.directive` - `@define` -> `@keyword.directive`(`.define`?) - `@storageclass` -> `@keyword.storage` - `@conditional` -> `@keyword.conditional` - `@debug` -> `@keyword.debug` - `@exception` -> `@keyword.exception` - `@include` -> `@keyword.import` - `@repeat` -> `@keyword.repeat` --- lua/github-theme/group/modules/treesitter.lua | 37 ++++++++++--------- queries/rust/highlights.scm | 4 +- queries/solidity/highlights.scm | 8 ++-- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index ec980c29..82567596 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -52,8 +52,6 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Misc -- ['@comment'] = { link = 'Comment' }, ['@error'] = { link = 'Error' }, - -- ['@preproc'] = { link = 'PreProc' }, -- Various preprocessor directives & shebangs - -- ['@define'] = { link = 'Define' }, -- Preprocessor definition directives -- ['@operator'] = { link = 'Operator' }, -- For any operator: +, but also -> and * in C -- Punctuation @@ -78,23 +76,27 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@function.builtin'] = FALLBACK_OR_NONE, -- For builtin functions: table.insert in Lua -- ['@function.call'] = { link = '@function' }, -- Function calls -- ['@function.macro'] = { fg = syn.builtin0, style = stl.functions }, -- Macro functions (calls & defs): macro_rules!, println!() - -- ['@method'] = { link = '@function'}, -- For method definitions/declarations - -- ['@method.call'] = { link = '@method' }, -- Method calls + -- ['@function.method'] = { link = '@function'}, -- For method definitions/declarations + -- ['@function.method.call'] = { link = '@method' }, -- Method calls ['@constructor'] = { fg = pl.syntax.variable}, -- Constructor calls & defs: {} in Lua, new Type() (js/php), constructor() {} - ['@variable.parameter'] = { fg = syn.param, stl.variables }, -- For parameters of a function + ['@variable.parameter'] = { fg = syn.param, stl.variables }, -- For parameters of a function -- Keywords - -- ['@keyword'] = { link = 'Keyword' }, -- For keywords that don't fall in previous categories + -- ['@keyword'] = { link = 'Keyword' }, -- For keywords that don't fall in previous categories + -- ['@keyword.directive'] = { link = 'PreProc' }, -- Various preprocessor directives & shebangs + -- ['@keyword.return'] = { fg = syn.keyword, style = stl.keywords }, + -- ['@keyword.directive'] = { link = 'Define' }, -- Preprocessor definition directives + -- ['@keyword.storage'] = { link = 'StorageClass' }, -- Visibility/life-time/etc. modifiers (e.g. `static`) + -- ['@keyword.conditional'] = { link = 'Conditional' }, -- For keywords related to conditionals. + -- ['@keyword.debug'] = { link = spec.fg1 }, -- For keywords related to conditionals. + -- ['@keyword.import'] = { link = 'Include' }, -- For includes: #include in C, use or extern crate in Rust, Lua require + -- ['@keyword.repeat'] = { link = 'Repeat' }, -- For keywords related to loops. ['@keyword.function'] = { fg = syn.keyword, style = stl.functions }, -- Keywords used to def a fn: `function` in Lua, `def` & `lambda` in Python ['@keyword.operator'] = { fg = syn.keyword, style = stl.operators }, -- For `new` keyword operator, `sizeof`, etc. - -- ['@keyword.return'] = { fg = syn.keyword, style = stl.keywords }, + ['@keyword.exception'] = { fg = syn.builtin0, style = stl.keywords }, -- Exception related keywords: `try`, `except`, `finally` in Python - -- ['@conditional'] = { link = 'Conditional' }, -- For keywords related to conditionals. - -- ['@repeat'] = { link = 'Repeat' }, -- For keywords related to loops. ['@label'] = { link = '@tag' }, -- For labels: `label:` in C, `:label:` in Lua. - -- ['@include'] = { link = 'Include' }, -- For includes: #include in C, use or extern crate in Rust, Lua require - ['@exception'] = { fg = syn.builtin0, style = stl.keywords }, -- Exception related keywords: `try`, `except`, `finally` in Python -- Types ['@type'] = { fg = syn.type }, -- For custom/user/non-builtin types @@ -102,7 +104,6 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@type.definition'] = { link = '@type' }, -- type definitions (e.g. `typedef` in C) ['@type.qualifier'] = { fg = syn.keyword }, -- type qualifiers (e.g. `const`, css's `!important`) - -- ['@storageclass'] = { link = 'StorageClass' }, -- Visibility/life-time/etc. modifiers (e.g. `static`) ['@attribute'] = { link = 'Constant' }, -- Attribute annotations (e.g. Python decorators) ['@variable.member'] = { fg = syn.field }, -- For fields ['@property'] = { link = '@variable.member' }, -- Same as @field @@ -176,7 +177,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Go -- ['@function.call.go'] = { link = '@constant' }, -- ['@function.go'] = { link = '@variable.member' }, - -- ['@method.call.go'] = { link = '@constant' }, + -- ['@function.method.call.go'] = { link = '@constant' }, ['@module.go'] = FALLBACK_OR_NONE, -- Html @@ -187,7 +188,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@type.java'] = { link = '@function' }, -- JavaScript - -- ['@constructor.ecma'] = { link = '@method' }, + -- ['@constructor.ecma'] = { link = '@function.method' }, -- ['@property.javascript'] = { link = '@variable' }, -- ['@type.ecma'] = { fg = pl.syntax.variable }, -- ['@variable.builtin.javascript'] = { link = '@constant' }, @@ -209,7 +210,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@operator.lua'] = { fg = syn.keyword, style = stl.operators }, ['@field.lua'] = { fg = syn.variable }, ['@function.call.lua'] = { fg = syn.const }, - ['@method.call.lua'] = { link = '@function.call.lua' }, + ['@function.method.call.lua'] = { link = '@function.call.lua' }, ['@module.builtin.lua'] = { fg = syn.const }, -- `table`, `io`, `_G` ['@label.lua'] = { fg = syn.const }, -- The `LABEL` in `::LABEL::` and `goto LABEL` ['@field.luadoc'] = { link = '@field.lua' }, @@ -250,9 +251,9 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- ['@field.rust'] = { fg = spec.fg2 }, ['@constant.builtin.rust'] = { fg = pl.syntax.variable }, ['@module.rust'] = FALLBACK_OR_NONE, - ['@preproc.rust'] = { fg = syn.const }, - ['@storageclass.lifetime.rust'] = { link = '@tag.rust' }, - ['@storageclass.lifetime.punctuation.rust'] = { link = '@markup.list.rust' }, + ['@keyword.directive.rust'] = { fg = syn.const }, + ['@keyword.storage.lifetime.rust'] = { link = '@tag.rust' }, + ['@keyword.storage.lifetime.punctuation.rust'] = { link = '@markup.list.rust' }, -- SCSS ['@property.scss'] = { link = '@constant' }, diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index 8e84f14c..f13bc986 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -9,7 +9,7 @@ ([ (attribute_item) (inner_attribute_item) - ] @preproc (#set! "priority" 101)) + ] @keyword.directive (#set! "priority" 101)) (attribute_item (attribute @@ -24,4 +24,4 @@ ; Capture the ' in lifetimes separately ; TODO: upstream this capture -(lifetime "'" @storageclass.lifetime.punctuation) +(lifetime "'" @keyword.storage.lifetime.punctuation) diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index 6897b78d..b9b5b8e0 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -146,7 +146,7 @@ [ "try" "catch" -] @exception +] @keyword.exception [ "return" @@ -155,9 +155,9 @@ "function" @keyword.function -"import" @include -(import_directive "as" @include) -(import_directive "from" @include) +"import" @keyword.import +(import_directive "as" @keyword.import) +(import_directive "from" @keyword.import) (event_paramater "indexed" @keyword) From cc9516e82761ef15a12c11204964c52889e89601 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Tue, 7 May 2024 16:20:35 +0530 Subject: [PATCH 09/11] chore(treesitter): Updated `@comment` highlights --- lua/github-theme/group/modules/treesitter.lua | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index 82567596..fec31e4d 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -50,7 +50,6 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- stylua: ignore return { -- Misc - -- ['@comment'] = { link = 'Comment' }, ['@error'] = { link = 'Error' }, -- ['@operator'] = { link = 'Operator' }, -- For any operator: +, but also -> and * in C @@ -120,26 +119,33 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- Markup ['@markup'] = { fg = spec.fg1 }, -- For strings considerated text in a markup language - ['@markup.environment'] = { fg = syn.preproc }, -- Text environments of markup languages - ['@markup.environment.name'] = { fg = syn.func }, -- Text indicating the type of an environment - ['@markup.list'] = { fg = syn.builtin2, style = stl.operators }, -- For special punctutation that does not fall in the catagories before ['@markup.strong'] = { fg = spec.fg1, style = 'bold' }, -- Bold ['@markup.emphasis'] = { fg = spec.fg1, style = 'italic' }, -- Italic -- ['@markup.underline'] = { link = 'Underlined' }, -- Underlined text ['@markup.strike'] = { fg = spec.fg1, style = 'strikethrough' }, -- Strikethrough text + -- ['@markup.heading'] = { link = 'Title'}, -- Titles like: # Example - ['@markup.raw'] = { fg = syn.ident, style = 'italic' }, -- Used for inline code in markdown and for doc in python (''') + + ['@markup.environment'] = { fg = syn.preproc }, -- Text environments of markup languages + ['@markup.environment.name'] = { fg = syn.func }, -- Text indicating the type of an environment ['@markup.math'] = { fg = syn.func }, -- Math environments (e.g. `$ ... $` in LaTeX) + ['@markup.raw'] = { fg = syn.ident, style = 'italic' }, -- Used for inline code in markdown and for doc in python (''') + ['@markup.link'] = { fg = spec.fg1, style = 'underline' }, -- References ['@markup.link.uri'] = { fg = syn.const, style = 'italic,underline' }, -- Urls, links and emails ['@markup.link.label'] = { link = 'Special' }, -- Other special strings (e.g. dates) - ['@text.todo'] = { fg = spec.bg1, bg = spec.diag.hint }, -- Todo notes - ['@text.note'] = { fg = spec.bg1, bg = spec.diag.info }, - ['@text.warning'] = { fg = spec.bg1, bg = spec.diag.warn }, - ['@text.danger'] = { fg = spec.bg1, bg = spec.diag.error }, - ['@text.todo.unchecked'] = { fg = spec.fg3 }, -- For brackets and parens - ['@text.todo.checked'] = { fg = P.green.base }, -- For brackets and parens + ['@markup.list'] = { fg = syn.builtin2, style = stl.operators }, -- For special punctutation that does not fall in the catagories before + ['@markup.list.checked'] = { fg = P.green.base }, -- checked todo-style list markers + ['@markup.list.unchecked'] = { fg = spec.fg3 }, -- unchecked todo-style list markers + + -- Comment + -- ['@comment'] = { link = 'Comment' }, + ['@comment.todo'] = { fg = spec.bg1, bg = spec.diag.hint }, -- Todo notes todo-type comments (e.g-, `TODO:`, `WIP:`) + ['@comment.hint'] = { fg = spec.bg1, bg = spec.diag.hint }, -- note-type comments (e.g., `NOTE:`) + ['@comment.info'] = { fg = spec.bg1, bg = spec.diag.info }, -- info-type comments + ['@comment.warning'] = { fg = spec.bg1, bg = spec.diag.warn }, -- warning-type comments (e.g., `WARNING:`, `FIX:`) + ['@comment.error'] = { fg = spec.bg1, bg = spec.diag.error }, -- error-type comments (e.g., `DEPRECATED:`) ['@text.diff.add'] = { link = 'diffAdded' }, -- Added text (for diff files) ['@text.diff.delete'] = { link = 'diffRemoved' }, -- Deleted text (for diff files) From aeea53d46469307e00f593781f4d271d5cc09836 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Wed, 8 May 2024 12:18:35 +0530 Subject: [PATCH 10/11] feat(tresitter): Organized and Re-grouped treesitter highlighs --- lua/github-theme/group/modules/treesitter.lua | 189 +++++++++++------- 1 file changed, 115 insertions(+), 74 deletions(-) diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index fec31e4d..75253e66 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -49,115 +49,156 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch -- stylua: ignore return { - -- Misc - ['@error'] = { link = 'Error' }, - -- ['@operator'] = { link = 'Operator' }, -- For any operator: +, but also -> and * in C - -- Punctuation - -- ['@punctuation.delimiter'] = { fg = syn.bracket }, -- For delimiters (e.g. `.`) - ['@punctuation.bracket'] = { fg = syn.bracket }, -- For brackets and parenthesis + -- Identifiers ------------------------------------------------------------- - -- Literals - -- ['@string'] = { link = 'String' }, -- For strings + ['@variable'] = { fg = syn.variable, style = stl.variables }, -- Any variable name that does not have another highlighC. + ['@variable.builtin'] = { fg = syn.builtin0, style = stl.variables }, -- Var names defined by the language: this, self, super + ['@variable.member'] = { fg = syn.field }, -- For fields + ['@variable.parameter'] = { fg = syn.param, stl.variables }, -- For parameters of a function + + -- ['@constant'] = { link = 'Constant' }, -- Constant identifiers + ['@constant.builtin'] = { fg = syn.builtin2, style = stl.keywords }, -- 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 + + ['@module'] = { fg = syn.builtin1 }, -- For identifiers referring to modules and namespaces + ['@module.builtin'] = { fg = syn.builtin2 }, -- built-in modules or namespaces + ['@label'] = { link = '@tag' }, -- For labels: `label:` in C, `:label:` in Lua. + + + -- Literals ----------------------------------------------------------------- + + -- ['@string'] = { link = 'String' }, -- For strings + -- ['@string.documentation'] = { link = 'String' }, -- String documenting code (e.g. Python docstrings) ['@string.regexp'] = { fg = syn.regex, style = stl.strings }, -- Regular expression literals ['@string.escape'] = { fg = syn.regex, style = 'bold' }, -- Escape characters within a string: `\n`, `\t`, etc. - ['@string.special.symbol'] = { fg = syn.preproc }, - -- ['@character'] = { link = 'Character' }, -- character literals - -- ['@character.special'] = { link = 'SpecialChar' }, -- special characters (e.g. wildcards) + -- ['@string.special'] = { link = 'Special' }, -- Other special strings (e.g. dates) + ['@string.special.symbol'] = { fg = syn.preproc }, -- Symbols or atoms + ['@string.special.url'] = { fg = syn.const, style = 'italic,underline' }, -- URIs (e.g. hyperlinks) + -- ['@string.special.path'] = { fg = spec.palette.done.fg }, -- Filenames - -- ['@boolean'] = { link = 'Boolean' }, -- For booleans - -- ['@number'] = { link = 'Number' }, -- For all numbers - -- ['@number.float'] = { link = 'Float' }, -- For floats + -- ['@character'] = { link = 'Character' }, -- character literals + -- ['@character.special'] = { link = 'SpecialChar' }, -- special characters (e.g. wildcards) - -- Functions - -- ['@function'] = { link = 'Function' }, -- For function (calls and definitions) - ['@function.builtin'] = FALLBACK_OR_NONE, -- For builtin functions: table.insert in Lua - -- ['@function.call'] = { link = '@function' }, -- Function calls - -- ['@function.macro'] = { fg = syn.builtin0, style = stl.functions }, -- Macro functions (calls & defs): macro_rules!, println!() - -- ['@function.method'] = { link = '@function'}, -- For method definitions/declarations - -- ['@function.method.call'] = { link = '@method' }, -- Method calls + -- ['@boolean'] = { link = 'Boolean' }, -- For booleans + -- ['@number'] = { link = 'Number' }, -- For all numbers + -- ['@number.float'] = { link = 'Float' }, -- For floats - ['@constructor'] = { fg = pl.syntax.variable}, -- Constructor calls & defs: {} in Lua, new Type() (js/php), constructor() {} - ['@variable.parameter'] = { fg = syn.param, stl.variables }, -- For parameters of a function - -- Keywords - -- ['@keyword'] = { link = 'Keyword' }, -- For keywords that don't fall in previous categories - -- ['@keyword.directive'] = { link = 'PreProc' }, -- Various preprocessor directives & shebangs - -- ['@keyword.return'] = { fg = syn.keyword, style = stl.keywords }, - -- ['@keyword.directive'] = { link = 'Define' }, -- Preprocessor definition directives - -- ['@keyword.storage'] = { link = 'StorageClass' }, -- Visibility/life-time/etc. modifiers (e.g. `static`) - -- ['@keyword.conditional'] = { link = 'Conditional' }, -- For keywords related to conditionals. - -- ['@keyword.debug'] = { link = spec.fg1 }, -- For keywords related to conditionals. - -- ['@keyword.import'] = { link = 'Include' }, -- For includes: #include in C, use or extern crate in Rust, Lua require - -- ['@keyword.repeat'] = { link = 'Repeat' }, -- For keywords related to loops. - ['@keyword.function'] = { fg = syn.keyword, style = stl.functions }, -- Keywords used to def a fn: `function` in Lua, `def` & `lambda` in Python - ['@keyword.operator'] = { fg = syn.keyword, style = stl.operators }, -- For `new` keyword operator, `sizeof`, etc. - ['@keyword.exception'] = { fg = syn.builtin0, style = stl.keywords }, -- Exception related keywords: `try`, `except`, `finally` in Python - - ['@label'] = { link = '@tag' }, -- For labels: `label:` in C, `:label:` in Lua. + -- Types -------------------------------------------------------------------- - -- Types ['@type'] = { fg = syn.type }, -- For custom/user/non-builtin types ['@type.builtin'] = { fg = syn.builtin1, style = stl.types }, -- For builtin types - -- ['@type.definition'] = { link = '@type' }, -- type definitions (e.g. `typedef` in C) + + -- ['@type.definition'] = { link = '@type' }, -- type definitions (e.g. `typedef` in C) ['@type.qualifier'] = { fg = syn.keyword }, -- type qualifiers (e.g. `const`, css's `!important`) ['@attribute'] = { link = 'Constant' }, -- Attribute annotations (e.g. Python decorators) - ['@variable.member'] = { fg = syn.field }, -- For fields ['@property'] = { link = '@variable.member' }, -- Same as @field - -- Identifiers - ['@variable'] = { fg = syn.variable, style = stl.variables }, -- Any variable name that does not have another highlighC. - ['@variable.builtin'] = { fg = syn.builtin0, style = stl.variables }, -- Var names defined by the language: this, self, super - -- ['@constant'] = { link = 'Constant' }, -- For constants - ['@constant.builtin'] = { fg = syn.builtin2, style = stl.keywords }, -- 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 + -- Functions ---------------------------------------------------------------- - ['@module'] = { fg = syn.builtin1 }, -- For identifiers referring to modules and namespaces + -- ['@function'] = { link = 'Function' }, -- For function (calls and definitions) + ['@function.builtin'] = FALLBACK_OR_NONE, -- For builtin functions: table.insert in Lua + -- ['@function.call'] = { link = '@function' }, -- Function calls + -- ['@function.macro'] = { fg = syn.builtin0, style = stl.functions }, -- Macro functions (calls & defs): macro_rules!, println!() - -- Markup - ['@markup'] = { fg = spec.fg1 }, -- For strings considerated text in a markup language - ['@markup.strong'] = { fg = spec.fg1, style = 'bold' }, -- Bold - ['@markup.emphasis'] = { fg = spec.fg1, style = 'italic' }, -- Italic - -- ['@markup.underline'] = { link = 'Underlined' }, -- Underlined text - ['@markup.strike'] = { fg = spec.fg1, style = 'strikethrough' }, -- Strikethrough text + -- ['@function.method'] = { link = '@function'}, -- For method definitions/declarations + -- ['@function.method.call'] = { link = '@method' }, -- Method calls + + ['@constructor'] = { fg = pl.syntax.variable}, -- Constructor calls & defs: {} in Lua, new Type() (js/php), constructor() {} + -- ['@operator'] = { link = 'Operator' }, -- For any operator: +, but also -> and * in C + + + -- Keywords ----------------------------------------------------------------- + + -- ['@keyword'] = { link = 'Keyword' }, -- For keywords that don't fall in previous categories + -- ['@keyword.coroutine'] = { link = 'Keyword' }, -- Keywords related to coroutines (e.g. `go` in Go, `async/await` in Python) + ['@keyword.function'] = { fg = syn.keyword, style = stl.functions }, -- Keywords used to def a fn: `function` in Lua, `def` & `lambda` in Python + ['@keyword.operator'] = { fg = syn.keyword, style = stl.operators }, -- For `new` keyword operator, `sizeof`, etc. + -- ['@keyword.import'] = { link = 'Include' }, -- For includes: #include in C, use or extern crate in Rust, Lua require + -- ['@keyword.storage'] = { link = 'StorageClass' }, -- Visibility/life-time/etc. modifiers (e.g. `static`) + -- ['@keyword.repeat'] = { link = 'Repeat' }, -- For keywords related to loops. + -- ['@keyword.return'] = { fg = syn.keyword, style = stl.keywords }, + -- ['@keyword.debug'] = { link = spec.fg1 }, -- For keywords related to conditionals. + ['@keyword.exception'] = { fg = syn.builtin0, style = stl.keywords }, -- Exception related keywords: `try`, `except`, `finally` in Python + + -- ['@keyword.conditional'] = { link = 'Conditional' }, -- For keywords related to conditionals. + -- ['@keyword.conditional.ternary'] = { link = 'Keyword' }, -- ternary operator (e.g. `?` / `:`) + + -- ['@keyword.directive'] = { link = 'PreProc' }, -- Various preprocessor directives & shebangs + -- ['@keyword.directive.define'] = { link = 'Define' }, -- Preprocessor definition directives + + + -- Punctuation -------------------------------------------------------------- + + -- ['@punctuation.delimiter'] = { fg = syn.bracket }, -- For delimiters (e.g. `.`) + ['@punctuation.bracket'] = { fg = syn.bracket }, -- For brackets and parenthesis + -- ['@punctuation.special'] = { link = 'Special' }, -- Special symbols (e.g. `{}` in string interpolation) + + + -- Comment ------------------------------------------------------------------ + + -- ['@comment'] = { link = 'Comment' }, -- line and block comments + -- ['@comment.documentation'] = { link = 'Comment' }, -- comments documenting code + ['@comment.error'] = { fg = spec.bg1, bg = spec.diag.error }, -- error-type comments (e.g., `DEPRECATED:`) + ['@comment.warning'] = { fg = spec.bg1, bg = spec.diag.warn }, -- warning-type comments (e.g., `WARNING:`, `FIX:`) + ['@comment.hint'] = { fg = spec.bg1, bg = spec.diag.hint }, -- note-type comments (e.g., `NOTE:`) + ['@comment.info'] = { fg = spec.bg1, bg = spec.diag.info }, -- info-type comments + ['@comment.todo'] = { fg = spec.bg1, bg = spec.diag.hint }, -- Todo notes todo-type comments (e.g-, `TODO:`, `WIP:`) + + + -- Markup ------------------------------------------------------------------- + + ['@markup.strong'] = { fg = spec.fg1, style = 'bold' }, -- Bold text + ['@markup.italic'] = { fg = spec.fg1, style = 'italic' }, -- Text with emphasis + ['@markup.strikethrough'] = { fg = spec.fg1, style = 'strikethrough' }, -- Strikethrough text + -- ['@markup.underline'] = { link = 'Underlined' }, -- Underlined text (only for literal underline markup!) -- ['@markup.heading'] = { link = 'Title'}, -- Titles like: # Example - + -- ['@markup.quote'] = { fg = syn.tag }, -- block quotes + -- ['@markup.math'] = { fg = syn.tag }, -- math environments (e.g. `$ ... $` in LaTeX) ['@markup.environment'] = { fg = syn.preproc }, -- Text environments of markup languages ['@markup.environment.name'] = { fg = syn.func }, -- Text indicating the type of an environment - ['@markup.math'] = { fg = syn.func }, -- Math environments (e.g. `$ ... $` in LaTeX) - ['@markup.raw'] = { fg = syn.ident, style = 'italic' }, -- Used for inline code in markdown and for doc in python (''') ['@markup.link'] = { fg = spec.fg1, style = 'underline' }, -- References ['@markup.link.uri'] = { fg = syn.const, style = 'italic,underline' }, -- Urls, links and emails ['@markup.link.label'] = { link = 'Special' }, -- Other special strings (e.g. dates) + ['@markup.raw'] = { fg = syn.ident, style = 'italic' }, -- literal or verbatim text (e.g., inline code) + -- ['@markup.raw.block'] = { link = '@markup.raw' }, -- literal or verbatim text as a stand-alone block + ['@markup.list'] = { fg = syn.builtin2, style = stl.operators }, -- For special punctutation that does not fall in the catagories before ['@markup.list.checked'] = { fg = P.green.base }, -- checked todo-style list markers ['@markup.list.unchecked'] = { fg = spec.fg3 }, -- unchecked todo-style list markers - -- Comment - -- ['@comment'] = { link = 'Comment' }, - ['@comment.todo'] = { fg = spec.bg1, bg = spec.diag.hint }, -- Todo notes todo-type comments (e.g-, `TODO:`, `WIP:`) - ['@comment.hint'] = { fg = spec.bg1, bg = spec.diag.hint }, -- note-type comments (e.g., `NOTE:`) - ['@comment.info'] = { fg = spec.bg1, bg = spec.diag.info }, -- info-type comments - ['@comment.warning'] = { fg = spec.bg1, bg = spec.diag.warn }, -- warning-type comments (e.g., `WARNING:`, `FIX:`) - ['@comment.error'] = { fg = spec.bg1, bg = spec.diag.error }, -- error-type comments (e.g., `DEPRECATED:`) - - ['@text.diff.add'] = { link = 'diffAdded' }, -- Added text (for diff files) - ['@text.diff.delete'] = { link = 'diffRemoved' }, -- Deleted text (for diff files) - ['@diff.plus'] = { link = "diffAdded" }, - ['@diff.minus'] = { link = "diffRemoved" }, - ['@diff.delta'] = { link = "diffChanged" }, - - -- Tags + ['@diff.plus'] = { link = "diffAdded" }, -- added text (for diff files) + ['@diff.minus'] = { link = "diffRemoved" }, -- deleted text (for diff files) + ['@diff.delta'] = { link = "diffChanged" }, -- changed text (for diff files) + + + -- XML Tags ---------------------------------------------------------------- + ['@tag'] = { fg = syn.tag }, -- Tags like html tag names ['@tag.attribute'] = { link = '@variable.member' }, -- Tag attributes (e.g. HTML element attributes) ['@tag.delimiter'] = FALLBACK_OR_NONE, -- Tag delimiter like `<`, `>`, `/`, etc. + -- Non-highlighting captures ----------------------------------------------- + + ['@none'] = { link = 'NONE' }, -- completely disable the highlight + ['@conceal'] = { link = 'Conceal' }, -- captures that are only meant to be concealed + + + + -- [DEPRECATED] ------------------------------------------------------------ + -- ['@error'] = { link = 'Error' }, + -- ['@text.diff.add'] = { link = 'diffAdded' }, -- Added text (for diff files) + -- ['@text.diff.delete'] = { link = 'diffRemoved' }, -- Deleted text (for diff files) + + + -- Language specific ------------------------------------------------------- -- Bash @@ -216,12 +257,12 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@operator.lua'] = { fg = syn.keyword, style = stl.operators }, ['@field.lua'] = { fg = syn.variable }, ['@function.call.lua'] = { fg = syn.const }, - ['@function.method.call.lua'] = { link = '@function.call.lua' }, + ['@function.method.call.lua'] = { link = '@function.call.lua' }, ['@module.builtin.lua'] = { fg = syn.const }, -- `table`, `io`, `_G` ['@label.lua'] = { fg = syn.const }, -- The `LABEL` in `::LABEL::` and `goto LABEL` ['@field.luadoc'] = { link = '@field.lua' }, ['@operator.luadoc'] = { fg = spec.fg1 }, -- The `|` in `string|number` - ['@markup.list.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?` + ['@markup.list.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?` -- Make -- ['@operator.make'] = { link = '@constant' }, From 8d8ab7c9880fc4e5b92e66a0aa9fda4d6206d579 Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Wed, 8 May 2024 16:36:28 +0530 Subject: [PATCH 11/11] chore(bash): Removed `@punctuation.special` bash queries --- queries/bash/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm index 9940340c..701104e8 100644 --- a/queries/bash/highlights.scm +++ b/queries/bash/highlights.scm @@ -17,4 +17,4 @@ "$" @variable) (subscript - index: (word) @markup.list (#any-of? @punctuation.special "@" "*")) + index: (word) @markup.list (#any-of? "@" "*"))