Correct mounted mapping diagnostic paths
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user