VSCode-compatible line number output
JStack combos really well with VSCode's output panel, because it detects file paths and makes them clickable:

However, as you can see, it only takes me to the file (first line), not the correct line number in that file. This comment suggests that #lineNumber works, and sure enough, after hacking that into Callstack.itemToString(), this works perfectly:

Could this be supported by jstack somehow? I guess you'd have to re-implement Callstack.itemToString(), and also differentiate by OS (that comment suggests that the syntax for Mac is different right now, don't know about Linux).
Not sure if this should be the default behavior or configurable in some way - depends on whether or not other tools rely on the current output format I guess?
It's a nice feature to have. That definitely should not be a default behavior and should be configurable, because different IDEs may rely on different position syntax.
Something like -D JSTACK_FORMAT=<DEFAULT|VSCODE> maybe?
It might also make sense to detect the presence of the vscode externs (#if vscode) and switch the default to VSCODE in that case.
@Gama11 do you know if HaxeDevelop have a pattern for clickable file names in output panel?
I don't think FD has links inside the output panel - it does however parse the output and check for certain patterns, for instance lines that look like Haxe error messages. Those then appear in the Results panel.
https://github.com/fdorg/flashdevelop/blob/5.2.0/External/Plugins/ResultsPanel/PluginUI.cs#L657
There was a feature request here, but it was turned down: https://github.com/fdorg/flashdevelop/issues/301
Try with
-D JSTACK_FORMAT=vscode
Thanks, works great! :)
Even though this issue has been closed already, I didn't get how to implement what'd been said under https://github.com/Microsoft/vscode/issues/586#issuecomment-159401495 in order to achieve the desired output:
Where do I have to insert "
Thanks in advance for stating more clearly how (or WHERE) to implement "
It's because jstack only handles js and php targets currently. I should probably update it to at least format callstack on other targets.
So you mean for python in vscode it wouldn't work?
Given that I'd work, I'd appreciate to know step by step how to implement the aforesaid, because so far I only have <path>:<line>:<column>, but not where and how.
Thanks in advance :)
You need to copy-paste haxe.CallStack module to your project and rewrite CallStack.toString accordingly
Thanks for the tipp. Unfortunately, I don't know how to carry out what you write.
Do you mean that I need to open the SETTINGS-json-file and add a line there containing something like haxe.CallStack.toString: <path>:<line>:<column> ?
Apart from that, as I work with python scripts, I don't have a specific "project" defined nor does it involved anything with "haxe".
Well, I'd be grateful if you could illustrate more step-by-step how to implement what you mentioned. I hope it's possible for python debugging, and not only for haxe.
Oh, if you work with the python itself (not with haxe->python), then I don't know how to help you. Sorry.
Alright, thanks for your time. I hope to find some way elsewhere, but if anyone knows a solution, please post it here. Thanks in advance and cheers!