Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Improve C++ Tree-sitter queries (#18016)

VacheDesNeiges1f72069b4254
diff --git a/crates/languages/src/cpp/highlights.scm b/crates/languages/src/cpp/highlights.scm
index 4c9db569285..2df9ec2923b 100644
--- a/crates/languages/src/cpp/highlights.scm
+++ b/crates/languages/src/cpp/highlights.scm
@@ -2,6 +2,10 @@
(field_identifier) @property
(namespace_identifier) @namespace
+(concept_definition
+ (identifier) @concept)
+
+
(call_expression
function: (qualified_identifier
name: (identifier) @function))
@@ -64,6 +68,14 @@
(auto) @type
(type_identifier) @type
+type :(primitive_type) @type.primitive
+
+(requires_clause
+ constraint: (template_type
+ name: (type_identifier) @concept))
+
+(attribute
+ name: (identifier) @keyword)
((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$"))
@@ -119,7 +131,6 @@
"using"
"virtual"
"while"
- (primitive_type)
(sized_type_specifier)
(storage_class_specifier)
(type_qualifier)