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.
This commit is contained in:
John Drouhard 2020-11-19 09:50:47 -06:00 committed by Stephan Seitz
parent d2b8b49ce5
commit 33ffdce690
2 changed files with 11 additions and 0 deletions

View file

@ -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
[

View file

@ -27,6 +27,12 @@
(field_identifier) @method)) @_parent
(#has-parent? @_parent template_method function_declarator call_expression))
(field_initializer
(field_identifier) @property)
(function_declarator
declarator: (field_identifier) @method)
(template_function
name: (scoped_identifier
name: (identifier) @function))