add the address field to the view diagnostics
This commit is contained in:
parent
503c413de2
commit
406ac97965
|
@ -213,6 +213,10 @@ func DiagnosticWarningsCompact(diags tfdiags.Diagnostics, color *colorstring.Col
|
|||
}
|
||||
|
||||
func appendSourceSnippets(buf *bytes.Buffer, diag *viewsjson.Diagnostic, color *colorstring.Colorize) {
|
||||
if diag.Address != "" {
|
||||
fmt.Fprintf(buf, " (%s)\n", diag.Address)
|
||||
}
|
||||
|
||||
if diag.Range == nil {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ type Diagnostic struct {
|
|||
Severity string `json:"severity"`
|
||||
Summary string `json:"summary"`
|
||||
Detail string `json:"detail"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Range *DiagnosticRange `json:"range,omitempty"`
|
||||
Snippet *DiagnosticSnippet `json:"snippet,omitempty"`
|
||||
}
|
||||
|
@ -124,6 +125,7 @@ func NewDiagnostic(diag tfdiags.Diagnostic, sources map[string][]byte) *Diagnost
|
|||
Severity: sev,
|
||||
Summary: desc.Summary,
|
||||
Detail: desc.Detail,
|
||||
Address: desc.Address,
|
||||
}
|
||||
|
||||
sourceRefs := diag.Source()
|
||||
|
|
Loading…
Reference in New Issue