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

Implicits (cats.implicits.given) slow down completion to the point of timeout #6054

Closed
KaranAhlawat opened this issue Jan 28, 2024 · 2 comments
Labels
Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream
Milestone

Comments

@KaranAhlawat
Copy link
Contributor

Describe the bug

Having the cats.implicits.given or cats.implicits.* import at the top of a file hinders the completions at certain points in the file greatly (e.g. type constraints).

  1. Create a project with Typelevel cats as dependency.
  2. Create a class with a generic type and some constraints on it.
  3. Use the constraint so that a given instance is required. At this point, the compiler should complain that no given instance for the type constraint is found.
  4. Import cats.implicits.* and save, the compiler should compile fine now.
  5. Try to get completions for the type constraint above, the completions usually time out for it.
  6. If you remove the implicit import, and save a couple times, the completions work as normal but then the compiler errors out due to no given instances being found.

Expected behavior

Having the import should not impact the speed or working of autocompletions.

Operating system

Linux

Editor/Extension

Emacs (lsp-metals)

Version of Metals

v1.2.0

Extra context or search terms

No response

@tgodzik tgodzik added Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream labels Jan 29, 2024
@tgodzik
Copy link
Contributor

tgodzik commented Jan 29, 2024

Looks like this is the same issue as I raised in scala/scala3#19320

@tgodzik
Copy link
Contributor

tgodzik commented Feb 6, 2024

This is fixed upstream and will be available in 3.4.1 and 3.3.3

@tgodzik tgodzik closed this as completed Feb 6, 2024
@kasiaMarek kasiaMarek added this to the Metals v1.2.1 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scala 3 Generic ticket relating to Scala 3 upstream-fix-needed Waiting on a fix upstream
Projects
None yet
Development

No branches or pull requests

3 participants