thqby / vscode-autohotkey2-lsp

Autohotkey v2 Language Support using vscode-lsp.
https://marketplace.visualstudio.com/items?itemName=thqby.vscode-autohotkey2-lsp
GNU Lesser General Public License v3.0
210 stars 21 forks source link

#include sometimes gives Invalid file path error #500

Closed marium0505 closed 5 months ago

marium0505 commented 5 months ago

I've come across another issue which randomly seems to occur.

#include Sometimes gives the Invalid file path error. As seen below: image

VS Code gives the mentioned error, but the stuff in the file is clearly included, which is clear from the console.
The file structure is as it should be, with the included file being in Lib folder inside the A_ScriptDir "\Lib\" ; Local library folder.

The lines shown in the photo are the only lines of the including/current file. The file being included is https://github.com/G33kDude/cJson.ahk/blob/v2/Dist/JSON.ahk (but with the classname changed to cJson).

When I copy the exact same files with the exact same file/folder structure, no error is given.

thqby commented 5 months ago

Sometimes the extension can't correctly identify the directory where a_scriptdir is located, and this error will occur. You can introduce the library through a relative path or set AutoHotkey2.WorkingDirs

marium0505 commented 5 months ago

Okey, I think I'm closing this for the time being.

Though, one question before I close it. The Auto Hotkey2: Auto Lib Include setting, how about making the setting a checkbox based setting instead of a dropdown so that users can pick and choose the combination they want? I would like to combine Local and User, but you can only combine all or just User and Standard.

I can make a new issue for that if you want.

thqby commented 5 months ago

Since AHK does not have an official standard library, both the standard library and user library are managed by users themselves. For convenience, they can be merged. Would you like to place libraries separately in these two directories?

thqby commented 5 months ago

command ahk2.setscriptdir can reset scriptdir.