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
When refactoring > extract to a method..., the default method name is extracted. In similar situations, Intellij IDEA is smarter and can propose a method name based on context.
In this exemple:
varparts = newString[]{"Hello", "Java", "16"};
// start selecting line from belowvargreeting = newStringBuilder();
for(inti = 0; i < parts.length; i++) {
varpart = parts[i];
if (i >0) {
greeting.append(" ");
}
greeting.append(part);
}
// end selection including previous closing bracketSystem.out.println(greeting);
In vscode-java, extraction will create:
vargreeting = extracted(parts);
in IntelliJ, you'll get the choice between getStringBuilder, getBuilder, getGreeting by default.
I don't think we can propose several names in vscode-java, but it'd be nice to, at least in that case, propose getGreeting by default.
@JessicaJHee , I started something with rgrunber/eclipse.jdt.ls@cc7273d . If it makes sense, you should make a PR with that and then add tests / react in ExtractMethodTest .
When refactoring > extract to a method..., the default method name is
extracted
. In similar situations, Intellij IDEA is smarter and can propose a method name based on context.In this exemple:
In vscode-java, extraction will create:
in IntelliJ, you'll get the choice between
getStringBuilder
,getBuilder
,getGreeting
by default.I don't think we can propose several names in vscode-java, but it'd be nice to, at least in that case, propose
getGreeting
by default.cc @maxandersen
The text was updated successfully, but these errors were encountered: