VSCode with Debugger for Chrome
-
Hi,
I am just setting up everything to get started with haxeflixel and settled for vscode.
My question is: has anyone set up Debugger for Chrome to work with the "lime test html5 -debug" command that is outputed by the build command?It seem that this should be possible and would imo greatly improve the integrated feel of developing with haxeflixel.
Are there roadblocks that I am not aware of for doing this?
-
No, this is indeed possible. In fact, I've just released flixel-templates 2.5.2 with a HTML5 launch config and updated our Visual Studio Code guide with a "HTML5 Debugging" section:
https://haxeflixel.com/documentation/visual-studio-code/
Hope that helps! :)
-
Awesome!
I just couldn't breakpoint in my create function but in update it worked fine. Do you know the reason for this?
Many thanks!
-
@gama11 Have you tried the hashlink debugging?
https://github.com/vshaxe/hashlink-debuggerIf this works it feels like a better choice than neko. Or?
-
I just couldn't breakpoint in my create function but in update it worked fine. Do you know the reason for this?
Hm, maybe
create()
happens too quickly / before the debugger is actually connected. Does it work in thecreate()
of another state that doesn't execute immediately / you switch to at some later point?From its description, it seems that setting the launch config's
breakOnLoad
property totrue
may help:If this works it feels like a better choice than neko. Or?
Indeed, HashLink has many advantages over Neko - better performance, native C compilation, it's still in active development, debugging... We first need Lime to support HashLink before we can take advantage of that though:
-
@gama11
Excellent. Adding break on load solved the problem. Your template should probably have that too.I guess we first have to get Lime to work on haxe 4 first. I got lots of errors when trying to compile some very simple code from the "Discover HaxeFlixel" book using preview 3.
-
@AllNamesRTaken Maybe, I'm a bit concerned about the performance implications
breakOnLoad
might have (mentioned in the docs in my screenshot).Lime works fine with Haxe 4 preview 3. Latest Haxe 4 dev introduced some very minor compiler errors in OpenFL 3.6.1 and Flixel 4.3.0 due to a bugfix, but that'll be fixed in OpenFL 8 and Flixel 4.4.0.