From 29c88305883f792d7c7464d1865e497463755e93 Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Sat, 9 Nov 2024 11:18:45 -0800 Subject: [PATCH 1/6] Add manual test for AHK++.v2.file.interpreterPath and cleanup --- demos/manualTests/bugfixes.ahk | 24 ++++++++++++------------ demos/manualTests/config.ahk2 | 13 ++++++++++++- demos/manualTests/format/formatter.ahk1 | 2 +- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/demos/manualTests/bugfixes.ahk b/demos/manualTests/bugfixes.ahk index d045eecc..34d4d9f0 100644 --- a/demos/manualTests/bugfixes.ahk +++ b/demos/manualTests/bugfixes.ahk @@ -1,26 +1,26 @@ ;* Formatting should not change this file -; By default no action needed, older versions would show warnings or errors +;* By default no action needed, older versions would show warnings or errors #Requires AutoHotkey v2.0 -;* https://github.com/thqby/vscode-autohotkey2-lsp/issues/591 +; https://github.com/thqby/vscode-autohotkey2-lsp/issues/591 TraySetIcon(, , true) -;* https://github.com/thqby/vscode-autohotkey2-lsp/issues/594 +; https://github.com/thqby/vscode-autohotkey2-lsp/issues/594 class Test { __New() { 1 ? this.b := 1 : 0 } } -;* https://github.com/thqby/vscode-autohotkey2-lsp/issues/595 -; Should suggest `ptr` as second arg (Ctrl+Space) +; https://github.com/thqby/vscode-autohotkey2-lsp/issues/595 +;* Should suggest `ptr` as second arg (Ctrl+Space) DllCall.Bind("xx", "p") -;* https://github.com/thqby/vscode-autohotkey2-lsp/issues/596 +; https://github.com/thqby/vscode-autohotkey2-lsp/issues/596 Help:: return Sleep:: return -;* https://github.com/thqby/vscode-autohotkey2-lsp/issues/574 +; https://github.com/thqby/vscode-autohotkey2-lsp/issues/574 if 1 { f() { MsgBox("in") @@ -28,11 +28,11 @@ if 1 { MsgBox("out") } -;* https://github.com/thqby/vscode-autohotkey2-lsp/issues/571 -class class2 -{ +; https://github.com/thqby/vscode-autohotkey2-lsp/issues/571 +class class2 { __New() { this.g := Gui() - this.g.add() ; hover over add to see tooltip + ;* hover over `add` to see tooltip + this.g.add() } -} \ No newline at end of file +} diff --git a/demos/manualTests/config.ahk2 b/demos/manualTests/config.ahk2 index c609bc18..4757846e 100644 --- a/demos/manualTests/config.ahk2 +++ b/demos/manualTests/config.ahk2 @@ -25,6 +25,17 @@ y := 1 ; todo Class Non Dynamic Member Check is untested for now ; todo Params Check is untested for now +;** V2: File (AHK++.v2.file) +;* interpreterPath +; Setting to an invalid path and restarting the extension host should: +; - not show an error message on startup +; - add msg to output channel: Ctrl+Shift+U -> AHK++ (v2) -> "Couldn't resolve AHK v2 interpreter" +; - show "Select AHK v2 Interpreter" in status bar +; - show error message when trying to run a script +; - log error message in AHK++ (v1) when trying to debug a script +; - update when user confirms quick pick via error message +; - successfully run a script when user confirms quick pick + ;** V2: Formatter tested in other files :) ;** V2: General (AHK++.v2.general) @@ -58,4 +69,4 @@ MyFunc() { ;* varUnset ; x := 1 -MsgBox(x) +MsgBox(x) \ No newline at end of file diff --git a/demos/manualTests/format/formatter.ahk1 b/demos/manualTests/format/formatter.ahk1 index 6f99e5b1..0ff5e161 100644 --- a/demos/manualTests/format/formatter.ahk1 +++ b/demos/manualTests/format/formatter.ahk1 @@ -10,4 +10,4 @@ ; How many were preserved? ;) -; todo other options not tested \ No newline at end of file +; todo other options not manually tested \ No newline at end of file From d4293e7f744553e40bb1880320dc2c8daf413eba Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Sat, 9 Nov 2024 11:19:08 -0800 Subject: [PATCH 2/6] don't traumatize folks going through breakups lol --- demos/manualTests/config.ahk2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/manualTests/config.ahk2 b/demos/manualTests/config.ahk2 index 4757846e..47313e65 100644 --- a/demos/manualTests/config.ahk2 +++ b/demos/manualTests/config.ahk2 @@ -6,7 +6,7 @@ ; set AHK++.v2.general > librarySuggestions to All ; set exclude to "excluded.ahk" ; see whether MyExcludedFunc is suggested (Ctrl+Space) -MyEx +MyExclu ;** AHK++.general ;* showOutput From 56dc4f693d7a7707bd35209b9f75b33da341adcc Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Sat, 9 Nov 2024 12:25:18 -0800 Subject: [PATCH 3/6] Fix quick pick not working for "... does not exist" error message on run AHK v2 script --- ahk2 | 2 +- changelog.md | 2 ++ demos/manualTests/config.ahk2 | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ahk2 b/ahk2 index 560aade8..bf91d871 160000 --- a/ahk2 +++ b/ahk2 @@ -1 +1 @@ -Subproject commit 560aade8550e7dd17d6f78b3ac8360b4facf6ff1 +Subproject commit bf91d8719e827909ecfa02370fcf83bea1140b82 diff --git a/changelog.md b/changelog.md index 7a939c30..9afb94c4 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,8 @@ - This has been moved to a console log visible in the AHK++ (v2) output channel - A similar error message will still appear when attempting to debug with an unrecognized interpreter path - See the new [troubleshooting guide](docs/Troubleshooting.md) for details +- Fix quick pick not working for "... does not exist" error message on run AHK v2 script + > Note: this fix copies your config into your workspace settings. If you don't like this, please manually enter the path via the settings, and don't use the quick pick. Learn more at the linked PR ## 6.4.0 - 2024-11-02 🗳️ diff --git a/demos/manualTests/config.ahk2 b/demos/manualTests/config.ahk2 index 47313e65..b72aa852 100644 --- a/demos/manualTests/config.ahk2 +++ b/demos/manualTests/config.ahk2 @@ -33,7 +33,7 @@ y := 1 ; - show "Select AHK v2 Interpreter" in status bar ; - show error message when trying to run a script ; - log error message in AHK++ (v1) when trying to debug a script -; - update when user confirms quick pick via error message +; - persist settings when user confirms quick pick via error message ; - successfully run a script when user confirms quick pick ;** V2: Formatter tested in other files :) From 74fec633baccc5ae8a9ddf799c7ecc30db15a45d Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Sat, 9 Nov 2024 12:26:43 -0800 Subject: [PATCH 4/6] Cleanup changelog --- changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 9afb94c4..b04376e5 100644 --- a/changelog.md +++ b/changelog.md @@ -8,8 +8,8 @@ - This has been moved to a console log visible in the AHK++ (v2) output channel - A similar error message will still appear when attempting to debug with an unrecognized interpreter path - See the new [troubleshooting guide](docs/Troubleshooting.md) for details -- Fix quick pick not working for "... does not exist" error message on run AHK v2 script - > Note: this fix copies your config into your workspace settings. If you don't like this, please manually enter the path via the settings, and don't use the quick pick. Learn more at the linked PR +- Fix quick pick for "... does not exist" error message on run AHK v2 script ([PR #569](https://github.com/mark-wiemer-org/ahkpp/issues/569)) + > Note: this fix copies your config into your workspace settings. If you don't like this, please manually enter the path via the settings, and don't use the quick pick. Learn more at [PR #569](https://github.com/mark-wiemer-org/ahkpp/issues/569). ## 6.4.0 - 2024-11-02 🗳️ From f142f7830ef7d25276a5a3d810dc1858cd430fa1 Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Sat, 9 Nov 2024 12:30:59 -0800 Subject: [PATCH 5/6] Use absolute link for easier access --- .github/ISSUE_TEMPLATE/bug-report--non-formatter-.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report--non-formatter-.md b/.github/ISSUE_TEMPLATE/bug-report--non-formatter-.md index fab15693..6286dac0 100644 --- a/.github/ISSUE_TEMPLATE/bug-report--non-formatter-.md +++ b/.github/ISSUE_TEMPLATE/bug-report--non-formatter-.md @@ -8,7 +8,7 @@ labels: bug assignees: mark-wiemer --- -For troubleshooting assistance, refer to the [troubleshooting guide](../../docs/Troubleshooting.md) +For troubleshooting assistance, refer to the [troubleshooting guide](https://github.com/mark-wiemer-org/docs/Troubleshooting.md) ## Description From 4203d48ee316d65b5c05271035ea119ef6f19100 Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Sat, 9 Nov 2024 12:46:17 -0800 Subject: [PATCH 6/6] Update changelog with known issues --- changelog.md | 12 +++++++++--- docs/Troubleshooting.md | 5 ++++- src/debugger/debugDispatcher.ts | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index b04376e5..3a2d87d8 100644 --- a/changelog.md +++ b/changelog.md @@ -2,12 +2,18 @@ ## 6.4.1 - unreleased 🛠️ +### Known issues + +- If your AHK v2 interpreter is not recognized and you try to debug an AHK v2 script, an "AutoHotkey execute bin not found: ..." output log will appear and take focus in the AHK++ (v1) output channel (open issue [#570](https://github.com/mark-wiemer-org/ahkpp/issues/570)) +- The "Select AHK v2 interpreter" command does not work, instead please try to run (not debug) an AHK v2 script and use the quick pick from the "... does not exist" error message (open issue [#571](https://github.com/mark-wiemer-org/ahkpp/issues/571)) + +### Fixes + - Add [troubleshooting guide](docs/Troubleshooting.md) - Fix go to definition in AHK v1 files ([#559](https://github.com/mark-wiemer-org/ahkpp/issues/559)) - Remove unnecessary error message "Couldn't resolve AHK v2 interpreter" ([#493](https://github.com/mark-wiemer-org/ahkpp/issues/493)) - - This has been moved to a console log visible in the AHK++ (v2) output channel - - A similar error message will still appear when attempting to debug with an unrecognized interpreter path - - See the new [troubleshooting guide](docs/Troubleshooting.md) for details + - This has been moved to a output log visible in the AHK++ (v2) output channel + - A "... does not exist" error message will still appear when trying to run an AHK v2 script with an unrecognized interpreter path - Fix quick pick for "... does not exist" error message on run AHK v2 script ([PR #569](https://github.com/mark-wiemer-org/ahkpp/issues/569)) > Note: this fix copies your config into your workspace settings. If you don't like this, please manually enter the path via the settings, and don't use the quick pick. Learn more at [PR #569](https://github.com/mark-wiemer-org/ahkpp/issues/569). diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index 9200f9dd..13ce06be 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -6,7 +6,10 @@ If AHK++ isn't behaving as you expect, here are some things you can try. For AHK v2, the language server may not behave correctly if it fails to identify a valid path to an interpreter like `AutoHotkey.exe`. The status bar at the bottom left of your IDE should show the current interpreter or an option to "Select AHK v2 Interpreter". -Currently, AHK++ does not support the Windows Store edition of AHK v2, but there are plans to support it by the end of 2024, ref [#496](https://github.com/mark-wiemer-org/ahkpp/issues/496). +> Currently, the "Select AHK v2 Interpreter" command does not work, ref [#571](https://github.com/mark-wiemer-org/ahkpp/issues/571). +> To ensure the extension fully recognizes your interpreter, try to run (not debug) an AHK v2 script. If you get a "... does not exist" error message, the corresponding quick pick will work. + +> Currently, AHK++ does not support the Windows Store edition of AHK v2, but there are plans to support it by the end of 2024, ref [#496](https://github.com/mark-wiemer-org/ahkpp/issues/496). Interpreter found: diff --git a/src/debugger/debugDispatcher.ts b/src/debugger/debugDispatcher.ts index 36992497..1c3384f6 100644 --- a/src/debugger/debugDispatcher.ts +++ b/src/debugger/debugDispatcher.ts @@ -101,6 +101,7 @@ export class DebugDispatcher extends EventEmitter { const programName = getFileNameOnly(args.program); if (!existsSync(runtime)) { + // Exact text is referenced in docs, update docs when updating this value Out.log(`AutoHotkey execute bin not found: ${runtime}`); this.end(); return;