You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried these changes locally and for what I need it does work. But I wanted to run it by here before just throwing up a PR. Currently, both function and anonymous function define the actual body as:
What this means is that a TS query will not include the brackets as part of the "function body". Conceptually this makes sense, they're just a syntatic choice. However, I'd like to be able to use https://github.com/Wansmer/treesj to split/join the function body, i.e.
fn(){tod|o}// -> press splitfn(){tod|o}// and join returns to the top pattern
I think because the brackets aren't included, it doesn't know how to parse the actual function body in a way that works with split/join.
What I've changed locally (that seems to work) is to update function and anonymous_function to use
That makes senes to me. Other similar languages like Rust use a block node for function bodies. We could consider removing the alias as well - it's already easy to pattern match in a query since it's in the body field.
Hello!
I've tried these changes locally and for what I need it does work. But I wanted to run it by here before just throwing up a PR. Currently, both function and anonymous function define the actual body as:
What this means is that a TS query will not include the brackets as part of the "function body". Conceptually this makes sense, they're just a syntatic choice. However, I'd like to be able to use https://github.com/Wansmer/treesj to split/join the function body, i.e.
I think because the brackets aren't included, it doesn't know how to parse the actual function body in a way that works with split/join.
What I've changed locally (that seems to work) is to update function and anonymous_function to use
instead.
Just curious, does this make sense? If so, I can put up a PR.
The text was updated successfully, but these errors were encountered: