Correct mounted mapping diagnostic paths

This commit is contained in:
2026-10-14 15:49:51 +00:00
parent a029a2a754
commit 315f464dfc
4 changed files with 95 additions and 3 deletions

View File

@@ -29,6 +29,15 @@ func assembleBaseInputTracked[T any](source Source, options Options[T], destinat
if len(diagnostics) != 0 {
input.sources = sourceInfos(parsed.source)
setSourceDestinations(input.sources, destination)
// Mapping value issues already identify application content. Other early
// failures describe source syntax or access, not a placed value.
if source.kind == sourceMapping && source.mapIssue != nil && len(destination.segments) != 0 {
for index := range diagnostics {
relative := diagnostics[index].Path
segments := clonePathSegments(destination.segments, len(relative.segments))
diagnostics[index].Path = Path{segments: append(segments, relative.segments...)}
}
}
return input, diagnostics
}
if options.Imports {