Skip to content
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

FlowType comment syntax "flow-include" causes weird syntax highlighting #263

Closed
jokeyrhyme opened this issue Oct 11, 2016 · 4 comments
Closed
Labels

Comments

@jokeyrhyme
Copy link

I quite like FlowType, but I prefer to maintain ECMAScript-compatible syntax and instead use FlowType via its comment syntax:

Adding simple type annotations such as /* : string */ works terrifically. Everything is highlighted as expected.

However, as soon as I use the "flow-include" comment syntax, such as /* :: ... */ or /* flow-include ... */, the rest of the code in the file is highlighted incorrectly.

Here is a reduced sample of code that triggers the issue: https://gist.github.com/jokeyrhyme/4f1a7580deb9f4727bd35f0e7953291a

Here is what it looks like in my Atom:
screen shot 2016-10-11 at 13 49 39

Any ideas? Is this the appropriate forum to discuss this issue? Or is this an upstream thing?

@gandm
Copy link
Owner

gandm commented Oct 11, 2016

OK thanks for this report. I'll have to fix this but as a work around put a semi-colon at the end of the type statement.

@gandm gandm added the bug label Oct 11, 2016
@jokeyrhyme
Copy link
Author

jokeyrhyme commented Oct 11, 2016

Oh, I hadn't even noticed that all of the FlowType examples on the website use semi-colons, but my own code does not. Thanks for that. Adding in the semi-colons fixes this.

If FlowType is supposed to work without semi-colons, then this might still be worth fixing, but otherwise you could consider this user-error. Up to you. :) /shrug

@gandm gandm closed this as completed in 71302c1 Oct 13, 2016
@gandm
Copy link
Owner

gandm commented Oct 18, 2016

@jokeyrhyme flow comments without semi's should be fixed in the latest release.

@jokeyrhyme
Copy link
Author

@gandm thanks! I can confirm that this is working for me. Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants