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

(Scala 3) completions are more sensitive than Scala 2's #4656

Closed
kubukoz opened this issue Nov 20, 2022 · 4 comments · Fixed by scala/scala3#19850
Closed

(Scala 3) completions are more sensitive than Scala 2's #4656

kubukoz opened this issue Nov 20, 2022 · 4 comments · Fixed by scala/scala3#19850
Assignees
Labels
presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream
Milestone

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Nov 20, 2022

Describe the bug

In Scala 3 completions, it seems like whatever algorithm was used for fuzzy finding in Scala 2 has been changed to a more strict one. It's limiting the amount of completions that you get, and could be considered a defect in the functionality.

To reproduce:

//> using scala "2.13.10"

object MyInterface {
  def someMethod(s: String): Unit = ()
}

object demo {
  MyInterface.<CURSOR>
}

If you start typing at <CURSOR> and write m, you'll see a completion for the method:

image

In Scala 3, you don't see it:

image

Expected behavior

The method completion shows up.

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v0.11.9

Extra context or search terms

No response

@tgodzik
Copy link
Contributor

tgodzik commented Nov 21, 2022

Thanks for reporting! The issue is that the compiler is trying to filter the results first, we need to change that upstream I think.

@tgodzik tgodzik added Scala 3 Generic ticket relating to Scala 3 presentation-compiler Something relating to the presentation compiler upstream-fix-needed Waiting on a fix upstream labels Nov 21, 2022
@tgodzik
Copy link
Contributor

tgodzik commented Nov 21, 2022

@kubukoz
Copy link
Contributor Author

kubukoz commented Nov 21, 2022

nameInScope.startsWith(prefix) <- probably this part, right?

@tgodzik
Copy link
Contributor

tgodzik commented Nov 21, 2022

yep, Scala 2 allowed the downstream tools to use any kind of matcher

@kasiaMarek kasiaMarek assigned kasiaMarek and rochala and unassigned kasiaMarek Mar 20, 2024
rochala added a commit to scala/scala3 that referenced this issue Apr 12, 2024
…mpiler) (#19850)

Fixes scalameta/metals#4656
Fixes #5507
Fixes #17706

To ensure CI output will be the same on all runners, I'm scheduling runs
on all jvm versions + windows.

[test_windows_full]
[test_java8]
[test_java11]
[test_java15]
[test_java17]
[test_java18]
[test_java19]
olhotak pushed a commit to dotty-staging/dotty that referenced this issue Apr 15, 2024
…mpiler) (scala#19850)

Fixes scalameta/metals#4656
Fixes scala#5507
Fixes scala#17706

To ensure CI output will be the same on all runners, I'm scheduling runs
on all jvm versions + windows.

[test_windows_full]
[test_java8]
[test_java11]
[test_java15]
[test_java17]
[test_java18]
[test_java19]
@tgodzik tgodzik added this to the Metals v1.3.1 milestone May 13, 2024
@tgodzik tgodzik moved this to Done in Metals Issue Board Jun 12, 2024
WojciechMazur added a commit to scala/scala3 that referenced this issue Jul 5, 2024
…mpiler) (#19850)

Fixes scalameta/metals#4656
Fixes #5507
Fixes #17706

To ensure CI output will be the same on all runners, I'm scheduling runs
on all jvm versions + windows.

[test_windows_full]
[test_java8]
[test_java11]
[test_java15]
[test_java17]
[test_java18]
[test_java19]
[Cherry-picked acfc621][modified]
WojciechMazur added a commit to scala/scala3 that referenced this issue Jul 5, 2024
…mpiler) (#19850)

Fixes scalameta/metals#4656
Fixes #5507
Fixes #17706

To ensure CI output will be the same on all runners, I'm scheduling runs
on all jvm versions + windows.

[test_windows_full]
[test_java8]
[test_java11]
[test_java15]
[test_java17]
[test_java18]
[test_java19]
[Cherry-picked acfc621][modified]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
presentation-compiler Something relating to the presentation compiler Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants