ahkpp icon indicating copy to clipboard operation
ahkpp copied to clipboard

"Go to definition" does not account for `#include dir` directives

Open mark-wiemer opened this issue 9 months ago • 4 comments

For troubleshooting assistance, refer to the troubleshooting guide

Description

; main.ahk1
#include myDir ; some directory
#include myScript.ahk ; some file within the included directory
myFunc() ; some function within that file

Here, "go to definition" on myFunc with experimental funcDefSearch setting enabled doesn't work, as it looks for ./myScript instead of ./myDir/myScript

Expected behavior

"Go to definition" on myFunc should take me to the definition in ./myDir/myScript.ahk relative to the dir containing main.ahk1

mark-wiemer avatar Mar 21 '25 05:03 mark-wiemer

I'm experiencing this issue on PC B, while PC A is fine.

#include C:\ahk\lib\
Error: Unable to read file 'C:\ahk\lib\' that is actually a directory

The AHK++ config is the same in both settings.json files.

Both systems info:

AHK++		6.7.0
AHK Version:	1.1.37.02
Unicode:	Yes (64-bit)
OS:		10.0.19045

The AHK and OS version are from an about-ahk script run from Code.

I tried 1.1.37.02, 1.1.37.01, and 1.1.36.02. PC A works on any, PC B does not.

I reverted PC B from Code 1.99 to Code 1.98.2 to match PC A, but it did not resolve the issue. However, while running 1.98 on B, it crashed after a minute, offering to restart, empty detail, so I'm not entirely sure it was a valid test. All I did was run the older install over top the existing.

Let me know if there's info that will help resolve this issue.

Gubith avatar Apr 12 '25 22:04 Gubith

Hi @Gubith, are you working in the same workspace with each PC? And have you tried the steps in https://github.com/mark-wiemer/ahkpp/blob/main/docs/troubleshooting.md to get debug-level logs? You're welcome to open a new issue specifically for this

mark-wiemer avatar Apr 13 '25 01:04 mark-wiemer

Hi @Gubith, are you working in the same workspace with each PC? And have you tried the steps in https://github.com/mark-wiemer/ahkpp/blob/main/docs/troubleshooting.md to get debug-level logs? You're welcome to open a new issue specifically for this

The workspaces are different, different projects.

I followed the troubleshooting, nice to see Everything mentioned, had it installed already, alas no change, same issue. Listary 5 also finds everything fast, and has more useful features for file handling.

Setting Dev log level does not change the output.

There no errors detected in the workspace.

Test: Created a new project on PC B, new workspace, test.ahk language set to ahk 1 and containing only "#include C:\ahk\lib\GenFN23". Same issue.

The error is displayed in Output on file load, and again on run:

2025-04-14T04:15:45.667Z buildPaths error building C:\ahk\lib\GenFN23\
2025-04-14T04:15:45.668Z cannot open file:///c%3A/ahk/lib/GenFN23/. Detail: Unable to read file 'c:\ahk\lib\GenFN23\' (Error: Unable to read file 'c:\ahk\lib\GenFN23\' that is actually a directory)

What could be different about the environment on this PC?

Gubith avatar Apr 14 '25 04:04 Gubith

You are describing a known issue. AHK++ outputs these logs when files #include a directory. I will change this to a debug log and hopefully resolve the main problem eventually ;)

mark-wiemer avatar Apr 20 '25 21:04 mark-wiemer