summaryrefslogtreecommitdiff
path: root/queries/c
diff options
context:
space:
mode:
authorJohn Drouhard <john@jmdtech.org>2020-11-19 09:50:47 -0600
committerStephan Seitz <stephan.lauf@yahoo.de>2020-11-20 14:03:06 +0100
commit33ffdce6906b0946a6503c73b7fc71250cc938aa (patch)
tree14eff59a360286bc955caf2f5b359ae28abcb80a /queries/c
parentd2b8b49ce58a9fef0a8c5f154915a7a117163cd5 (diff)
c/cpp highlights: Fix field declarations and initializers
After a recent fix for #446, declarations in class/struct definitions stopped being marked as properties or methods. This fix will add property highlights to field declarations, and method highlight to field function declarations.
Diffstat (limited to 'queries/c')
-rw-r--r--queries/c/highlights.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm
index ccda6632..af401281 100644
--- a/queries/c/highlights.scm
+++ b/queries/c/highlights.scm
@@ -122,6 +122,11 @@
(((field_expression
(field_identifier) @property)) @_parent
(#not-has-parent? @_parent template_method function_declarator call_expression))
+
+(((field_identifier) @property)
+ (#has-ancestor? @property field_declaration)
+ (#not-has-ancestor? @property function_declarator))
+
(statement_identifier) @label
[