mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
SortContentAction: append all children between method expression and expression list for method call (IDEA-218735)
GitOrigin-RevId: 0cc643fdbdac51be763d51bf53b28d48f371e460
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6c95a4e8ee
commit
6f4c0d38cf
@@ -804,7 +804,11 @@ public class SortContentAction extends PsiElementBaseIntentionAction {
|
||||
if (call == null) return;
|
||||
String methodName = call.getMethodExpression().getText();
|
||||
if (methodName == null) return;
|
||||
StringBuilder sb = new StringBuilder(methodName);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (PsiElement child : call.getChildren()) {
|
||||
if (child == expressionList) break;
|
||||
sb.append(child.getText());
|
||||
}
|
||||
PsiExpression firstVararg = context.myVarargArguments.get(0);
|
||||
PsiElement child = expressionList.getFirstChild();
|
||||
while(child != firstVararg) {
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Sort content" "true"
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
class C {
|
||||
List<String> foo() {
|
||||
return Arrays.asList//a
|
||||
//b
|
||||
("ReSharper OSX.xml", "ReSharper.xml", "Xcode.xml");
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Sort content" "true"
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
class C {
|
||||
List<String> foo() {
|
||||
return Arrays.asList//a
|
||||
//b
|
||||
("Xco<caret>de.xml", "ReSharper.xml", "ReSharper OSX.xml");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user