fix(core): use closest_msg to suggest similar member name for mistyped -p#16844
fix(core): use closest_msg to suggest similar member name for mistyped -p#16844weihanglo merged 2 commits intorust-lang:masterfrom
closest_msg to suggest similar member name for mistyped -p#16844Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @epage |
| }) | ||
| .min_by_key(|(distance, _)| *distance) | ||
| .map(|(_, member)| { | ||
| format!( |
There was a problem hiding this comment.
Can we use closest and closest_msg from edit_distance.rs for this?
There was a problem hiding this comment.
Tried closest_msg first but it uses distance 3 which caused false positives in non_member and non_member_feature tests. Kept distance 2 to avoid noisy hints.
There was a problem hiding this comment.
We should then either
- change the tests so we remain consistent in our closest matching logic
- change
closest_msgto be smarter about matches
I would view changing closest_msg to be out of scope for this change though
There was a problem hiding this comment.
switching to closest_msg and updating the affected test assertions.
closest_msg to suggest similar member name for mistyped -p
Fixes: #15561
Use
closest_msgto suggest similar workspace member name when-p <typo>triggers the outside-of-workspace features error.