scalameta / metals-feature-requests

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

Completion snippet when extending an abstract class or trait with members #369

Open ckipp01 opened 10 months ago

ckipp01 commented 10 months ago

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

Let's say you have any interface of sorts like this:

trait Foo:
  def a: Int

When you are coding and you create an instance extending this you trigger a completion here:

class Bar extends Fo@@

You'll get a completion for Foo. However, if you then save, you are in a broken state because a must be implemented.

Describe the solution you'd like

I'd love for a completion option that would give me the following as a completion:

class Bar extends Foo:
  override def a: Int = ???

Describe alternatives you've considered

What I always currently do is save, go to the error, and then trigger a code action to implement all members. However it'd be great to just have this all down with one step.

Additional context

No response

Search terms

abstract members, completion, snippets