Skip to content
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

Give "did you mean ...?" hints also for simple identifiers #18747

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 23, 2023

Fixes #18682
Fixes #17067

 1. Only show accessible members
 2. Show several alternatives if they are at same distance. Unlike Scala 2,
    we do not show alternatives at larger distance. I fear that would produce
    more noise than signal.

Fixes scala#17067
|
| longer explanation available when compiling with `-explain`
-- [E006] Not Found Error: tests/neg/yimports-stable/C_2.scala:4:16 ----------------------------------------------------
4 | val v: Numb = magic // error // error
| ^^^^^
| Not found: magic
| Not found: magic - did you mean main?
Copy link
Contributor

Choose a reason for hiding this comment

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

in case you wondered if @main is too much magic

If scala.annotation were opened by @syntax, then annotations there would autocomplete only under @ma[etc].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I like that and did propose it at some point. Failed to convince @sjrd though.

Co-authored-by: Jamie Thompson <bishbashboshjt@gmail.com>
@odersky odersky assigned bishabosha and unassigned odersky Oct 25, 2023
@bishabosha bishabosha self-requested a review October 25, 2023 19:37
@bishabosha bishabosha merged commit 8046a8b into scala:main Oct 25, 2023
18 checks passed
@bishabosha bishabosha deleted the fix-18682 branch October 25, 2023 19:37
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
WojciechMazur added a commit that referenced this pull request Jun 23, 2024
… to LTS (#20742)

Backports #18747 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants