Expose input destinations through the public facade

This commit is contained in:
2026-10-14 13:56:22 +00:00
parent 751787ec24
commit 53601e68ed
7 changed files with 429 additions and 16 deletions

View File

@@ -182,12 +182,16 @@ type Location struct {
// SourceInfo describes a source discovered during a load. Kind identifies its
// acquisition, independent of Layer. Path is canonical for a host file and
// namespace-relative for a filesystem file; synthetic sources have no Path.
// Destination is the effective mapping path where this source contributes.
// UnderlayIndex is the one-based original underlay position, or zero for other
// sources. ImportedFrom identifies the declaration that included this source.
type SourceInfo struct {
ID string
Label string
Path string
ID string
Label string
Path string
// Destination is the effective mapping path. Imported sources retain their
// input's destination; overlay and CLI sources use the root path.
Destination Path
Layer Layer
Kind SourceKind
UnderlayIndex int
@@ -260,6 +264,7 @@ func cloneLocations(locations []Location) []Location {
}
func cloneSourceInfo(source SourceInfo) SourceInfo {
source.Destination = source.Destination.clone()
source.ImportedFrom = cloneLocation(source.ImportedFrom)
return source
}