tree-sitter-cpp icon indicating copy to clipboard operation
tree-sitter-cpp copied to clipboard

:bug: misidentified structure variable definition

Open cyw3 opened this issue 1 year ago • 0 comments

The following is a query demo to capture struct's name:

(struct_specifier
  name: (type_identifier) @target_object
)

here is a cpp demo code:

struct Student update_time;

expected:

  • It is recognized that this is a line of code that defines a variable of type struct Student update_time.
  • And can not be recognized as a struct definition Student.

bug:

  • recognized as a struct definition Student and the query capture the Student.

cyw3 avatar Jun 02 '23 09:06 cyw3