@@ -47,7 +47,10 @@ func (d *Deprecations) Validate(value cty.Value, module addrs.Module, rng *hcl.R
4747 return notDeprecatedValue , d .deprecationMarksToDiagnostics (deprecationMarks , module , rng )
4848}
4949
50- // ValidateExpressionDeep does the same as Validate but checks deeply nested deprecation marks as well.
50+ // ValidateExpressionDeep looks for deprecation marks deeply within the given value
51+ // and returns diagnostics for each deprecation found, unless deprecation warnings
52+ // are suppressed for the given module. It finds the most specific range possible for
53+ // each diagnostic.
5154func (d * Deprecations ) ValidateExpressionDeep (value cty.Value , module addrs.Module , expr hcl.Expression ) (cty.Value , tfdiags.Diagnostics ) {
5255 var diags tfdiags.Diagnostics
5356 unmarked , pvms := value .UnmarkDeepWithPaths ()
@@ -100,9 +103,8 @@ func deprecationMarkToDiagnostic(depMark marks.DeprecationMark, subject *hcl.Ran
100103 return diag
101104}
102105
103- // ValidateConfig checks the given value for deprecation marks and returns diagnostics
106+ // ValidateConfig checks the given value deeply for deprecation marks and returns diagnostics
104107// for each deprecation found, unless deprecation warnings are suppressed for the given module.
105- // It checks for deeply nested deprecation marks as well.
106108func (d * Deprecations ) ValidateConfig (value cty.Value , schema * configschema.Block , module addrs.Module ) (cty.Value , tfdiags.Diagnostics ) {
107109 var diags tfdiags.Diagnostics
108110 unmarked , pvms := value .UnmarkDeepWithPaths ()
0 commit comments