This fixes the broken 'a-f' commands when editing JS/TS/JS+flow files when Tree-Sitter parsers are enabled. I think this is because of some changes to the tree-sitter parsers. Here is some output from the tree-sitter playground.
The main thing is that function_declaration is used for function foo() {} and function is used for anonymous functions. They have even added support for arrow functions, although the a-f selection range isn't perfect when the functions are formatted in weird ways. I added tests for very simple examples, and hopefully the more complicated ones can be addressed later.
This fixes the broken 'a-f' commands when editing JS/TS/JS+flow files when Tree-Sitter parsers are enabled. I think this is because of some changes to the tree-sitter parsers. Here is some output from the tree-sitter playground.
The main thing is that
function_declaration
is used forfunction foo() {}
andfunction
is used for anonymous functions. They have even added support for arrow functions, although thea-f
selection range isn't perfect when the functions are formatted in weird ways. I added tests for very simple examples, and hopefully the more complicated ones can be addressed later.Thanks and あけましておめでとう!
Input
Output