From df15c8c0877a07ab6da4267d7755b4982cc3fafc Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Sun, 20 Oct 2024 16:47:08 -0700 Subject: [PATCH] [language-c] Highlight parameters like the "foo" in `type *& foo` --- .../language-c/grammars/tree-sitter-cpp/highlights.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/language-c/grammars/tree-sitter-cpp/highlights.scm b/packages/language-c/grammars/tree-sitter-cpp/highlights.scm index c819911905..778e294889 100644 --- a/packages/language-c/grammars/tree-sitter-cpp/highlights.scm +++ b/packages/language-c/grammars/tree-sitter-cpp/highlights.scm @@ -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