Skip to content

Commit

Permalink
[tree-sitter] Tweak C++ highlighting of class function declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Nov 4, 2023
1 parent e2acf70 commit 193a3dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/language-c/grammars/tree-sitter-cpp/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@
left: (field_expression
field: (field_identifier) @variable.other.member.assignment.cpp))

(reference_declarator
((reference_declarator
(identifier) @variable.declaration.cpp)
(#is-not? test.descendantOfType parameter_declaration))

; Function parameters
; -------------------
Expand All @@ -251,6 +252,11 @@
declarator: (pointer_declarator
declarator: (identifier) @variable.parameter.cpp))

(parameter_declaration
declarator: (reference_declarator
(identifier) @variable.parameter.cpp))


; The "foo" in `const char foo[]` within a parameter list.
(parameter_declaration
declarator: (array_declarator
Expand Down

0 comments on commit 193a3dc

Please sign in to comment.