Skip to content

Conversation

@mroch
Copy link
Contributor

@mroch mroch commented Aug 27, 2019

In Flow, you can call a function an explicitly specify the types for the generics. For example

function foo<A, B>(a: A, b: B): void {}

foo<string, number>("hello", 123);

This PR attempts to update vscode-language-babel to support this syntax. It's a little complicated, since the grammar is somewhat ambiguous. For example, foo < bar > (123) is a valid expression in JavaScript, but Flow interprets it as a call expression with type parameters.

Fixes #43
Similar to gandm/language-babel#527, but adds meta.method-call.*

@michaelgmcd
Copy link
Owner

Wow, this looks great. I'll take a closer look sometime before Sunday and test a few things. Excited to merge this.

@michaelgmcd michaelgmcd merged commit 305f7e2 into michaelgmcd:master Sep 10, 2019
@rattrayalex-stripe
Copy link

Awesome to see investment in community tooling like this, thank you @mroch !

@valscion
Copy link

This is amazing! Thank you all for making this happen 💞

Any chance on getting a new release out soonish? 😅

@michaelgmcd
Copy link
Owner

Released in v0.0.24. Let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flow type arguments at callsites in class bodies

4 participants