Skip to content

Commit

Permalink
Highlight named argument references with TS
Browse files Browse the repository at this point in the history
Plugins can extend Tree-sitter queries by placing them in the
after/queries/ directory. This allows this theme to define custom
highlight groups, such as for _references_ to named arguments.
  • Loading branch information
yorickpeterse committed May 3, 2024
1 parent 77642f6 commit 3f54709
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions after/queries/inko/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; extends
(named_argument
name: _ @variable.parameter @variable.parameter.reference)
3 changes: 3 additions & 0 deletions after/queries/python/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; extends
(keyword_argument
name: (identifier) @variable.parameter @variable.parameter.reference)
4 changes: 4 additions & 0 deletions colors/grey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ local highlights = {
['@text.emphasis'] = { italic = true },
['@property.json'] = { bold = true },
['@variable.builtin'] = { bold = true },

-- Custom Tree-sitter captures added by this theme.
['@variable.parameter.reference'] = { fg = orange },

-- Ruby uses "TSLabel" for instance variables, for some reason. See
-- https://github.com/tree-sitter/tree-sitter-ruby/issues/184 for more
-- details.
Expand Down

0 comments on commit 3f54709

Please sign in to comment.