ErrorsProject layout and modules · rule
import.missing
A file uses a name declared elsewhere in the project without bringing it in on a use line.
Area 1, Project layout and modules; not declinable; the next step is usually the agent's.
Why Jadpo refuses it
Each file says where its other names come from, on use lines at its
top, so you or an agent can read where a name lives from the file
itself, without searching the project. A name the file uses but doesn't
import leaves that question open.
The fix is never in doubt. Every name a file can import is unique where
it can be imported, so only one use line brings it in.
What it looks like
domains/bakery/actions/stock_loaf.jadpo:
action stock_loaf(each: Stock) -> Stock { return each}
error Stock isn't imported
--> domains/bakery/actions/stock_loaf.jadpo:1:25
|1 | action stock_loaf(each: Stock) -> Stock { | ^^^^^ not imported
- reason
- Every name a file uses that it doesn't declare comes in on a
useline, so a reader sees where it lives;Stockis a type inshared/types/stock.jadpo. - next
- Add
use shared/types { Stock }, or runjadpo fmt, which adds every missing import (agent) - rule
- import.
missing - help
- https://jadpo.
dev/docs/errors/import. missing
(agent) at the end of the next: line means your coding agent can make
the fix itself.
How to fix it
If one name is missing, add its use line at the top of the file.
In domains/bakery/actions/stock_loaf.jadpo:
use shared/types { Stock }The file now says that Stock is in shared/types/stock.jadpo, and the
project checks.
If several names are missing, let the formatter write the lines:
jadpo fmtjadpo fmt adds every missing import and removes every unused one, one
line per folder, sorted. It does this once every file in the project
parses.
Related
Markdown for agents: /docs/errors/import.missing.md.Built from Jadpo main at aee2e8f.