Skip to content

Commit

Permalink
[language-c] Highlight parameters like the "foo" in type *& foo
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Oct 20, 2024
1 parent acaf004 commit df15c8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/language-c/grammars/tree-sitter-cpp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@
; ((identifier) @variable.other.readwrite.member.cpp
; (#match? @variable.other.readwrite.member.cpp "^(f|m)[A-Z]\\w*$"))

; The "foo" in `int &foo` with in a parameter list.
(parameter_declaration
declarator: (reference_declarator
(identifier) @variable.parameter.cpp))
; The "foo" in `const char *foo` within a parameter list.
; (Should work no matter how many pointers deep we are.)
(reference_declarator (identifier) @variable.parameter.cpp
(#is? test.descendantOfType "parameter_declaration"))


; KEYWORDS
Expand Down

0 comments on commit df15c8c

Please sign in to comment.