scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Code action to import extension method or implicit class. #368

Open tgodzik opened 9 months ago

tgodzik commented 9 months ago

Is your feature request related to a problem? Please describe.

Currently, you can autocomplete extensions for Scala 3 and probably soon for Scala 2, however, it's not possible to automatically import it via quick fix similar to classes. It should be quite easy to add it to the existing code action.

Describe the solution you'd like

Extend the current code action to also work with extension methods, when not found.

Describe alternatives you've considered

You can autocomplete them at least in Scala 3.

Additional context

https://github.com/scalameta/metals/pull/6002

Search terms

auto import extension implicit class

brndt commented 1 month ago

Would be amazing to have it!