Git Product home page Git Product logo

Comments (12)

gandm avatar gandm commented on May 17, 2024

On holiday at the moment. I will review this when back.

from language-babel.

nmn avatar nmn commented on May 17, 2024

+1

from language-babel.

gandm avatar gandm commented on May 17, 2024

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?

from language-babel.

gandm avatar gandm commented on May 17, 2024

Strike that!! I seemed to have regressed!

from language-babel.

nmn avatar nmn commented on May 17, 2024

should I not update to latest version then??

from language-babel.

gandm avatar gandm commented on May 17, 2024

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.

from language-babel.

nmn avatar nmn commented on May 17, 2024

hmm.. Ok let me try

from language-babel.

nmn avatar nmn commented on May 17, 2024

Hey, use this file for flow-tests: https://gist.github.com/kastermester/ad79da3e48064effd82e
That with the React source code is probably the best test possible.

(i'm still trying on my own code-base, will report back shortly)

from language-babel.

nmn avatar nmn commented on May 17, 2024

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:

(array: Array<V>): IndexedIterable<V>;

That is a valid declaration for flow. However language-babel interprets that as JSX and everything after the first <V> becomes one colour. (kind of like the colour of text in a JSX block).
Putting this comment at the end of the line seems to fix the problem:

// </> </>

(one closing tag for each angular bracket used in the line)
Which re-inforces my guess that it is being interpreted as JSX.

from language-babel.

gandm avatar gandm commented on May 17, 2024

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.

from language-babel.

nmn avatar nmn commented on May 17, 2024

Thanks!

from language-babel.

gandm avatar gandm commented on May 17, 2024

@nmn, @vith - Just rolled out 0.11.0 with support for flowtype. See #39 and #40 for known problems.

Let me know if you have any issues.

from language-babel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.