Let's say you have a local module `foo` with a symbol `bar`.
You also have another module `baz`, which uses `bar` but does not import `foo`.
Something like:
```d
module foo;
int bar() { return 5; }
```
```d
module baz;
int fn() { return bar(); } // error, bar not defined
```
For known functions/symbols, the compiler suggests imports. If you are missing an import for `std.stdio`, and you use `writeln`, the compiler suggests the import.
But often times, you are compiling *both* `foo` and `baz`, and so the compiler knows there is a `bar`, and it can be accessed by importing `foo`. If you are already ending compilation anyway, why not give suggestions for the known symbol? You can even suggest multiple places where the symbol is defined if that is the case.
Comment #1 by robert.schadek — 2024-12-13T19:31:39Z