CoffeeChaton / vscode-autohotkey-NekoHelp

autoHotkey-1.1 IntelliSense, format, linters, in vscode https://marketplace.visualstudio.com/items?itemName=cat1122.vscode-autohotkey-neko-help
GNU Lesser General Public License v3.0
17 stars 0 forks source link

[Feat] `ErrorLevel`++ auto find may value #60

Closed CoffeeChaton closed 5 months ago

CoffeeChaton commented 5 months ago

Feat Provide

šŸ”Ž Search keywords

https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp?tab=readme-ov-file#hover

ErrorLevel

šŸ’» Exp Code

; https://www.autohotkey.com/docs/v1/lib/ClipWait.htm#ExBasic
Clipboard := "" ; Empty the clipboard
Send, ^c
ClipWait, 2
if ErrorLevel ; <---------trt to hover it 
{
    MsgBox, The attempt to copy text onto the clipboard failed.
    return
}
MsgBox, clipboard = %Clipboard%
return

Additional context

auto find

image

Find the most likely command that may set ErrorLevel.

not support may set ErrorLevel function and event now.

// not support
// ['DllCall()', '0, -1, -2, -3, -4, n, An'],
// ['RegExMatch()', '0, string, -n'],
// ['RegExReplace()', '0, string, -n'],

// ['Gui: GuiSize event', '0, 1, 2'],
// ['Gui: GuiDropFiles event', '0, n'],

// ['Gui control: Link click event', 'string'],
// ['Gui control: Custom event', '0, n'],
// ['Gui control: ListView item change event', 'subset of "SsFfCc"'],

// ['WinSet Style/ExStyle/Region', '0, 1'], // ?

list

image If it's not what you want, scroll down, I've copied the list into it

CoffeeChaton commented 5 months ago

errCA

// settings.json
{
    "AhkNekoHelp.customize.CodeActionAddErrorLevelTemplate": [
        "if ErrorLevel ;$1",
        "{",
        "    $0",
        "}",
        ""
    ]
}

$1 is ErrorLevel values $0 is the last position of the mouse.