You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Lambda syntax for Single Abstract Method (SAM) types improves interoperability with Java libraries, and is more concise than the alternative syntax, but it's cumbersome to change from one to the other manually.
I'd just like to point out that this isn't a purely syntactic refactor unfortunately: if the type annotation isn't present, Scala can't tell what interface is necessary.
I think this is doable via the presentation compiler, the problem is detecting the places where it can be done. Would be great if the presentation compiler returned a warning where it can be converted.
Is your feature request related to a problem? Please describe.
Lambda syntax for Single Abstract Method (SAM) types improves interoperability with Java libraries, and is more concise than the alternative syntax, but it's cumbersome to change from one to the other manually.
Describe the solution you'd like
Taking an example from Stackoverflow, given a trait like this:
And an expression like this:
I'd like Metals to be able to refactor the expression to produce this:
Describe alternatives you've considered
This can be done manually, but it's more time-consuming.
Additional contex
No response
Search terms
SAM Java refactor
The text was updated successfully, but these errors were encountered: