Base of cweijan /vscode-autohotkey
Base of regexp match, not the principles of compilation, so parser inaccurate.
AutoHotkey v2 has been released and will be considered the default/main version announcement, if you need to write new ahk, I suggest you to use ahk v2 && AutoHotkey v2 Language Support, ahk v1 for me is so complicated.
AutoHotKey v1 edit-support for VS Code
- vscode-autohotkey-NekoHelp
- Install extension via Visual Studio Marketplace AutoHotkey NekoHelp.
- Install
.vsix
from my github https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp/releases
- support unicode (utf-16 Plane 0), look unicode-support
- 4K 30sec
- across files information
- SignatureHelp
- Completion
- unicode support
- (4k 90-sec)https://youtu.be/WcMzNcVWcYA
- sign of user-def param is variadic case
- sign of nested function case.
- Detect source Function as symbol
- support continuation at Outline.
- You can add two semicolon
;;
at line first. - You can see Leveled outline
- class
- function
- switch, Case, Default
- Labels, like
this_is_a_label:
- HotString, like
::ahk::
- HotKeys, like
~F12::
- directive, like
#Include
or#Warn
- Go to Definition (default via
F12
orCtrl+Click
) - open the definition to the side with (default via
Ctrl+Alt+Click
) - Peek Definition (default via
Alt+F12
) - Go to Symbol (default via
Ctrl+T
)↪ Go to Definition (default via
F12
orCtrl+Click
)
-
Go to References (default via
Shift+F12
) -
Find All References (default via
Shift+Alt+F12
)🔍 Find All References (default via
Shift+F12
)
support to find like
-
functionName(
, call function, but does not contain likenew ClassName()
-
"functionName"
, wrapped in text, Warning, refactoring may accidentally modify such references.some exp code
- also can use
fnObject := func("functionName")
[read doc of func()]fnObject := RegisterCallback("functionName")
read doc of RegisterCallback
#NoEnv #Warn All SetControlDelay, 0 ~F9:: fn_exp(["fnA","fnB"]) ~F10:: fn_exp(["fnB","fnA"]) fn_exp(fnList){ For _Key, fn in fnList { funcOnj := Func(fn) funcOnj.Call() } } fnA(){ MsgBox, % "i am fnA" } fnB(){ MsgBox, % "i am fnB" }
-
label -> function https://www.autohotkey.com/docs/v1/misc/Labels.htm#Functions
- OK SetTimer
- OK Hotkey
- OK Gui control events (g-labels)
- OK Menu
- not plan to support
Gui events such as GuiClose
-
Sort
F-flag https://www.autohotkey.com/docs/v1/lib/Sort.htm#OptionsMyVar := "5,3,7,9,1,13,999,-4" Sort, MyVar, F IntegerSort D, ; ^^^^^^^^^^^ func after F[ \t] MsgBox, % "MyVar is " MyVar IntegerSort(a1, a2) { return a1 - a2 }
-
RegEx
CallOut Functionshttps://www.autohotkey.com/docs/v1/misc/RegExCallout.htm#callout-functions
or(?CNumber:Function)
https://www.autohotkey.com/docs/v1/misc/RegExCallout.htm#autoHaystack := "The quick brown fox jumps over the lazy dog." RegExMatch(Haystack, "i)(The) (\w+)\b(?CCallOut)") ; ^^^^^^^ func in (?CFuncName) CallOut(m) { MsgBox , (LTrim C m=%m% ; m=The quick m1=%m1% ;m1=The ; m1 is Pseudo-Arrays https://www.autohotkey.com/docs/v1/misc/Arrays.htm#pseudo m2=%m2% ;m2=quick ; m2 is Pseudo-Arrays also ) return 1 }
-
not plan to support like
%func%()
Func%A_Index%()
Dynamically Calling a Function -
warn this extension not match case
var := "name" fn%var%() fn := "fn" %fn%%var%() str = fnName ; not use := && "" func(str).call() fnName(){ MsgBox % "i am fnName" }
-
read more of funcRef
- (default via
F2
) rename with your can use [🔍Find Ref of Function] to find. - check of Rename newName
- check newFnName has been defined as
function
class
label
- default not rename
"fnName"
, can useAhkNekoHelp.Rename.functionInStr
open it [Read more] - warn this extension not match
fn%var%()
or%fn%%var%()
orstr = fnName
case
- check newFnName has been defined as
- Hover to view details on variables, function, command
- Over 200 Command and Function documenting built-in
-
Hover function to show return value or comment
-
add comment of function
/** * - in /** block. * - and the line first character is '*' or ';' * - can use partial grammar of markdown. * - exp@email.com * - [Markdown Rule](https://en.wikipedia.org/wiki/Markdown) * - <https://en.wikipedia.org/wiki/Markdown> * ![Image](/D:/icon.png "icon") * ~~ABC~~ * _ABC_ _ABC_ * - - - * `monospace` */ fn(param){ ; some code }
-
add jsdoc-style comments of variable
f2(){ /** * - [markdown-syntax](https://www.markdownguide.org/basic-syntax/) * - list2 * - Love **is** bold * * style look like jsDoc * and you need write before at var first-def line */ style1 := 0 MsgBox, % style1 ; try to hover of "style1"! style2 := 1 ; i look like c++ doc style MsgBox, % style2 ; try to hover of "style2"! }
-
CLSID
hover (youtube 4K 1min)
-
warning about use
=
not:=
to assign. -
warning of Switch
Case : not find
-
use
;@ahk-neko-ignore [number] line.
to ignore,
exp:;@ahk-neko-ignore 1 line ;@ahk-neko-ignore 2 line ;@ahk-neko-ignore 999 line ;@ahk-neko-ignore-fn 1 line ;@ahk-neko-ignore-fn 2 line ;@ahk-neko-ignore-fn 999 line ;use 0 to open diag ;@ahk-neko-ignore 0 line ;@ahk-neko-ignore-fn 0 line
-
Right click then click format document.
-
or
alt
+shift
+f
-
format
switch case
-
read more exp note/ahk/format
-
other setting
; ;@ahk-neko-format-ignore-start ;@ahk-neko-format-ignore-end ;@ahk-neko-format-inline-spacing-ignore-start ;@ahk-neko-format-inline-spacing-ignore-end /*@ahk-neko-format-ignore-block ^ I think this will reduce the interference with git-diff. */
-
Not yet supported functions-used not in a line case.
-
Signature
ofuser-def-function
youtube 4k 90-sec -
Signature
ofbuilt-in function
{ // settings.json
"AhkNekoHelp.customize.CodeActionAddErrorLevelTemplate": [
"if ErrorLevel ;$1",
"{",
" $0",
"}",
""
]
}
semantic-highlight of MyString = This is a literal string.
equal sign operator (=)
theme from One Dark Pro
-
0x
ande
usekeyword.other.unit
-
other number ex
123
007B
3.14159
useconstant.numeric
-
exp of your
settings.json
ReadMore of highlighting -
settings.json
// settings.json { "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "keyword.other.unit.numeric.hexadecimal.ahk", "settings": { "foreground": "#E06C75" } }, { "scope": "keyword.other.unit.numeric.decimal.ahk", "settings": { "foreground": "#E06C75" } }, { "scope": "constant.numeric.hexadecimal.ahk", "settings": { "foreground": "#D19A66" } }, { "scope": "constant.numeric.decimal.ahk", "settings": { "foreground": "#D19A66" } } ] } }
-
feat: the
@Ahk2Exe
of;@Ahk2Exe-XXX
provide semantics as"other.customize.keyword.comment.ahk2exe.ahk"
other-style
// settings.json { "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "other.customize.keyword.comment.ahk2exe.ahk", "settings": { "foreground": "#C678DD" } } ] } }
default via ctrl+alt+l
// settings.json
{
"AhkNekoHelp.customize.displayLogMessage": "MsgBox % \"♥ ~ {selectText} \" {selectText} \" at \" A_ThisFunc"
}
- Do not upload any information.
- only use vscode provided api, not any third party dependencies, Safe and Privacy.
- just scan workspaces or open file. not auto scan any file without workspaces, until option the
"AhkNekoHelp.file.tryParserInclude"
or"AhkNekoHelp.files.alwaysIncludeFolder"
- If you need to place .ahk in other folders, this Extensions support Multi-root Workspaces or
"AhkNekoHelp.files.alwaysIncludeFolder"
-
The best way to improve startup times is to exclude unnecessary files, via settings.json
AhkNekoHelp.files.exclude
-
When editing becomes slow, split the file, via
#Include
-
via
'Refresh Resource'
to find each file parsing time.
- AutoHotkey by stef-levesque : ancestor of the series
- AutoHotkey Plus by cweijan : project start
- AutoHotkey_L-Docs : Embed documents of completion/hover etc.
- AutoHotkey_L : Refer to the implementation of the c++ function
- helsmy/AutoHotKey Simple Support : hotkey/hotstring regexp
- microsoft/TypeScript-TmLanguage :
jsdoc
syntax-highlight like the 'inline-tags', 'brackets', 'jsdoctype', 'docblock' code. - MicrosoftDocs/VBA-Docs at #69
- icon https://www.autohotkey.com/boards/viewtopic.php?t=68147