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

Import missing implicits #192

Closed
gabro opened this issue Mar 1, 2021 · 1 comment
Closed

Import missing implicits #192

gabro opened this issue Mar 1, 2021 · 1 comment

Comments

@gabro
Copy link
Member

gabro commented Mar 1, 2021

Is your feature request related to a problem? Please describe.
It's often the case that a compilation error is caused by a missing implicit in scope (e.g. instance of a typeclass or implicit conversions used for syntax).
Right now the only way to fix this issue when working with Metals is to manually discover the appropriate instance and import it.

Describe the solution you'd like
I would like for Metals to suggest possible imports of implicits that might solve the issue and automatically insert the import with a code-action.

Scala 3 already provides this info in the error message, so specifically for Scala 3 it would be cool to contribute a feature to the dotty PC that would expose it to the language server in a structured way.
For Scala 2 it might be possible to create an index based on SemanticDB signatures, but that's a far guess.

I would be happy enough if this worked with Scala 3 :-)

Describe alternatives you've considered
Manually doing so.

Additional context
AFAIK IntelliJ has a similar feature.

Search terms:
implicits imports givens

@gabro
Copy link
Member Author

gabro commented Mar 1, 2021

I just realized this existed already:

#141

and

#105

closing in favor of those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant