zero-plusplus / vscode-autohotkey-debug

https://marketplace.visualstudio.com/items?itemName=zero-plusplus.vscode-autohotkey-debug
MIT License
50 stars 4 forks source link

Change specification when relative paths are specified in the `runtime` attribute #307

Open zero-plusplus opened 7 months ago

zero-plusplus commented 7 months ago

RELATED: #303

The current runtime attribute is treated as relative to the AutoHotkey directory if the path specified is not absolute.

For example, if autohotkey is specified, it will be converted to C:/Program Files/AutoHotkey/AutoHotkey.exe.

However, I noticed that if you specify autohotkey, it expects to find autohotkey in directories registered in the environment variable.

For example, if the AutoHotkey runtime is located in C:/foo/AutoHotkey.exe and C:/foo is registered in the environment variable, it means that autohotkey will expect to be converted to C:/foo/AutoHotkey.exe.

However, as the default value of runtime is AutoHotkey.exe, users may refer to it and set the value directly in launch.json. This will be treated as an error after the specification change, so users will be confused.

So I will search the directory registered in the environment variable if it does not contain path delimiters such as / or`, and if the runtime does not exist, refer to the default installation directory of AutoHotkey as before.

If you want to treat the path as relative to the installation directory, use . /autohotkey, for example . / to start with.

This is not a destructive change, so it is probably more of an improvement than a specification change.

Additionally, this change to the specification may solve this issue.