ast-types icon indicating copy to clipboard operation
ast-types copied to clipboard

Support type arguments in CallExpression

Open goodmind opened this issue 6 years ago • 8 comments

Is it possible to add to both flow and typescript?

goodmind avatar May 17 '19 12:05 goodmind

Can you give an example of what you'd like to be able to do?

benjamn avatar May 21 '19 14:05 benjamn

Build CallExpression ast with type arguments foo<string>('baz')

goodmind avatar May 21 '19 15:05 goodmind

@benjamn any idea?

goodmind avatar Jun 06 '19 05:06 goodmind

This issue prevents type parameters identifiers from being found (e.g. using jscodeshift's .find(Identifier)) when they are attached to CallExpressions or NewExpressions. It also results in typeParameters not being present on the type definitions for CallExpression and NewExpression, even though they are there at runtime.

jgoz avatar Oct 16 '20 17:10 jgoz

just bumped into this issue as well, basically it was impossible to get root.find(jscodeshift.TSTypeParameterInstantiation) to select Foo in runFoo<Foo>()

shogunsea avatar Jun 29 '23 22:06 shogunsea

I'm also hitting this issue. @shogunsea did you find a workaround?

mikepink avatar Nov 17 '23 20:11 mikepink

@mikepink no I didn't, ended up treating those cases like edge cases I had to manually fix

shogunsea avatar Nov 19 '23 20:11 shogunsea