zls icon indicating copy to clipboard operation
zls copied to clipboard

Broken cross-file references

Open SuperAuguste opened this issue 2 years ago • 9 comments

references.zig uses DocumentStore.collectDependencies which collects the imports a file specifies; this incorrect - we should be collecting dependents (files that import the current file), not dependencies (files that the current file imports).

To take this on you'd have to create a new collectDependents function that loads in all files in a workspace while checking for imports and returns all files that import the current file.

SuperAuguste avatar Mar 16 '23 03:03 SuperAuguste

Yes I think this is what I meant with this issue: https://github.com/zigtools/zls/issues/1070

After a recent change, an import 3-4 levels deep through usingnamespace stops working

https://github.com/oven-sh/bun/blob/6f59bc7d2e7aa64956bdd6f56769467853fd0242/src/main.zig#L45

Jarred-Sumner avatar Mar 16 '23 20:03 Jarred-Sumner