Temporarily use another target than JS in order to debug Haxe in IntelliJ - Opinions / Ideas?

I’m not a fan of Chrome developer tools. They’re no match for an IDE. So, I’m thinking to target Flash (since debugging works there) while I’m doing the heaviest development of my game. The only problem is what to do with UI-related things. I’m thinking to mock some UI in Flash. It’s good to have a complete separation between the game client and the game logic anyway, so this is after all good architecture.

What are your thoughts on this?

I would rather stick to tracing than using multiple targets simply for the sake of debugging, and debugging source mapped code in Chrome ain’t that bad IMO. Exactly what do you feel is missing?

But you can debug in VSCode with the chrome debug extension: GitHub - microsoft/vscode-chrome-debug: Debug your JavaScript code running in Google Chrome from VS Code..
Just make sure you compile with ‘-debug’ and ’ -D source-map’.

1 Like

You don’t need an explicit -D source-map, -debug on JS should always generate a source map. That define exists mostly for the PHP target afaik.

1 Like

@Leo Oh, I didn’t mean to struggle throughout the project with this :). Just create a very simple target UI to have when doing HEAVY debugging (complex, hard to find issues that may arise and especially now when architecting the project and need to adapt to an ever-changing architecture).

The UI is not where most work will happen yet, so I can afford a very cheap & simple Flash prototype, mocking the main functionality. My game is almost 90% logic with little UI and having the power of an IDE when debugging the beast will be very handy compared to the time spent mocking some UI in Flash (which I already did).

Maintaining 2 targets is far from what I was thinking :slight_smile:. So, thanks for the suggestion. That’ll come in handy when I focus on the final UI. Then, Visual Studio will come in really handy (hoping they support debugging in VS Community, since I already have that installed).

As per your question, here are some of the MAJOR things I’m missing in Chrome developer tools:

  • ctrl+click navigation to types
  • speed - an IDE is much, much faster and convenient when doing any sort of navigation; by comparison the windows of the developer tools are sluggish to say the least.
  • a proper, large screen, tabbed environment to switch between those files
  • hotkeys (not as reliable and easy to use as a full-fledged IDE)
  • syntax coloring & type hinting

This is just the major stuff that comes to mind :slight_smile:

VSCode is not Visual Studio. I really like IDEA, but I feel VSCode has a lot better Haxe support nowadays, and that should give you the features that you feel Chrome lacks when it comes to debugging.

1 Like

@Leo I know VSCode is not Visual Studio :), that’s why I said I hope that Chrome debugging works in Visual Studio, because I prefer using that over VSCode.

However, reading that it has better Haxe support than IntelliJ is a big thing coming from you :slight_smile:. I might try it eventually. For now, I’m fed up with all the logistics I did these days. Time for coding :smiley:

VSCode has really good js debugging support built-in. I’m not sure about source-maps though, I always had a problem setting them up, but I just prefer to see the js output anyways.

In this case, I think resistance is unproductive, just use the best tool for the job. Heck, if needed, keep VSCode open and use it for debugging purposes and IDEA for your editing needs.

1 Like

For IntelliJ IDEA, you can (currently) either use hxcpp or flash targets for direct Haxe source debugging. If you don’t mind debugging in the target language, IDEA (and/or it’s other language-specific siblings, such as PyCharm or WebStorm) can also debug most of the other targets – including JS.

Visual Studio used to be able to debug hxcpp targets, too. I’m not sure whether it has been kept current.

-Eric

1 Like