AutoHotkey v2 intellisense for Visual studio code Topic is solved

Scripting and setups with Visual Studio Code (vscode) and AutoHotkey.
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

AutoHotkey v2 intellisense for Visual studio code

Post by AHK_user » 12 Sep 2021, 09:00

I have created the snippet file for ahk V2 for Visual Studio Code.
This is a file that is used for the autocomplete/Intellisense in Visual Studio Code.

AHK-V2-Syntax-Visual-Studio-Code

You can easily enable it by:
  • Press Ctrl+Shift+P in VSCode
  • Type "Configure User Snippets"
  • Select the language (ahk or ah2)
  • Copy the content of ah2.code-snippets in this file (normally located in C:\Users%UserName%\AppData\Roaming\Code\User\snippets
I requested in github vscode-autohotkey-plus-plus to try to create a setting to be able to switch between the languages, As I find vscode-autohotkey-plus-plus currently one of the best extensions for AHK in VSCode.

User avatar
thqby
Posts: 391
Joined: 16 Apr 2021, 11:18
Contact:

Re: AutoHotkey v2 intellisense for Visual studio code

Post by thqby » 13 Sep 2021, 10:47

for ahk v2, have you ever used this vscode plugin AutoHotKey2 Language Support

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: AutoHotkey v2 intellisense for Visual studio code

Post by AHK_user » 13 Sep 2021, 11:44

thqby wrote:
13 Sep 2021, 10:47
for ahk v2, have you ever used this vscode plugin AutoHotKey2 Language Support
Just checked it out, works even better, a pity that there is unreadable info in it.
I would love to fork it to add english documentation.
Has somebody experience in how to do this, or it it possible to change the snippet file for this extension?

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: AutoHotkey v2 intellisense for Visual studio code

Post by AHK_user » 13 Sep 2021, 13:17

I tried to create the vsix file and added it to my extensions, but it did not worked the same...

User avatar
thqby
Posts: 391
Joined: 16 Apr 2021, 11:18
Contact:

Re: AutoHotkey v2 intellisense for Visual studio code

Post by thqby » 13 Sep 2021, 19:30

This is a way to create User Snippests.
  • Press Ctrl+Shift+P in VSCode
  • Type "Configure User Snippets"
However, built-in snippets are not added in this way.
It's to generate completion items by parsing header file(ahk2.h.ahk) and snippests file(ahk2.json).

If there are files in different languages, the plug-in can provide completion items containing documents in other languages according to different locales.

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: AutoHotkey v2 intellisense for Visual studio code

Post by AHK_user » 13 Sep 2021, 23:40

Snippets can be used to automatically generate code when pressing enter. I understand how to add the User Snippets (Configure User Snippets command)

Is it also possible to add your own jsDoc documentation for the ahk functions? (ahk2.d.ahk)
This seems also very powerfull.

Then we could modify this file and add english explanations to it.
https://github.com/thqby/vscode-autohotkey2-lsp/blob/main/syntaxes/ahk2.d.ahk

AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: AutoHotkey v2 intellisense for Visual studio code  Topic is solved

Post by AHK_user » 14 Sep 2021, 13:37

:superhappy: :superhappy: :superhappy:

I translated the syntax files and gave them to the owner of the extension, It should convert soon to english.
(Translation is just made with google translate, but seems to be fine to start.)
Maybe I will use my ahk documentation scraper in the future to update them.

For those who cannot wait: here is how to modify them in your current extension:
Download the files from this post:
https://github.com/thqby/vscode-autohotkey2-lsp/issues/45

Backup and overwrite the files in the current location: C:\Users%UserName%.vscode\extensions\thqby.vscode-autohotkey2-lsp-1.0.2\syntaxes

Visual studio Code is simply amazing with this extension.

surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

Re: AutoHotkey v2 intellisense for Visual studio code

Post by surfactant » 04 Dec 2023, 00:07

I'm a Visual Studio user. Is it possible to have AHK intellisense in Visual Studio? Or I must install VSCode? Thanks!

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

Re: AutoHotkey v2 intellisense for Visual studio code

Post by boiler » 04 Dec 2023, 04:29

I have not heard of AHK support for VS, and the search below would indicate that there is none:
https://marketplace.visualstudio.com/search?term=autohotkey&target=VS&category=All%20categories&vsVersion

User avatar
thqby
Posts: 391
Joined: 16 Apr 2021, 11:18
Contact:

Re: AutoHotkey v2 intellisense for Visual studio code

Post by thqby » 04 Dec 2023, 06:40

surfactant wrote: Is it possible to have AHK intellisense in Visual Studio? Or I must install VSCode?
The extensions of Visual Studio and Visual Studio Code are not compatible.
Web version of vscode can use limited features.

surfactant
Posts: 99
Joined: 28 Jun 2019, 01:07

Re: AutoHotkey v2 intellisense for Visual studio code

Post by surfactant » 04 Dec 2023, 07:33

@boiler @thqby Let me try VSCode the web. Thank you both!

Post Reply

Return to “Visual Studio Code”