Skip to content
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

A module import is not recognized if imported in two different modules under two different names #2118

Closed
betonowy opened this issue Dec 25, 2024 · 0 comments · Fixed by #2119
Labels
bug Something isn't working

Comments

@betonowy
Copy link

betonowy commented Dec 25, 2024

Zig Version

0.14.0-dev.2563+af5e73172

ZLS Version

0.14.0-dev.304+b401aab

Client / Code Editor / Extensions

VSCode with Zig Language extension

Steps to Reproduce and Observed Behavior

Here is an archive with minimal repro: test.zip

What I observed is if imports look like this:

  • mod_b imports mod_a as mod_a_import_mod_b - works
  • main imports mod_a as mod_a_import_main - doesn't work
  • main imports mod_b as mod_b_import_main - works

A minimal change in both build.zig and src/*.zig files that will make this example work is this:

  • mod_b imports mod_a as mod_a_import_main - works
  • main imports mod_a as mod_a_import_main - now it works
  • main imports mod_b as mod_b_import_main - works

So it looks as if zls doesn't cover case when module is imported in two different modules under different names.

Could possibly be related to #2117, but I wasn't sure.

Expected Behavior

Module import is recognized by zls. It was working previously (I don't have an exact version anymore, but it was when 0.14.0-dev.2457+82f35c518 was the newest version of zig master/roughly 1 month ago).

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant