The minimal code snippet that can reproduce this bug is:
final a = StateProvider<T1234567> // Complete expression is: final a = StateProvider<T1234567>();
Running tree-sitter parse <path/to/above/example.dart> will cause an infinite loop. Strangely if the length of argument type name is less than 7(i.e. StateProvider<T123456>), this issue doesn't happen.
I tried to play around the grammar.js to locate the issue, and it looks it's related this rule in postfix_expression:
_postfix_expression: $ => choice(
// Commenting out the rule below will resolve this issue
seq(
$._primary,
repeat(
$.selector
)
),
$.postfix_expression
),
Any idea why this expression matches the postfix expression and causes the infinite loop? Thanks!
Probably facing same issue while using this parser within Neovim, some nvim-cmp suggestions straight up freezes neovim, and pins one of my cores to 100%
The minimal code snippet that can reproduce this bug is:
Running
tree-sitter parse <path/to/above/example.dart>
will cause an infinite loop. Strangely if the length of argument type name is less than 7(i.e.StateProvider<T123456>
), this issue doesn't happen.I tried to play around the grammar.js to locate the issue, and it looks it's related this rule in postfix_expression:
Any idea why this expression matches the postfix expression and causes the infinite loop? Thanks!