Repository navigation
fix(queryexec): offer the features nearest to the missing segment, not the first three by name - #1581
Merged
Merged
Conversation
…t the first three by name Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…e-nearest Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/doc/queryexec/errors.go
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 and why
The
missing-featureerror introduced in #1577 ends, when the element has more than three features, with a "did you mean …?" suggestion.missingFeatureMessagepassed the wholeCandidateslist — every feature of the element, sorted by name — tosuggest.With, which offers the firstLimitentries in the order given. The suggestion therefore named the first three features alphabetically, not the ones nearest to the missing segment, whileFrontier.Neareston the same record already held the right answer:Now the message ranks the candidates with
suggest.Nearest(segment, e.Candidates)first, so the same query saysdid you mean runa, runb or runz?. The record (Candidates,Frontier) is unchanged; only the sentence moves.Specification basis
No specification clause: a diagnostic wording fix.
docs/internals/design/query-outcomes.mddescribesFrontier.nearestas "the closest spelling, by edit distance"; the sentence now agrees with the record.How it was verified
TestExecuteMissingFeatureSuggestsTheNearestFeatures(new,internal/doc/queryexec/missing_feature_test.go) fails ondevelopwith the message above and passes with the fix.go test -count=1 ./internal/doc/queryexec/...,go vet ./internal/doc/queryexec,gofmt -lclean.Checklist
make testandmake lintpass locally (the touched package; the full suite runs in CI)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build) — no count movedF4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/9cd1c7a9f9a94b7597fc6968dac74733
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/9cd1c7a9f9a94b7597fc6968dac74733?variant=devin
Requested by: @HuiJun