mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
change signature: do not add comma if only one parameter added
This commit is contained in:
+15
-13
@@ -72,19 +72,21 @@ public class ChangeSignatureUtil {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PsiElement anchor = null;
|
||||
if (index == 0) {
|
||||
anchor = list.getFirstChild();
|
||||
} else {
|
||||
anchor = elements.get(index - 1);
|
||||
}
|
||||
final PsiElement psi = Factory
|
||||
.createSingleLeafElement(JavaTokenType.COMMA, ",", 0, 1, SharedImplUtil.findCharTableByTree(list.getNode()), list.getManager())
|
||||
.getPsi();
|
||||
if (anchor != null) {
|
||||
list.addAfter(psi, anchor);
|
||||
} else {
|
||||
list.add(psi);
|
||||
if (newElements.size() > 1) {
|
||||
PsiElement anchor;
|
||||
if (index == 0) {
|
||||
anchor = list.getFirstChild();
|
||||
} else {
|
||||
anchor = elements.get(index - 1);
|
||||
}
|
||||
final PsiElement psi = Factory
|
||||
.createSingleLeafElement(JavaTokenType.COMMA, ",", 0, 1, SharedImplUtil.findCharTableByTree(list.getNode()), list.getManager())
|
||||
.getPsi();
|
||||
if (anchor != null) {
|
||||
list.addAfter(psi, anchor);
|
||||
} else {
|
||||
list.add(psi);
|
||||
}
|
||||
}
|
||||
}
|
||||
index++;
|
||||
|
||||
Reference in New Issue
Block a user