Flow-for-vscode: Is there any way at all to correctly highlight Flow in VSCode?

Created on 12 Dec 2017  路  2Comments  路  Source: flowtype/flow-for-vscode

First of all, thanks for providing this extension, it's really helped me a lot in my daily work.

There are problems with regards to syntax highlighting, as you are aware of. I know that this extension does not provide syntax highlighting, but it's not clear to me which extension, if any, that correctly highlights the simple snippet below. This is surprising to me, since VSCode (and Flow) has so many users today.

I've tried the following extensions (one at a time, making sure to avoid conflicts):

  • Sublime Babel
  • Latest TypeScript and JavaScript Grammar
  • JavaScript Atom Grammar

I have a file open with the following content:

/* @flow */
for (const foo: Foo of foos) {}

The result is:

screen shot 2017-12-12 at 11 23 08

As you can see, I have not defined the Foo type at all, but Flow for VSCode doesn't indicate a problem with that. On top of that, the of keyword has been highlighted incorrectly. When I mouseover of, nothing pops up.

This is just a basic example, in my actual code (which I can't show) the highlighter completely breaks down on this piece of code and everything below it is incorrectly highlighted in various ways.

Most helpful comment

@denizdogan Use babel javascript plugin (mgmcdermott.vscode-language-babel) for correct flow highlighting

All 2 comments

At the core, https://github.com/flowtype/flow-for-vscode/issues/187#issuecomment-346872848 is the answer for this request

@denizdogan Use babel javascript plugin (mgmcdermott.vscode-language-babel) for correct flow highlighting

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FezVrasta picture FezVrasta  路  5Comments

micmro picture micmro  路  4Comments

jpokrzyk picture jpokrzyk  路  6Comments

ajhyndman picture ajhyndman  路  4Comments

dnepro picture dnepro  路  5Comments