Publish detached sanitized source evidence
This commit is contained in:
@@ -63,8 +63,9 @@ func WriteDiagnostics(output io.Writer, diagnostics []Diagnostic) error {
|
||||
}
|
||||
|
||||
type diagnosticAccumulator struct {
|
||||
diagnostics []Diagnostic
|
||||
sources []SourceInfo
|
||||
diagnostics []Diagnostic
|
||||
sources []SourceInfo
|
||||
versionState *sourceVersionState
|
||||
}
|
||||
|
||||
func (a *diagnosticAccumulator) add(diagnostics ...Diagnostic) {
|
||||
@@ -74,9 +75,13 @@ func (a *diagnosticAccumulator) add(diagnostics ...Diagnostic) {
|
||||
}
|
||||
|
||||
func (a *diagnosticAccumulator) loadError() *LoadError {
|
||||
sources := a.sources
|
||||
if a.versionState != nil {
|
||||
sources = sourceInfosWithVersionEvidence(sources, a.versionState.evidence, nil, true)
|
||||
}
|
||||
return &LoadError{
|
||||
diagnostics: canonicalDiagnostics(a.diagnostics),
|
||||
sources: cloneSourceInfos(a.sources),
|
||||
sources: cloneSourceInfos(sources),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user