euclidianAce / ltreesitter

Standalone tree sitter bindings for the Lua language
MIT License
85 stars 4 forks source link

query:capture has a bug: returns wrong capture @name #7

Closed geert56 closed 2 years ago

geert56 commented 2 years ago

In file ltreesitter/csrc/query.c on line 295 name is incorrectly calculated. The correct line should read: const char *name = ts_query_capture_name_for_id(q->query, m.captures[capture_index].index, &len);

euclidianAce commented 2 years ago

Thanks for reporting! I've fixed the line and added a test for this.