Page 1 of 1

AutoHotkey v2 intellisense for Visual studio code

Posted: 12 Sep 2021, 09:00
by AHK_user
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.

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 13 Sep 2021, 10:47
by thqby
for ahk v2, have you ever used this vscode plugin AutoHotKey2 Language Support

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 13 Sep 2021, 11:44
by AHK_user
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?

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 13 Sep 2021, 13:17
by AHK_user
I tried to create the vsix file and added it to my extensions, but it did not worked the same...

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 13 Sep 2021, 19:30
by thqby
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.

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 13 Sep 2021, 23:40
by AHK_user
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

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

Posted: 14 Sep 2021, 13:37
by AHK_user
: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.

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 04 Dec 2023, 00:07
by surfactant
I'm a Visual Studio user. Is it possible to have AHK intellisense in Visual Studio? Or I must install VSCode? Thanks!

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 04 Dec 2023, 04:29
by boiler
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

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 04 Dec 2023, 06:40
by thqby
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.

Re: AutoHotkey v2 intellisense for Visual studio code

Posted: 04 Dec 2023, 07:33
by surfactant
@boiler @thqby Let me try VSCode the web. Thank you both!