Documentation
¶
Index ¶
- func DowngradeDiags(diags hcl.Diagnostics) hcl.Diagnostics
- func Err2Diag(err error) *hcl.Diagnostic
- func HasVariable(ctx *hcl.EvalContext, name string) bool
- func IsIdentifier(s string) bool
- func NormalizeTraversal(t hcl.Traversal) hcl.Traversal
- func ToErrorDiag(summary string, details string, r hcl.Range) hcl.Diagnostics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DowngradeDiags ¶
func DowngradeDiags(diags hcl.Diagnostics) hcl.Diagnostics
DowngradeDiags downgrades all errors in the supplied diags to warnings and returns it. This is a destructive operation, clone the diags before calling this function if you need the original.
func Err2Diag ¶
func Err2Diag(err error) *hcl.Diagnostic
Err2Diag converts an error to a hcl.Diagnostic.
func HasVariable ¶
func HasVariable(ctx *hcl.EvalContext, name string) bool
HasVariable returns true if the supplied name is defined in the current or any ancestor context.
func IsIdentifier ¶
IsIdentifier returns true if the supplied string can be interpreted as an HCL identifier.
func NormalizeTraversal ¶
NormalizeTraversal normalizes an index traversal to an attribute traversal for known cases. (i.e. x["foo"] is effectively turned to x.foo).
func ToErrorDiag ¶
ToErrorDiag create diagnostics with the supplied summary, details, and range.
Types ¶
This section is empty.