Flow-for-vscode: 0.3.0 breaks all flow functionality

Created on 20 Sep 2016  路  8Comments  路  Source: flowtype/flow-for-vscode

Upgraded extension to 0.3.0 today and it broke all flow-related functionality.

In a project that was _working with the previous version_ of this extension :

  • has a .flowconfig file,
  • //@flow at the top of files,
  • flow version 0.32.0,
  • JavaScript syntax,
  • "javascript.validate.enable" : false in settings,
  • VS Code 1.5.2
  • OSX 10.11.6

flow errors and type information are no longer displayed in the editor:

No errors in editor:
screen shot 2016-09-19 at 6 36 48 pm
Errors still appear in command line when running flow check
screen shot 2016-09-19 at 6 37 10 pm

The upgrade also broke syntax highlighting:
Before upgrade (recognizes flow types):
screen shot 2016-09-19 at 6 22 09 pm
After upgrade (default JS highlighting, breaks on flow types):
screen shot 2016-09-19 at 6 21 42 pm

Other JS-related extensions installed include ESLint and npm Intellisense.

Most helpful comment

All 8 comments

Hey @thearrow,

Can I ask which version of the extension you were using before today?

It's possible you can improve the syntax highlighting experience by switching to the Atom javascript grammar in VS Code for flow-based projects. https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-atom-grammar

There does seem to be a strange diff between what I get when I run npm run compile on master and what's published to the vscode extension marketplace, though. The diagnostic stuff works if I run the extension from a local build, but not off of the marketplace, right now.

Sorry you guys are having trouble! I'm also seeing a discrepancy between when I run the extension locally in the debugger with F5 and when I package it and install it locally. It works fine in the debugger, but the package won't even start a flow server. If I start one manually, I get errors but not other features.

I'm debugging now. I'll let you guys know what I find! Also, I'm a vscode n00b, so if you have any insight I'd love to hear it!

@ajhyndman I'm unsure of the previous version number - I was running whatever was live on the marketplace before the latest publish (just saw the 'Update' button yesterday).

Indeed, I can fix the syntax highlighting by installing the Atom JS Grammar or the Babel ES6/ES7 grammar (which the author says is actually pulled from this project).

I had some zombie flow processes running in the background, even after killing those the official version of this extension is still not showing any flow results in the editor.

Switching to your temporary version properly starts a flow server and displays results in the editor, but syntax highlighting is still broken.

Ok, I think I've figured this out.

  • I had an older version of babel-cli installed locally (6.4.5)
  • node_modules/.bin/babel is newer (6.14.0)
  • Running the compile script from vscode or from npm used the newer version
  • vsce used the older version, since that was in my path
  • The older version of babel produced bad code. Like unexplainably bad. Like what the heck bad.

I committed https://github.com/flowtype/flow-for-vscode/commit/b7999fb84f2b50f26ba6835ef42fcc0fbe265abe, ran vsce package, and then opened the .vsix extension in vscode. I added a flow error, made sure it was reported, and then moused over a bunch of things.

However, when I ran vsce publish patch, it published a 0.3.1 package with the 0.3.0 contents :(

So I tried again. Manually updated the package.json to 0.3.2, and pushed to github before running vsce publish 0.3.2. Now, when I install the package from the marketplace, I get 0.3.1

I hope the marketplace just has some weird caching issues :/

I saw that, too. Now it appears to be good, though - 0.3.2 installs properly.

With 0.3.2 I now have flow errors displaying properly, but the syntax coloring is still broken. (I'm using the Babel ES6/ES7 package for a workaround for now.)

@thearrow - Looks like syntax coloring was deleted in https://github.com/flowtype/flow-for-vscode/commit/9f5a649221de89b73f19c500c2dbcb472eedb8be by @Arilas but I lack the context for that decision. I'll create a new issue tracking syntax highlighting

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dnepro picture dnepro  路  5Comments

booboothefool picture booboothefool  路  4Comments

peterschussheim picture peterschussheim  路  5Comments

wbinnssmith picture wbinnssmith  路  5Comments

thymikee picture thymikee  路  6Comments