From e2acf70e435fb23170de71b9222065e49e1a69df Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Tue, 31 Oct 2023 13:27:43 -0700 Subject: [PATCH] =?UTF-8?q?[tree-sitter]=20Add=20highlights=20for=20C++=20?= =?UTF-8?q?destructors=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …and for the `class` keyword, whose omission is a strange oversight. --- packages/language-c/grammars/tree-sitter-cpp/highlights.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/language-c/grammars/tree-sitter-cpp/highlights.scm b/packages/language-c/grammars/tree-sitter-cpp/highlights.scm index ec7c35fa75..61a6fa0d73 100644 --- a/packages/language-c/grammars/tree-sitter-cpp/highlights.scm +++ b/packages/language-c/grammars/tree-sitter-cpp/highlights.scm @@ -126,6 +126,10 @@ (function_declarator (identifier) @entity.name.function.cpp) +(function_declarator + (destructor_name + (identifier) @entity.name.function.cpp)) + ; The "foo" in `void Bar::foo () {`. (function_declarator declarator: (qualified_identifier @@ -339,6 +343,7 @@ "throw" "using" "namespace" + "class" ] @keyword.control._TYPE_.cpp ; OPERATORS @@ -348,6 +353,7 @@ (abstract_pointer_declarator "*" @keyword.operator.pointer.cpp) (pointer_expression "*" @keyword.operator.pointer.cpp) +(destructor_name "~" @keyword.operator.destructor.cpp) "sizeof" @keyword.operator.sizeof.cpp (pointer_expression "&" @keyword.operator.pointer.cpp)