-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZLS can't find module imports when the project is on an external drive #1927
Comments
Would be nice if the Could you post ZLS's entire log output. Ideally with the ``zig.zls.debugLog` option enabled in VS Code. Could you try deleting any local
Could you try opening a terminal in the Does this happen with a new |
Only doing that gives that log:
Deleting my I brought back the offending cache (which brought back the issue) and tried clearing the global cache instead. Doing that apparently fixed the problem as well, and bringing back the old global cache brings back the issue too.
Doing this runs some stuff and gives a JSON output, it doesn't print errors:
If you meant launching VSCode again afterwards to see if it prints the error, then it still prints it.
Havent tried that one but given what I found above it might not have the issue until I switch computer. |
Then it seems like you somehow had a corrupted Zig cache. I doubt that an issue with the caching system is caused by ZLS but I also don't know the cause of this. If you find a reproducible way to create a corrupted cache then this can be reported to Zig but otherwise I don't think there is anything to resolve here. |
Zig Version
0.12
Zig Language Server Version
0.12.0
Client / Code Editor / Extensions
VSCode 1.90.2
Steps to Reproduce and Observed Behavior
I have my Zig project on an external SSD (plugged in USB), and noticed that module imports added via the package manager like
raylib
orztracy
fail to resolve. "Go to definition", completion or highlighting don't work.In this project,
raylib
is added via automatic download, whileztracy
is manually installed in the project itself. But either way, neither are found.Inspecting logs shows this gets printed often:
My project compiles and runs fine though.
Not sure which file exactly it can't find, but i suspect it's
build.zig
itself?I'm on Windows 10 and my external SSD is currently called
F:
.I tried copying my project to my internal drive
D:
, and imports magically worked. So there might be something wrong with the handling of external drives?Expected Behavior
ZLS should resolve imports correctly even if the project is on an USB drive.
Relevant log output
Additional note: on a separate computer, using Windows 11, my SSD had the character
D:
and imports seemed to resolve. Not sure what factor is at play here.The text was updated successfully, but these errors were encountered: