Visual Studio Code Support

Discuss other useful utilities, general computing tips & tricks, Internet resources, etc.
haichen
Posts: 116
Joined: 09 Feb 2014, 08:24

Visual Studio Code Support

31 Dec 2015, 07:13

After the nice work with Atom, i thought it would be also nice to run AutoHotkey from Visual Studio Code. I found an extension for syntax highlighting and here is how i got it working:

In VSC type
1. strg+p
2. ?
3. klick ext install
4. type autohotkey

klick on install

After restart of VSC it says there is an issue with this extension.
But nevertheless i could get it working by downloading the extension from
https://github.com/stef-levesque/vscode ... master.zip
Then i copied the files in the zip in the VSC extension dir:
C:\Users\user\.vscode\extensions\slevesque.vscode-autohotkey-0.0.1
After a restart i got the syntaxhiglighting.

At second i wanted to run a script from VSC. After searching i tried the extension "Runner" from
Yasuhiro Matsumoto

As above type
1. STRG+P
2. ?
3. klick ext install
4. type runner

klick on install

After this you have to open the menu File>Preferences>User Settings.
This menu shows the Default Settings at the left and the file settings.json at the right where you have to copy

Code: [Select all] [Download] GeSHi © Codebox Plus

{
"runner.languageMap": {"autohotkey": "C:/Program Files/AutoHotkey/autohotkey.exe"},
"runner.extensionMap": {"ahk": "autohotkey"},
}


After saving try to run (STRG+SHIFT+R) a test.ahk with



You get the text in an ouput column in VSC.
Zeb

Re: Visual Studio Code Support

28 Sep 2016, 05:40

Even tho this Post is probably too old to hope for a reply but I can't get it to execute my scripts. It says "autohotkey" was either wrong written or couldn't be found.
haichen
Posts: 116
Joined: 09 Feb 2014, 08:24

Re: Visual Studio Code Support

30 Sep 2016, 02:51

I saw it yesterday. Meanwhile I've a new pc. So I had to to install VSC and try my own Tip. But it also didn't work for me and until now I found no solution. Sorry!
Zeb

Re: Visual Studio Code Support

25 Oct 2016, 08:54

Well after checking the source-code of the extension and not finding anything suspicious... I simply tried out the fullpath for the autohotkey.exe plus double-double-quotes, which does the job.
Seems kind-of stupid but I don't care as long as it works that way.

Code: [Select all] [Download] GeSHi © Codebox Plus

{
"runner.languageMap": {"autohotkey": "C:/Program Files/AutoHotkey/autohotkey.exe"},
"runner.extensionMap": {"ahk": ""C:/Program Files/AutoHotkey/autohotkey.exe""},
}
haichen
Posts: 116
Joined: 09 Feb 2014, 08:24

Re: Visual Studio Code Support

25 Oct 2016, 11:59

oh wow, very strange! Thank you very much for finding this!!
momo2000
Posts: 28
Joined: 25 Jan 2015, 12:00

Re: Visual Studio Code Support

11 Nov 2016, 08:44

Trying to get VSC working with AHK as well. Syntax highlighting works, but the Run/debug feature does not. I followed the steps above (and put those two lines in the settings.json file) but not working. When I got to run/debug, I get the error "Cannot find runtime 'node' on PATH." Any ideas?
mh1723
Posts: 1
Joined: 08 Jan 2017, 21:47

Re: Visual Studio Code Support

08 Jan 2017, 22:03

I am very new to all this but very interested in also setting it up. Every time I have come across a not found in PATH type issue it stems from not having one file or another properly set in the system environmental variables. From the System window or right click start button->system->advanced system settings->Environment Variables. Include the paths for everything AHK related.

At times I have had to go down a few levels in a directory and select another folder in order for it to pick it up correctly.

Return to “Other Utilities & Resources”

Who is online

Users browsing this forum: No registered users and 1 guest