Skip to main content

Module zero_hint

Module zero_hint 

Source
Expand description

Why a search returned nothing, judged from the FILTER, in a fixed order.

The 2.0.0 field test found the zero-result hint naming lock/generated files for every kind of exclusion: count_occurrences {pattern:"runs-on", file:".github/"} said “6 candidate file(s) were lock or generated files” when the true cause was “hidden path, not indexed”. An agent followed the hint, added include_locks, got 0 again, and concluded the thing did not exist.

One reason is chosen, the first that applies:

  1. the filter names a hidden path (.github/, .gitignore) — not indexed;
  2. the file filter names a path that is not in the index — say why, from disk;
  3. every candidate under the filter was a lock/generated file — say how to widen;
  4. a whole-identifier search has substring hits — say how to see them;
  5. nothing applies — no hint. The generic “check spelling / broaden” text is enough, and an invented reason is worse than none.

Structs§

ZeroHint
A reason and the sentence that explains it.

Enums§

ExcludedReason
Machine-readable cause of a zero result, beside the prose hint.

Functions§

explain_zero
The first rule that applies to this zero result; None when none does.
hidden_target
The first hidden segment named by the file or glob filters, if any.