vscode-autohotkey-NekoHelp
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
Install
- Install extension via Visual Studio Marketplace AutoHotkey NekoHelp.
- Install
.vsix from my github https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp/releases
Youtube
vsc-ahk-neko-help
- 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.
FunctionSymbol
- Detect source Function as symbol
- support continuation at Outline.
CodeSymbol
- 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
GotoDefinition
- Go to Definition (default via
F12 or Ctrl+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 or Ctrl+Click )
Find All References support
Go to References (default via Shift+F12 )
Find All References (default via Shift+Alt+F12 )
🔍 Find All References (default via Shift+F12 )
Find Ref of Function
support to find like
functionName( , call function, but does not contain like new ClassName()
"functionName" , wrapped in text, Warning, refactoring may accidentally modify such references.
some exp code
#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
Sort F-flag https://www.autohotkey.com/docs/v1/lib/Sort.htm#Options
MyVar := "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#auto
Haystack := "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
Function rename
- (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 use AhkNekoHelp.Rename.functionInStr open it [Read more]
- warn this extension not match
fn%var%() or %fn%%var%() or str = fnName case
Hover
- 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](https://raw.githubusercontent.com/CoffeeChaton/vscode-autohotkey-NekoHelp/main/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)
Diagnostic and lint
⚠️ Diagnostics/Warnings over 30 ruler
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.
*/
SignatureHelp
Not yet supported functions-used not in a line case.
[x] Signature of user-def-function youtube 4k 90-sec
[x] Signature of built-in function
[x] Signature of command
calc [] and {} , at function arguments.
ColorProvider
ColorProvider.md
IntelliSense
1. Snippets of your function
2. Completion of function variables
3. Completion of #Include
4. Completion of class
6. VBA++ with ComObjActive()
https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp/issues/69
Targeted assistance
1. ErrorLevel quick add Template and hover
{ // settings.json
"AhkNekoHelp.customize.CodeActionAddErrorLevelTemplate": [
"if ErrorLevel ;$1",
"{",
" $0",
"}",
""
]
}
https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp/issues/60
2. hover MsgBox magic number
https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp/issues/73
https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp/issues/58
3. add Gui name
ListAllFunctions
- click the button bar XXX.ahk
- list all func
Better highlight
of Legacy assignment
semantic-highlight of MyString = This is a literal string. equal sign operator (=)
__legacy_assignment
of Numbers
theme from One Dark Pro
0x and e use keyword.other.unit
other number ex 123 007B 3.14159 use constant.numeric
exp of your settings.json ReadMore of highlighting
Source code
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"
}
}
]
}
}
of ahk2exe
Quick Log Msg
default via ctrl+alt+l
// settings.json
{
"AhkNekoHelp.customize.displayLogMessage": "MsgBox % \"♥ ~ {selectText} \" {selectText} \" at \" A_ThisFunc"
}
Privacy Statement
- 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.
Credits
otherSuggest
| |