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

Create new symbol action should allow you to create a method #298

Open
ckipp01 opened this issue Sep 1, 2022 · 1 comment
Open

Create new symbol action should allow you to create a method #298

ckipp01 opened this issue Sep 1, 2022 · 1 comment

Comments

@ckipp01
Copy link
Member

ckipp01 commented Sep 1, 2022

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

Sometimes when I'm writing code I'm in this situation:

def doThing(a: Int, b: Int) = {
  doOtherStuff(a) // this will error because `doOtherStuff` doesn't exist
}

In this situations you can trigger a code action for doOtherStuff and it will show you the "Create new symbol 'doOtherStuff'" action. However, if you select that all the options are creating another file or a companion object, whereas I want doOtherStuff to be a method.

Describe the solution you'd like

I'd like another option to be offered, maybe just "method". And if I select it, the code I'd end up with is:

def doOtherStuff(a: Int) = ???

def doThing(a: Int, b: Int) = {
  doOtherStuff(a)
}

Describe alternatives you've considered

Doing this by hand

Additional context

No response

Search terms

create method

@tgodzik
Copy link
Contributor

tgodzik commented Sep 2, 2022

Thanks for reporting! I've actually been working on it in https://github.com/tgodzik/metals/tree/infer-method 😅

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

2 participants