Setting launch.json up

Scripting and setups with Visual Studio Code (vscode) and AutoHotkey.
afshindavoudy
Posts: 44
Joined: 10 Jan 2024, 13:25

Setting launch.json up

Post by afshindavoudy » 27 Jan 2024, 22:38

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.]
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: Setting launch.json up

Post by thqby » 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.
afshindavoudy
Posts: 44
Joined: 10 Jan 2024, 13:25

Re: Setting launch.json up

Post by afshindavoudy » 28 Jan 2024, 12:55

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?
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: Setting launch.json up

Post by thqby » 28 Jan 2024, 22:56

This error may not be related to the settings, and some code may have this error. I don't know what your situation is?
afshindavoudy
Posts: 44
Joined: 10 Jan 2024, 13:25

Re: Setting launch.json up

Post by afshindavoudy » 28 Jan 2024, 23:13

I get the above mentioned error even on this simple one line script:

Code: Select all

:*:btw::by the way
User avatar
thqby
Posts: 560
Joined: 16 Apr 2021, 11:18
Contact:

Re: Setting launch.json up

Post by thqby » 29 Jan 2024, 03:38

In my tests, this error did not occur.

After you set launch.json, this error will not occur?
afshindavoudy
Posts: 44
Joined: 10 Jan 2024, 13:25

Re: Setting launch.json up

Post by afshindavoudy » 29 Jan 2024, 06:03

I couldn't set the launch.json up correctly to tcheck
That is what I've asked for help for!
Post Reply

Return to “Visual Studio Code”