Flow-for-vscode: Windows support

Created on 2 Aug 2016  路  14Comments  路  Source: flowtype/flow-for-vscode

Flow now supported on Windows.
But flow-for-vscode seems not working. vscode presents no errors in incorrect code.
I have .flowconfig and //@flow comments.
_flow check_ command works and finds errors.

Most helpful comment

PR Created.

All 14 comments

I would like to take a stab at fixing this. Hope to send a PR soon.

Actually, scratch that. I won't get around to it in the coming weeks. Sorry!

I have not found the fix yet but it is related to the fact that spawn errors out on windows if everything is not JUST perfect. So if someone were to spend some time coaxing the node and flow checks to work and anywhere else that uses spawn this might just work.

To add to that flow seems to also use spawn. This is causing crashes on my windows 10 machine. I dug up how React Native handles spawn for windows and started working through the places in this repo but it likely is becoming more complicated since it seems flow itself is actually crashing as well.

@rmevans9 can you try replacing spawn with cross-spawn?

Yeah, I will give that a shot tonight. I believe that the problem with Flow will still exist but this might overcome the issues in this extension then a PR to flow might be able to resolve it over there.

I got it working! @kumarharsh cross-spawn did the trick. After playing with it for a few minutes I realized my earlier comment about flow also breaking was incorrect as the break was occurring in a different file within this repository. The following changes were made to make things seemingly work (more testing needed):

/lib/utils/util.js -> replace "import {spawn} from 'child_process';" with "import spawn from 'cross-spawn'"
/lib/pkg/commons-node/process.js -> import cross spawn then replace all occurances of "child_process.spawn" with just "spawn"

I am not sure if the files in pkg are shared throughout different Facebook repositories so I am not sure of the safety of changing it in this repository but those changes alone got Flow telling me about the errors I had setup to test the extension.

wow, that's a really encouraging sign. can you prepare a PR, and I might also give it a run on my machine.

I will be in the next few days. I want to make sure my changes are solid before PRing it up.

may i just add, that i'm really excited for this. Also idk if you all are aware, but the lastest windows update brings the linux subsystem. Would using that be helpful , maybe your already using it?

I've tried using flow on linux subsystem, but sadly the flow server keeps crashing after parsing my code. Also, currently there is no way for the programs running within the ubuntu bash to communicate with windows apps.

PR Created.

@quincycs this is not using the linux subsystem. Just uses the fact that Flow now officially supports windows.

Your the best!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thymikee picture thymikee  路  6Comments

FezVrasta picture FezVrasta  路  5Comments

ianwalter picture ianwalter  路  5Comments

spudly picture spudly  路  6Comments

dominictwlee picture dominictwlee  路  5Comments