Skip to content

Say and N more when a typed-hole refinement list is cut - #165

Open
amandeavor wants to merge 1 commit into
simontreanor:mainfrom
amandeavor:fix/truncated-refinement-list-says-and-n-more
Open

amandeavor wants to merge 1 commit into
simontreanor:mainfrom
amandeavor:fix/truncated-refinement-list-says-and-n-more

Conversation

@amandeavor

Copy link
Copy Markdown

Summary

Typed holes already say and N more when the direct-fit (try:) shortlist is capped. The refinement (or:) shortlist was also capped at four candidates, but silently — so a reader could not tell whether those four were the full set.

This mirrors the direct-fit behaviour for refinements:

  • Infer::hole_refinements now returns (shortlist, leftover_count) like hole_fits
  • Hole gains more_refinements
  • Hole::message appends , and N more on the or: clause when the cap left anything out

Fixes #139.

Test plan

  • cargo fmt
  • cargo clippy --all-targets
  • cargo test (full suite, including new a_truncated_refinement_list_says_how_many_it_left_out)
  • Confirmed the issue example let r = ["a"] |> List.map ?f |> String.join "," produces a capped refinement list with a non-zero leftover count in the message

Direct fits already report how many candidates the shortlist left out;
give the `or:` refinement clause the same treatment so readers know the
four shown suggestions are a capped shortlist, not the full set.
Copilot AI lite review requested due to automatic review settings September 28, 2026 03:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Say and N more when the refinement list of a typed hole is cut

2 participants