pub struct SourceFile {
pub id: FileId,
pub path: Option<PathBuf>,
pub package: Option<String>,
pub text: String,
}Expand description
One file that contributed forms to a ResolvedProgram.
Fields§
§id: FileIdIts handle in the program that owns it.
path: Option<PathBuf>Where it came from.
None only for an entry program handed to the pipeline as bare text —
an embedder, a test, a WASM host. An imported file always has one,
because a Loader cannot name a package without naming a place.
package: Option<String>The bidama this file belongs to — the name use was given, or for the
entry file its Loader::entry_package — or None for a file in the
root namespace. The namespace its definitions are resolved under
(blue_lang_check::Namespace::Bidama).
text: StringThe file’s text.
Kept, not dropped after parsing, because a Span is a byte range and
nothing else: turning one into line:col needs the exact string it
indexes. Before this, resolve_uses read a package’s source and let it
fall out of scope one line later, which is why an imported type error
had no position to report.