Tailor unknown-identifier hints for special forms#19
Merged
Conversation
What: - Skip exact-match suggestions in closestName so a typed name no longer suggests itself. - When the unresolved identifier is a higher-order form, return `"<name>" is a special form, did you mean to call <signature>?`, with try's signature distinguished from the (xs, predicate) shape shared by the other forms. - Update suggest_test, spec, and llms.txt to cover the new hint. Why: - "did you mean count?" is noise when the user already typed count. The form name is in the candidate set so users get a useful pointer to the right shape, including try's distinct (value, default) signature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
closestNameso a typed name no longer suggests itself."<name>" is a special form, did you mean to call <signature>?, withtry's signature distinguished from the(xs, predicate)shape shared by the other forms.suggest_test,docs/reference/spec.md, andllms.txtto cover the new hint.Why
did you mean "count"?is noise when the user already typedcount. The form name is in the candidate set so the levenshtein loop loops back to itself; the new hint instead points at the call shape, includingtry's distinct(value, default)signature.Test plan
go test ./...go test -race ./...go test -run=^$ -fuzz=FuzzCompile -fuzztime=20s .go test -run=^$ -fuzz=FuzzEval -fuzztime=20s .