aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/cpp/highlights.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/cpp/highlights.scm')
-rw-r--r--runtime/queries/cpp/highlights.scm108
1 files changed, 78 insertions, 30 deletions
diff --git a/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm
index 3348ef3c..11877a76 100644
--- a/runtime/queries/cpp/highlights.scm
+++ b/runtime/queries/cpp/highlights.scm
@@ -1,5 +1,3 @@
-; inherits: c
-
; Functions
(call_expression
@@ -12,56 +10,106 @@
(template_method
name: (field_identifier) @function)
-(template_function
- name: (identifier) @function)
-
(function_declarator
declarator: (qualified_identifier
name: (identifier) @function))
(function_declarator
declarator: (qualified_identifier
- name: (identifier) @function))
+ name: (qualified_identifier
+ name: (identifier) @function)))
(function_declarator
declarator: (field_identifier) @function)
; Types
-((namespace_identifier) @type
- (#match? @type "^[A-Z]"))
+(using_declaration ("using" "namespace" (identifier) @namespace))
+(using_declaration ("using" "namespace" (qualified_identifier name: (identifier) @namespace)))
+(namespace_definition name: (identifier) @namespace)
+(namespace_identifier) @namespace
+
+(qualified_identifier name: (identifier) @type.enum.variant)
(auto) @type
+"decltype" @type
; Constants
(this) @variable.builtin
-(nullptr) @constant
+(nullptr) @constant.builtin
; Keywords
-"catch" @keyword
-"class" @keyword
-"constexpr" @keyword
-"delete" @keyword
-"explicit" @keyword
-"final" @keyword
-"friend" @keyword
-"mutable" @keyword
-"namespace" @keyword
-"noexcept" @keyword
-"new" @keyword
-"override" @keyword
-"private" @keyword
-"protected" @keyword
-"public" @keyword
-"template" @keyword
-"throw" @keyword
-"try" @keyword
-"typename" @keyword
-"using" @keyword
-"virtual" @keyword
+(template_argument_list (["<" ">"] @punctuation.bracket))
+(template_parameter_list (["<" ">"] @punctuation.bracket))
+(default_method_clause "default" @keyword)
+
+"static_assert" @function.special
+
+[
+ "<=>"
+ "[]"
+ "()"
+] @operator
+
+[
+ "co_await"
+ "co_return"
+ "co_yield"
+ "concept"
+ "delete"
+ "final"
+ "new"
+ "operator"
+ "requires"
+ "using"
+] @keyword
+
+[
+ "catch"
+ "noexcept"
+ "throw"
+ "try"
+] @keyword.control.exception
+
+
+[
+ "and"
+ "and_eq"
+ "bitor"
+ "bitand"
+ "not"
+ "not_eq"
+ "or"
+ "or_eq"
+ "xor"
+ "xor_eq"
+] @keyword.operator
+
+[
+ "class"
+ "namespace"
+ "typename"
+] @keyword.storage.type
+
+[
+ "constexpr"
+ "constinit"
+ "consteval"
+ "explicit"
+ "friend"
+ "mutable"
+ "private"
+ "protected"
+ "public"
+ "override"
+ "template"
+ "virtual"
+] @keyword.storage.modifier
; Strings
(raw_string_literal) @string
+
+; inherits: c