Page 1 of 1

Setting launch.json up

Posted: 27 Jan 2024, 22:38
by afshindavoudy
I am new to AHK and trying to setup the launch.json in VSCode to debug my autohotkey project.
I need launch.json to always run/debug my main AHK file (MyHotkeys.ahk) even when I am working on the other AHK files which are included in the main script.
Here is what I'vd done sofar:

Code: Select all

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "ahk2",
            "request": "launch",
            "name": "Debug AHK",
            "program": "${workspaceFolder}/MyHotkeys.ahk",
            "runtime": "C:\\Program Files\\AutoHotkey\\v2\\AutoHotkey64.exe",
            "stopOnEntry": true
        }
    ]
}

I am using theses extensions:
AutoHotkey v2 Language Support
vscode-autohotkey-debug
https: //marketplace.visualstudio.com/items?itemName=thqby.vscode-autohotkey2-lsp
https: //marketplace.visualstudio.com/items?itemName=zero-plusplus.vscode-autohotkey-debug

Appreciate any help!

[Mod edit: Moved topic from AHK v2 help.]

Re: Setting launch.json up

Posted: 28 Jan 2024, 04:25
by thqby
If you do not need a custom debugger feature, you can launch the debugger using the debug button in the editor context menu or editor title menu without setting launch.json.

Re: Setting launch.json up

Posted: 28 Jan 2024, 12:55
by afshindavoudy
thqby wrote:
28 Jan 2024, 04:25
If you do not need a custom debugger feature, you can launch the debugger using the debug button in the editor context menu or editor title menu without setting launch.json.
Thank you for the reply.
Without setting launch.json, When using the debug button, I get this error:
"An internal error has occurred in the debugger engine. Continue running the script without the debugger"
I dont know how to fix it!

btw, as I mentioned, I need to set the launch.json to always launch my main script, Even when other included scripts are focused. Is that achivable without setting launch.json?

Re: Setting launch.json up

Posted: 28 Jan 2024, 22:56
by thqby
This error may not be related to the settings, and some code may have this error. I don't know what your situation is?

Re: Setting launch.json up

Posted: 28 Jan 2024, 23:13
by afshindavoudy
I get the above mentioned error even on this simple one line script:

Code: Select all

:*:btw::by the way

Re: Setting launch.json up

Posted: 29 Jan 2024, 03:38
by thqby
In my tests, this error did not occur.

After you set launch.json, this error will not occur?

Re: Setting launch.json up

Posted: 29 Jan 2024, 06:03
by afshindavoudy
I couldn't set the launch.json up correctly to tcheck
That is what I've asked for help for!