Given that I have the code below in JavaScript/Typescript:
findOne('testing', () => {
});
findLegacy('testing2', () => {
});
findOne('testing3', () => {
});
I want to match the first argument of every function call using a tree-sitter query.
Here's where I got to, it matches all arguments
(call_expression arguments: (arguments) @arguments)
How do I match only the first argument?
As a bonus challenge, can I match the first argument of functions called findOne
only?