Is your feature request related to a problem? Please describe.
When implementing an abstract class or trait, it's useful to complete all the abstract members with stubs.
Describe the solution you'd like
Given something like
trait A {
def someMethod(a: String): Int
def someOtherMethod(b: String): String
}
class B extends A {
// ^^^^^^^^^^^^^^^^^
// Error: class B needs to be abstract, blabla...
}
I would like a code action on B that allows to quickly implement all abstract members with stubs, resulting in:
class B extends A {
override def someMethod(a: String): Int = ???
override def someOtherMethod(b: String): String = ???
}
Describe alternatives you've considered
Mostly two alternatives exist:
Additional context
I think this should be a "quickfix" code action in response to the specific compiler error.
Also, I believe it makes sense to have both the completion and the code action:
Search terms:
abstract members, traits, interface
I'm working on this, and it's roughly working.馃檶 Though there're still some to-dos before finishing up this, I think I can submit a PR maybe next weekend.
Quick questions
WorkspaceEdit instead of "Command"?
Thank you so much for working on these PRs https://github.com/scalameta/metals/pull/1031 and https://github.com/scalameta/metals/pull/1065 @ckipp01 @gabro ! 馃憤
I could follow those implementations and re-use a lot of logic!
Looks amazing @tanishiking !
Any thoughts on "title" (which is "Implement All Bar" for now in the screen-record below)
I would try to use similar language as IntelliJ

Is it ok to return WorkspaceEdit instead of "Command"?
I think it's better to return a command if it's not too much work. iirc, some editor clients don't support support yet code actions that return edits 馃
I'm really looking forward to use this feature! 馃榿 Since we added code actions to insert imports I've found myself trying to fix this error by muscle memory only to be sad realizing it's not implemented yet 馃槄
Wow, that looks great! 馃槏
In general I think it鈥檚 fine to return a workspace edit:
Quick question: are you also handling the case in which some methods are implemented and some others are not?
Thank you for quick feedback @olafurpg @gabro 馃槃
I'm also looking for this feature! (because I usually write TypeScript at work and I got used to implementing all missing methods in this way (code action)).
I would try to use similar language as IntelliJ
Sounds good!
I think it's better to return a command if it's not too much work. iirc, some editor clients don't support support yet code actions that return edits 馃
I haven鈥檛 yet found a client that doesn鈥檛 support workspace edits (I may be wrong I鈥檒l check again)
performance wise this is the same as the analogous completion so we鈥檙e ok, I think
OK, I'll go with the edit for the first implementation! (I'll also check some LSP clients).
are you also handling the case in which some methods are implemented and some others are not?
Yes:+1: But there could be some problems in the more complex cases (especially around a range of TextEdit), I'm gonna test in various situations.

Most helpful comment
I'm working on this, and it's roughly working.馃檶 Though there're still some to-dos before finishing up this, I think I can submit a PR maybe next weekend.
Quick questions
WorkspaceEditinstead of "Command"?Thank you so much for working on these PRs https://github.com/scalameta/metals/pull/1031 and https://github.com/scalameta/metals/pull/1065 @ckipp01 @gabro ! 馃憤
I could follow those implementations and re-use a lot of logic!