Skip to content

Commit

Permalink
[language-c] Fix highlighting of & in a reference declarator
Browse files Browse the repository at this point in the history
(Should've made it into last month’s!)
  • Loading branch information
savetheclocktower committed Nov 30, 2024
1 parent e4b6493 commit fe88f73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/language-c/grammars/common/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@
(init_declarator
declarator: (identifier) @variable.other.declaration._LANG_)

; The "x" in `FSEvent& x`;
(reference_declarator
[(identifier) (field_identifier)] @variable.other.declaration._LANG_
(#is? test.descendantOfType "declaration field_declaration"))

; The "x" in `SomeType *x;`
; (Should work no matter how many pointers deep we are.)
(pointer_declarator
Expand Down

0 comments on commit fe88f73

Please sign in to comment.