Documentation
¶
Overview ¶
Package infer bridges auto-detection and the provider registry: it decides whether a line Clover recognizes would actually resolve, offline. The one gate is shared by annotate, which writes a directive above each passing line, and by run --infer, which synthesizes a marker for it without writing anything - so the two features can never disagree about what is trackable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Directive ¶
Directive builds the directive a provider=auto marker binds for inf: the inferred provider plus every parameter read from the line. It is what the gate validates the provider resource against.
func Recognizable ¶
Recognizable reports whether lines[i] names a complete reference, stopping before the heavier offline resolution gate. It backs opt-out diagnostics, which only need to know a line would otherwise have been a candidate.
func Recognize ¶
Recognize reports the inference for lines[i] and whether its line would resolve: ok is false when no auto route matches at all, and reason carries why a matched line still cannot resolve (an incomplete reference, a provider resource that does not build, a version the rewriter cannot locate). A matched line with an empty reason is safe to annotate or update.
func Unresolved ¶
func Unresolved( providerName string, d directive.Directive, line string, rewriter func() (match.Rewriter, error), ) string
Unresolved runs the offline checks lint and run perform against a candidate annotation: the provider must exist, build a valid resource from d, and the rewriter must locate a trackable version on line. An empty reason means the candidate is safe to emit.
Types ¶
This section is empty.