-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grammar support for flowtype is missing #26
Comments
On holiday at the moment. I will review this when back. |
+1 |
I've just committed a grammar change ( but not published) that I think gives you flowtype on functions/fat arrows. No support for let/const/var as this need thinking about. Let me know if it creates problems? |
Strike that!! I seemed to have regressed! |
should I not update to latest version then?? |
Yes try it - When I just tested it again I was using someone else's grammar - Doh!! Now I've set it to mine it seems OK. Don't forget the published version is still the old one. You will have to pull the one from github. |
hmm.. Ok let me try |
Hey, use this file for flow-tests: https://gist.github.com/kastermester/ad79da3e48064effd82e (i'm still trying on my own code-base, will report back shortly) |
Ok, so I just tried it and it's not fixed. The colour has changed though. I don't know how grammars work, but here's the problem:
That is a valid declaration for flow. However language-babel interprets that as JSX and everything after the first
(one closing tag for each angular bracket used in the line) |
Yeah it's definitely showing as JSX. Thanks for the flow test file above. I think this is going to be pretty difficult with the current grammar. I thought that templates may be an issue. Leave it with me. |
Thanks! |
I've got a very small start towards this in this branch that only supports type annotations in argument lists. Return type annotations break things:
Should the return types be added to the
end
patterns of all the varieties of function literals or is there a better way to accomplish that without so much repetition?The text was updated successfully, but these errors were encountered: