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

Zls Support #403

Open
turmanticant opened this issue Nov 30, 2024 · 2 comments
Open

Zls Support #403

turmanticant opened this issue Nov 30, 2024 · 2 comments

Comments

@turmanticant
Copy link

turmanticant commented Nov 30, 2024

Hey! I started using this ruleset recently, and have appreciated how well they work!

I am trying to get IDE feedback from zig_modules. Everything compiles totally fine, but I don't get any symbol resolution from modules.

I am using the zls for IDE feedback (through Zigbrains in a jetbrains IDE).

Are there any tricks to let zls know about these modules?

@aherrmann
Copy link
Owner

@turmanticant thanks for the kind words and for raising this ticket. I haven't looked into the configuration of ZLS under Bazel, yet. So far I have just used ZLS with a globally installed Zig toolchain that matches the Zig version used under Bazel. Ideally rules_zig ZLS support would capture two features:

  1. Configure ZLS to use the rules_zig / Bazel managed Zig toolchain so that the Zig version always matches.
  2. Configure ZLS with the correct module search paths so that imports of Bazel managed modules, including generated modules, are found correctly.

Neither of these features is implemented at the time of writing. And, I think those features can be implemented one-by-one in any order.

I had a look at the ZLS configuration schema. I see fields about the Zig installation and standard and builtin library paths. Those would capture point 1 above, but not point 2.

For point 2 ZLS would need to expose some interface to configure module search paths. I don't know if ZLS exposes such an interface, but I didn't find one at a cursory look. A good starting point is probably to look at how ZLS manages module search paths with build.zig based projects.

@turmanticant
Copy link
Author

Thanks for the threads to pull on, that is super helpful. I will take a look into point 2 to see what options for supporting this might look like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants