Visual Studio Code setup


I’ve successfully used Haxe in the past, although I was working on mac and using Atom. I’ve now moved to PC, and would prefer to use VSC.

I’ve installed Haxe fine, but… I can’t build out of VSC, it looks like it works but nothing happens.

I’ve also tried the command line (openfl test ) I can build a flash version but not an HTML5.

I’m sure this is a basic setup issue, but I can’t seem to fix it - can anyone advise?



I’m assuming you’re using the Lime extension?

One thing you could try is the "haxe.enableCompilationServer": false - that can currently cause issues with some Firewall configurations, but should be fixed in the next release of the Haxe extension.

However, if openfl test html5 is already not working from the command line, this is unlikely to be a VSCode-specific problem.

Thanks @Gama11

I am using the Lime extension.

I tried adding the enablecompilationserver to bother the user & workspace settings but no change.

As Flash builds from the command line there’s obviously something wrong with HTML5 - i get this error:
Error: EINVAL, invalid argument
at new Socket (net.js:156:18)
at process.stdin (node.js:664:19)
at Object. (C:\HaxeToolkit\haxe\lib\lime\6,2,0\templates\bin\node\http-server\bin\http-server:161:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

Are you building through Bash on Windows by chance? Googling the error message, that comes up a lot as a possible cause:

Thanks - seem to have got it working now - not sure what was wrong…

But, what I can’t work out, is there a way of making VSC open the html5 build in a browser or open the flash SWF etc. after it’s built?

Yes, just run the lime test instead of the lime build tasks (same as on the command line).

Thanks @Gama11 you’ve got this ball rolling again.

I think that some of the difficulties were in how I remember Atom working and how VSCode works. The rest was just how poor my memory is.