-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer “did you mean” for assignment ops #10262
Conversation
fb6b4b4
to
911eccc
Compare
4f9ba73
to
7ae8c6b
Compare
LGTM but I'm wondering about 90c1fa8, what's that about? |
@SethTisue https://discord.com/channels/632150470000902164/632628489719382036/1063609622113562724 I haven't tested javac on this score yet. I noticed But what about warnings? Do they also print to stderr? I hope so. Yes, same for warnings.
I vaguely recall considering this question, perhaps before the Dotty uses only stderr, and I opened a ticket to beg them to reconsider. |
I had to think too hard about what javac might warn about.
BTW scalac could include both the lint name and the |
Could 90c1fa8 go in a separate PR, or is there some necessary connection to the rest of the changes here? |
7ae8c6b
to
6858d20
Compare
Yes, it could. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but let's wait to merge until scala/scala-dev#827 has been addressed so we can get a go-ahead from Jenkins
6858d20
to
e781990
Compare
Squashed using artisanal squashing techniques. |
Oh, I needed this today! Except...
oh man, let me filter out those deprecations.
d'oh! of course it doesn't do conversions yet.
The full list of alternatives to present in this case
So the final wistful |
so did you want to wait to merge this until you add some of those improvements, or should we book the progress? |
I'll add the commit in just a second. I just excluded |
e781990
to
bc77b62
Compare
That second commit was an exceptionally low-throughput slog. "Just give me all the available implicits" and "I just want to exclude the arrow of pairing." Hey, Cupid's arrow is also for pairing. This Valentine's, we should celebrate tuples instead of couples. |
bc77b62
to
538abc8
Compare
The |
Backport dotty behavior of ranking results. Improve by offering a few alternatives, with subtle wording to differentiate first rank from the rest. Allow shorter matches if it looks like the typo is char swaps and repetitions.
538abc8
to
bb82366
Compare
@SethTisue I dropped the commit for "conversions help" until I review it further (for performance reasons). Rebased just the commit you approved. |
One small step for a man, one giant leap for the Oxford comma. |
Backport the latest Dotty research on recommending members of nearly identical spelling. (MONIS.)
Bumps the edit distance to consider, sorts the result, and presents up to 4 suggestions. Those that are not first-rank receive a qualifying, "or perhaps?" An ellipsis indicates when there are other candidates not presented to the user.
Avoid suggesting
wait
forpriv
orname
(that is more of a Wordle move). The tweaked restriction is that the edit distance cannot exceed half the word length (for either user identifier or candidate), but if all the chars written by the user appear in the candidate string, then use it, since swaps and repetitions are common typos. For example, foracb
suggestabc
but not forade
. (Tempted to takeade
because of the common prefix.)Sample dotty:
Avoid offering advice for setter, as in this dotty message:
but do advise on
++=
.It is slightly incongruous to suggest
did you mean +++ or x_=?
probably because the shared element is the suffix_=
or just=
. Maybe edit distance should be 1 for the shortest identifiers. More precisely, when comparing two setters, strip the suffix first. Then normal criterion says don't recommendx
fory
, which would be tedious.Dotty offers only one suggestion:
now we exclude
lines
in the first case (edit distance compared to token length) but includelength
in the second (because it is a word scramble):