Detail:"Elements of \"experiments\" must all be keywords representing active experiments.",
Subject:expr.Range().Ptr(),
})
continue
}
exp,err:=experiments.GetCurrent(kw)
switcherr:=err.(type){
caseexperiments.UnavailableError:
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Unknown experiment keyword",
Detail:fmt.Sprintf("There is no current experiment with the keyword %q.",kw),
Subject:expr.Range().Ptr(),
})
caseexperiments.ConcludedError:
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Experiment has concluded",
Detail:fmt.Sprintf("Experiment %q is no longer available. %s",kw,err.Message),
Subject:expr.Range().Ptr(),
})
casenil:
// No error at all means it's valid and current.
ret.Add(exp)
// However, experimental features are subject to breaking changes
// in future releases, so we'll warn about them to help make sure
// folks aren't inadvertently using them in places where that'd be
// inappropriate, particularly if the experiment is active in a
// shared module they depend on.
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagWarning,
Summary:fmt.Sprintf("Experimental feature %q is active",exp.Keyword()),
Detail:"Experimental features are subject to breaking changes in future minor or patch releases, based on feedback.\n\nIf you have feedback on the design of this feature, please open a GitHub issue to discuss it.",
Subject:expr.Range().Ptr(),
})
default:
// This should never happen, because GetCurrent is not documented
// to return any other error type, but we'll handle it to be robust.
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Invalid experiment keyword",
Detail:fmt.Sprintf("Could not parse %q as an experiment keyword: %s.",kw,err.Error()),
Detail:"This feature is currently an opt-in experiment, subject to change in future releases based on feedback.\n\nActivate the feature for this module by adding resource_for_each to the list of active experiments.",
Subject:rc.ForEach.Range().Ptr(),
})
}
}
for_,rc:=rangem.DataResources{
ifrc.ForEach!=nil{
diags=append(diags,&hcl.Diagnostic{
Severity:hcl.DiagError,
Summary:"Resource for_each is experimental",
Detail:"This feature is currently an opt-in experiment, subject to change in future releases based on feedback.\n\nActivate the feature for this module by adding resource_for_each to the list of active experiments.",