Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions diagnostic_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ func (w *diagnosticTextWriter) WriteDiagnostic(diag *Diagnostic) error {
continue
case val.IsNull():
stmts = append(stmts, fmt.Sprintf("%s set to null", traversalStr))
case val.IsMarked():
// Skip the marked values as it is not clear here how they should be rendered.
continue
default:
stmts = append(stmts, fmt.Sprintf("%s as %s", traversalStr, w.valueStr(val)))
}
Expand Down
25 changes: 22 additions & 3 deletions diagnostic_text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,21 @@ Did you mean "pizzetta"?
Name: "boz",
},
},
{
TraverseRoot{
Name: "marked",
},
},
{
TraverseRoot{
Name: "null",
},
},
{
TraverseRoot{
Name: "unknown",
},
},
},
},
EvalContext: &EvalContext{
Expand All @@ -169,8 +184,11 @@ Did you mean "pizzetta"?
"bar": cty.ObjectVal(map[string]cty.Value{
"baz": cty.ListValEmpty(cty.String),
}),
"boz": cty.NumberIntVal(5),
"unused": cty.True,
"boz": cty.NumberIntVal(5),
"marked": cty.StringVal("marked").Mark("x"),
"null": cty.NullVal(cty.String),
"unknown": cty.UnknownVal(cty.String),
"unused": cty.True,
},
},
},
Expand All @@ -181,7 +199,8 @@ Did you mean "pizzetta"?

with bar.baz as empty list of string,
boz as 5,
foo as "foo value".
foo as "foo value",
null set to null.

This diagnostic includes an expression
and an evalcontext.
Expand Down
Loading