Came across Visual Studio Code the other day

Scripting and setups with Visual Studio Code (vscode) and AutoHotkey.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Came across Visual Studio Code the other day

Post by kczx3 » 03 Sep 2019, 12:53

I found that somebody forked the PHP Debugger extension by Felix Becker and got it to work with AHK. It can be found here - https://github.com/pgross41/vscode-php-debug/tree/ahk-conversion. It isn't published to the extension marketplace but hopefully it might be soon.

You can clone the repository and switch to the ahk-conversion branch. Then within VSCode, install the extension from VSIX and select the ahk-debug-0.0.1-development.vsix file from the repository. It didn't work super well with AHKv2a101 but seems to work better with a104.

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Came across Visual Studio Code the other day

Post by boiler » 03 Sep 2019, 20:14

@kczx3, that's good to know. Thanks.

Haswell
Posts: 90
Joined: 21 Feb 2016, 17:11

Re: Came across Visual Studio Code the other day

Post by Haswell » 19 Oct 2019, 13:00

Does anyone know how to make use of the "Output" window in VS Code?

When I run such code:
OutputDebug Hello World
I expect it appears at the panel "Output" in VS Code, but it doesn't happen.
I use third party application "DebugView" to debug AHK-scripts using OutputDebug function.
It works well but it's not so convenient because:
1. It shows outputs of all applications running (not only current ahk-script).
2. DebugView is another application (another window) and I would like to work in one IDE and watch in one place, right below the code.

I'm used to doing without Debugger (OutputDebug is enough for me).
I know some persons work on AHK debugger for VS Code and I think it will appear sooner or later inevitably because of high VS Code popularity.
But for now, we have no one :(

Image

Image
Focusing our efforts on non-productive and non-creative endeavours wastes lives as surely as war.
Jacque Fresco / The best that money can't buy

User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Came across Visual Studio Code the other day

Post by hoppfrosch » 21 Oct 2019, 23:27

Writing to the output tab should usually be done via writing to STDOUT from your application. Within AHK you write to STDOUT using FileAppend

Unfortunately there seems to be a few problems with catching stdout from VSCode .... (see for example: process.stdout.write calls don't show in the console from node2 debug sessions) - so this obviously does not work at the moment. :?

Concerning OutputDebug:

* I would recommend using DebugView++ instead of DbgView.exe - this has several advantages, for example highlighting OutputLines due to several user definable criteria (for example: Show all lines containing "ERROR" with red background ....)
* To avoid showing up messages from all running applications you should set a filter in DebugView++, which filters all messages except the ones you want to see (for example based on process name)

DaveT1
Posts: 224
Joined: 07 Oct 2014, 11:23

Re: Came across Visual Studio Code the other day

Post by DaveT1 » 24 Mar 2021, 05:22

need4speed wrote:
22 Jun 2019, 04:37
Thanks guys, I'll try that.

Edit: In fact the help files gets opened but the navigation to the selected text is missing. Only after selecting some content from the help index, then re-pressing ^2 the script works, the correct help section is displayed.
Probably Rajat's script needs an update, maybe due to help file structure changes?
Just found this thread and Rajat's code. Running now and seems to work just great straight out of the box with VS Code! Thanks for the pointers :thumbup:

Post Reply

Return to “Visual Studio Code”