Fix incorrect node renames in the presence of extra tokens

This commit is contained in:
Max Brunsfeld 2017-07-18 21:24:34 -07:00
parent 10d28d4b56
commit f33421c53e
3 changed files with 164 additions and 102 deletions

View file

@ -33,7 +33,11 @@ static inline uint32_t ts_node__offset_row(TSNode self) {
static inline bool ts_node__is_relevant(TSNode self, bool include_anonymous) {
const Tree *tree = ts_node__tree(self);
return include_anonymous ? tree->visible : tree->visible && tree->named;
if (tree->context.rename_symbol > 0) {
return true;
} else {
return include_anonymous ? tree->visible : tree->visible && tree->named;
}
}
static inline uint32_t ts_node__relevant_child_count(TSNode self,