Giter Club home page Giter Club logo

autohotkey-plus's People

Contributors

afspeirs avatar benny779 avatar bhughes339 avatar catfist avatar cweijan avatar denolfe avatar fade2gray avatar hicsy avatar mark-wiemer avatar oiss avatar stef-levesque avatar tmplinshi avatar usernamehw avatar zero-plusplus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autohotkey-plus's Issues

Enhancement: Region-folding

Gday

PR:

My pull-request with the solution can be found here: #43

Proposal:

Other languages generally have regions folding marked by a comment which starts with the work region .
This will then be folded up until the corresponding comment beginning with endregion.

I understand that this might already be implemented elsewhere in your code that i missed, or perhaps it has been left out for a reason (stale request upstream, awaiting official input, awaiting v2 etc etc).
Feel free to ping me if you need any further clarification.

I have provided examples in the Pull Request.

Cheers

Strange indent

I copyed some example from ahk's doc and wrote a little bit of myself. After formating, it was like this.
Snipaste_2020-03-30_13-24-32

I think it is natural that the #IfWinActive in line 11 at the same position as line 7, ::btw:: in line 10 at the same position as line 9 and #c:: in line 12 alse at the same position as line 7.

Showing additional information about objects

Is it possible to show more relevant information about objects?
Try to debug this code for example:

for procData in ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_Process WHERE name = 'explorer.exe'")
{
	cmd := procData.CommandLine
	OutputDebug cmd: %cmd%
}

Expected: commandLine value as well as all the fields from the link below are shown in a list of variables of the procData variable:
https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-process

Actual: four items are shown (Value, VarType, DispatchType, DispatchIID).

005

Formatter adds indentation on "for" even if just a string

Found:

try to format this:

InputBox, name, for bla
if somthing
    Return

it will turn to:

InputBox, name, for bla
    if somthing ; << indentation added!
    Return

Expected:

There is actually no change expected.
It seems to be triggered on the for keyword!

Debugger not working/not setup?

Version: 1.48.0-insider (system setup)
Commit: 731f9c25632dbbf01ee3a7892ad9d2791fe0260c
Date: 2020-07-24T05:57:10.466Z
Electron: 9.1.0
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.17134

AutoHotkey Plus 2.4.14

First time using your extension, so I'm not sure if this is an issue or I didn't set it up right. I can Run/Compile the script from the context menu, but debugging doesn't seem to work. I'm not sure if I needed a separate debugger, but I figured it would have been mentioned somewhere.
vdsvahk

Double colon syntax highlighting bug

Hello,

There is this undesired behavior where everything before a double colon is recognized as a hotkey even if the double colon is inside a string. This messes up the syntax highlighting.

image

The 3rd line is just a demonstration of how it's supposed to look.

Extra indentations on empty lines

So, I use the extension 'Indent-Rainbow' and to me it reveals that the formatter is generating unnecessary indentations.
I checked against powershell and python and both their formatters seem to scrub empty lines.

Autohotkey:

image


Format on save:

image

Powershell:

image

Go to definition bug and Outline bug

Hi, when I select a function name and click on Go to definition, for some reason it's going to the same function defined in a different file altogether instead of going to the function definition in the same file.
Also, for some reason not all the functions defined are shown in the outline sidebar, if this can be fixed it would be great.
In my script I have function definition, labels, hotkeys all mixed and are not put in any sequence, if that causing this outline issue?

Also, in Outline, all the variable and stuff is also shown, if outline can be only for the functions that would be great!

Thanks for your effort!

Invalid Path

Apparently it doesn't work using AHk version 1.1.32.00, I did a clean installation of Windows 10 + AHK 1.1.32 + VSCODE and its extension and after trying to do a hello world it is observed that it does not recognize the default interpreter.

Invalid_path

The path is valid, I check and I configure follow the instructions.

Close subroutine scope with ExitApp, same as return?

For denoting the end of a subroutine the return keyword prevents further indentation while the same is not true for ExitApp.
This causes lines beneath to indent as if it is part of the same subroutine and also has some weirdness with comment blocks.
You can add a return below to prevent the issue but that seems redundant.

tpYTPNvi8Z

Edit: Weirdly, the return statements within functions seem to lose indentation. I'll make a new issue if need be but it seems relevant. Looking into it, this seems to occur beneath any multi-line label, hotkeys, and hotstring perhaps due to the open colon : syntax?

ujvQuwNX2Y

Sample: The same issue doesn't occur with ExitApp or the single line hotkey f1::send, foo

; Uncommenting any has the same effect for me

; :::fdate:: ; 2015-12-31 (for file or folder names)
;     FormatTime, DateString,, HH-mm-ss
;     send, % DateString
; Return

; f1::
; send, foo
; return

; label:
; msgbox, test mesage
; return

testFunction2() {
    msgbox, "I'm a test function!"
    return
}

testFunction() {
    msgbox, "I'm a test function!"
    ExitApp
}

Failed to inspect instance of class in "demo_for_ahk_v2"

By Google Translate from Japanese to English.

The conditions are as follows.

  1. Start debugging demo_for_ahk_v2
  2. Expand the Global list.
  3. Break at the line after instance: = new Cls()

Then the following error message is displayed.
Command failed: "C:\Program Files\AutoHotkey\v2-alpha\x64\AutoHotkey.exe" /debug=localhost:9001 "W:\project\vscode-autohotkey/demos/demo_for_ahk_v2.ahk"

运行路径的问题

抱歉,我也遇到了运行路径的问题
我的项目路径为:

  • ../opensourceproject
    • ahk-project
      • main.ahk
      • second.ahk

second.ahk is included by main.ahk. The content of main.ahk is as follows:

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#Include, second.ahk

MsgBox, Hello

点击 Run 按钮,报错如下:
E:\OpenSourseProject\ahk-project\main.ahk (6) : ==> #Include file "e:\OpenSourseProject\second.ahk" cannot be opened.
但是在文件夹里双击 main.ahk 是可以正常运行的。
把 include 的内容改成 %A_ScriptDir%/second.ahk 的话点击 Run 才能正常运行,请问我是有哪一步做错了吗?

我打开项目的方式是:
打开 ../opensourceproject/ahk-project/ 路径,右键文件夹空白处,选择 通过 code 打开

谢谢大佬的插件!!!

It doesn't go to definition of a function with an negative optional parameter

Thanks for this great project, I use it with pleasure!

I have the following function:

RandomSleep(timez:=300, rand:=-1) { 
  ; some code here
}

If I call this function anywhere in the code and try to go to its definition with F12 or Ctrl + Click, it doesn't work. It say that definition is not found.

If I remove the - character from rand it works. This works:

RandomSleep(timez:=300, rand:=1)

Very strange.

And for this one I cannot get Go To Definition work even if I remove both - from the definition:

DeltaTickS(FirstTick:= -1, SecondTick:= -1){
    if (FirstTick = -1)
        FirstTick:= A_TickCount
    if (SecondTick = -1)
        SecondTick:= A_TickCount
    return ((FirstTick - SecondTick) // 1000)
}

Creating an empty DeltaTicksS() { } works though. Even highlighting the definition of my original function and pressing F12 takes to this new empty function.

GoTo Definition and Find References also find them in unrelated files

The GoTo Definition and Find References searches in all files in a folder and not only in the included files.
In my case the GoTo Definition shows the "wrong" function, I assume, because it finds this not included files first in the folder which happend to contain a function with the exact same name.

Go to symbol in workspace doesnt work

Hi,
Go to definition works ok with multiple included files but i cant go to a function/symbol in other files. "Go to symbol in editor" works ok. For example;

---- main script
| #include funcs.ahk
| ...

---funcs.ahk
| foo() { ... }
|

I cant quickly go to foo() definition when im at the main script. Isnt this what "go to symbol in workspace" for.

Thanks.

Running script with #include statements does not find included files

Hi,
for a couple of weeks now - looks like since one of the latest updates in May or June 2020 - I cannot run my AHK script anymore using VSC and the "Run" feature. My AHK script uses #include statements. The error in the debug console looks like:

#Include file "..." cannot be opened.

Using AutoHotKey directly on the script by right click and Run Script it works.

Thanks for sime ideas, what I'm doing wrong.

The contents of array are displayed incorrectly

vscode 1.51.1 / vscode-autohotkey 2.60 / ahk 1.1.33.02

#Requires AutoHotkey 1.1.33+

#Warn All
#SingleInstance Force
#NoEnv

SetWorkingDir %A_ScriptDir%
SetBatchLines -1

array := {}

; --- Something strange
; array[99] := "some value"
; array[100] := "now see debugger"

; Debugger show:
; ...
; array: Array(100) <-- ? incorrect array size ?
; [99]: some value
; [100]: now see debugger
; ...

; --- Something strange
array[100] := "some value"
array[101] := "now see debugger"

; Now debugger show:
; ...
; array: Array(101)
; [0..99]
;    [1]: some value
;    [2]: now see debugger
; [100..100]
; ...

Hover tip is not displayed

VS Code Version: 1.54.3 (user setup)
OS: Windows_NT x64 10.0.19042
AHK Version: 1.1.33.06

When hovering any method call or command the hover tip is not displayed.

Apparently, there is something related to the tryGetSnippetHover function. If the MarkdownString constructor is called with an empty string as initial value, rather than null, the hover tip works as expected.

Extension Host Log messages
[2021-03-18 13:16:40.856] [exthost] [error] [cweijan.vscode-autohotkey-plus] provider FAILED
[2021-03-18 13:16:40.856] [exthost] [error] Error: Illegal argument: value
	at Object.k [as illegalArgument] (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:5:1232)
	at new C (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:60:18047)
	at new s (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:81:27213)
	at new s (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:81:11705)
	at AhkHoverProvider.tryGetSnippetHover (c:\Users\joels\.vscode\extensions\cweijan.vscode-autohotkey-plus-2.6.2\out\providers\ahkHoverProvider.js:46:29)
	at AhkHoverProvider.<anonymous> (c:\Users\joels\.vscode\extensions\cweijan.vscode-autohotkey-plus-2.6.2\out\providers\ahkHoverProvider.js:24:39)
	at Generator.next (<anonymous>)
	at c:\Users\joels\.vscode\extensions\cweijan.vscode-autohotkey-plus-2.6.2\out\providers\ahkHoverProvider.js:8:71
	at new Promise (<anonymous>)
	at __awaiter (c:\Users\joels\.vscode\extensions\cweijan.vscode-autohotkey-plus-2.6.2\out\providers\ahkHoverProvider.js:4:12)
	at AhkHoverProvider.provideHover (c:\Users\joels\.vscode\extensions\cweijan.vscode-autohotkey-plus-2.6.2\out\providers\ahkHoverProvider.js:22:16)
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:156761
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:7538
	at new Promise (<anonymous>)
	at Object.g [as asPromise] (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:7510)
	at n.provideHover (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:156732)
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:179262
	at Se._withAdapter (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:176060)
	at Se.$provideHover (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:87:179238)
	at c._doInvokeHandler (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:10509)
	at c._invokeHandler (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:10201)
	at c._receiveRequest (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:8820)
	at c._receiveOneMessage (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:7673)
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:5782
	at g.fire (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
	at p.fire (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:15443)
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:106:29119
	at g.fire (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
	at p.fire (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:15443)
	at t._receiveMessage (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:20693)
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:17587
	at g.fire (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
	at l.acceptChunk (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:12808)
	at c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:12156
	at Socket.E (c:\Users\joels\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:106:12375)
	at Socket.emit (events.js:315:20)
	at addChunk (_stream_readable.js:295:12)
	at readableAddChunk (_stream_readable.js:271:9)
	at Socket.Readable.push (_stream_readable.js:212:10)
	at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

outline中文标签函数支持

兄弟你写的插件很棒,能否增加outline里对中文的标签和函数支持,还有热键的支持
能否设置run ahk script 前先保存文件再运行,辛苦了

Debugger not working

Hi, love your extension, I've been using it for a couple of days.

Today, I could not debug my ahk scripts any longer.
Pls see attached screenshot - debugger is no longer showing vars or stopping at breakpoints.

https://i.imgur.com/DWfXn5T.png

Tried reinstalling VSCode, deleting extensions folders, reinstalling them.

debug doesn't work in OneDrive

This is a curious issue. I discovered that breakpoints aren't being obeyed on source files that are added to a OneDrive folder in Explorer. This took a while to discover the culprit!

If I simply drag that file out of the folder and into a non-OneDrive folder... magic. Breakpoints break as they should.

CodeFormat doesn't follow indent setting.

Setting the indent for AutoHotkey files to anything else than 4 spaces fails.

Recreate: Set indent to 2 spaces.

Result: Indents 4 spaces.
image

Expected result: Indenting 2 spaces.

Preferred solutions:
1. Use the indent settings for the file type. , or..
2. Make an extension setting for it.

// Big thanks for a nice extension!

Multi-line key mapping breaks formatting when using #If directives

Minimal reproduction. Uncomment ; Breaks formatting sections and save to see the issue in action.

Example:

#IfWinActive Notepad
    ; Breaks formatting
    ; $^1::
    ;     Foo := 1
    ;     Bar()
    ; return
    
    ; Breaks formatting
    ; $^`::
    ;     Foo := 1
    ;     if Foo {
    ;         Bar()
    ;     } else {
    ;         Fizz()
    ;     }
    ; return
    
    Bar() {
        return
    }
    
    Fizz(){
        return
    }

Minor grammar error in ahk.json

snippets\ahk.json at lines 1758 & 1763, \"${4:ExcludeText]}\" should be \"${4:ExcludeText\"]}

AHKP_ahk json

Also, does the "Duplicate object key" warning have any significance?

右键菜单运行

为什么不考虑增加在右键菜单运行脚本前先保存文件

Ahk2Exe path change

Where can I change Ahk2Exe.exe location path to my D:/AutoHotkey_1.1.30.01/Compiler/Ahk2Exe.exe? Thanks.
ahk2exe

[2.5.5+] Forcing to save script

One of the best feature for me is running temporary scripts, without needing the save them.

Since 2.5.5 whenever I run or compile unsaved scripts a Save As window comes up and interferes with the running process.

Debugging failure after restarting vscode

By Google Translate from Japanese to English.

If you start debugging in the following way, it will fail.

  1. "program" is set to something other than "$ {file}"
  2. Restart vscode without opening the file set in "program"
  3. Start debugging

Curiously, if you open and close the file set in "program" and start debugging, it works fine.

How to debug if the script is not opened in the VSCode Editor?

Hello. Thanks a lot for the great extention.
If I run the script which was not opened in the VSCode editor (editor tab is not active or even closed) then the debug panel appears, but the script is not started. If I restart Debug with corresponding command then script runs, but no breakpoints are activated.

There is no issues if I start the debug when the script is opened in the editor.

I don't know what I'm doing wrong.

Here is my "launch.json":

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "ahk",
            "request": "launch",
            "name": "Autohotkey Debugger",
            "program": "${workspaceFolder}\\main.ahk",
            "stopOnEntry": true
        }
    ]
}

The ${workspaceFolder} is like C:\Users\%UserName%\AAA\BBB\CCC.ahk

Would you help me, please?

launch AHK help

Would be great to open the help file AutoHotkey.chm from within VSCode.

Check file paths on install or first run

OS: Windows 10 Pro 64 bit
AHK: 1.1.33.2
Installation Path: C:\Program Files\Other\AutoHotkey

My copy of AHK is installed in a non-default location.

At the moment vscode-autohotkey installs (apparently) ok, but then fails the first time you try to run or debug a script.

Ideally the installation process for the extension would check the file path to the AHK executable and help file, give a meaningful warning then open the settings page so the user can set the correct paths.

If that isn't possible, a helpful message from the first attempt to run a script in the debugger, rather than a plain The system cannot find the path specified. error would be an improvement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.