mark-wiemer-org / ahkpp

AutoHotkey Plus Plus (AHK++) - AutoHotkey v1 and v2 support for VS Code
https://marketplace.visualstudio.com/items?itemName=mark-wiemer.vscode-autohotkey-plus-plus
Other
152 stars 10 forks source link

"Run" command thinks a V1 script is V2. #407

Closed NBKRedSpy closed 12 months ago

NBKRedSpy commented 12 months ago

Description

V5.03

When trying to run a V1 Script (Ctrl + R), the extension thinks it is a V2 script.

Reproduction steps

Steps to reproduce the behavior:

1, Create an ahk file. Ex: main.ahk

  1. Put in a v1 specifc line. Ex: #include, Foo.ahk
  2. Run using Ctrl+R

Result: Error is "Error: This line does not contain a recognized action" The .exe is C:\Users\MyUser\AppData\Local\Programs\AutoHotkey\v2\AutoHotkey64.exe.

Expected behavior

The V1 interpreter to be used.

Additional context

Running the script via AHK v1 or reloading from the V1's taskbar icon works as expected.

User Settings for extension:

    "ahk++.file.interpreterPathV1": "C:\\Users\\<User Name>\\AppData\\Local\\Programs\\AutoHotkey\\v1.1.37.01\\AutoHotkeyU64.exe",
    "ahk++.file.interpreterPathV2": "C:\\Users\\<User Name>\\AppData\\Local\\Programs\\AutoHotkey\\v2\\AutoHotkey64.exe",
NBKRedSpy commented 12 months ago

v 4.1.0 (of course) works fine.

fade2gray commented 12 months ago

You need to head your v1 scripts with #Requires AutoHotkey v1 - see https://github.com/mark-wiemer-org/ahkpp/issues/396#issuecomment-1676525716

mark-wiemer commented 12 months ago

Closing as @fade2gray's comment most likely addresses the issue. Please reopen if you're still having problems :)

NBKRedSpy commented 12 months ago

Annotating the file did work. Thank you.