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

IntelliJ-like super-completion #291

Open
channingwalton opened this issue Jul 28, 2022 · 6 comments
Open

IntelliJ-like super-completion #291

channingwalton opened this issue Jul 28, 2022 · 6 comments

Comments

@channingwalton
Copy link
Contributor

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

When completing its hard to see what the parameters are for constructors or fields. Metals could provide support like Intellij's super completion.

Describe the solution you'd like

For example, given case class Foo(a: String, b: Int), a code action on Foo(<cursor>) gives Foo(a = ???, b = ???)

Describe alternatives you've considered

Only vim specific hacks but no idea how.

Additional contex

See https://blog.jetbrains.com/idea/2009/09/super-method-completion/

Search terms

super completion action

@tgodzik
Copy link
Contributor

tgodzik commented Jul 28, 2022

Thanks for reporting, this should actually work already, but might not be super obvious. If you write a parameter name the last option should be Autofill with default values option.

metals-sample-1658997825800

It's not yet available for Scala 3

@ckipp01
Copy link
Member

ckipp01 commented Jul 28, 2022

Dang! This was my bad I told him to create it. I had no idea this existed. Nice!

@tgodzik
Copy link
Contributor

tgodzik commented Jul 28, 2022

Dang! This was my bad I told him to create it. I had no idea this existed. Nice!

It's kind of hard to notice since we didn't want it popping as the first thing. There was a worry that this might lead to more errors, since we try to fill in a value if there is only one of that type in scope.

@ckipp01
Copy link
Member

ckipp01 commented Jul 28, 2022

This also sort of requires you to know what the param is. It'd be cool to not have to know and instead trigger a code action with nothing in the params yet and get this as an option. Maybe we can leave this open for the code action option?

@tgodzik
Copy link
Contributor

tgodzik commented Jul 28, 2022

This also sort of requires you to know what the param is. It'd be cool to not have to know and instead trigger a code action with nothing in the params yet and get this as an option. Maybe we can leave this open for the code action option?

That should fine, sure!

@channingwalton
Copy link
Contributor Author

Thanks all

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

3 participants