mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[extract method] fix the flaky parameter name suggestion
GitOrigin-RevId: 1f278179d51e1dac3cb2992a3ec85c98ac208b31
This commit is contained in:
committed by
intellij-monorepo-bot
parent
91314059d0
commit
360db06c21
+5
-2
@@ -179,8 +179,11 @@ public class ParametersFolder {
|
||||
|
||||
List<PsiExpression> expressions = null;
|
||||
Boolean arrayAccess = null;
|
||||
for (PsiReference reference : ReferencesSearch.search(var, scope)) {
|
||||
PsiElement expression = reference.getElement();
|
||||
List<PsiElement> refExpressions = ReferencesSearch.search(var, scope).findAll().stream()
|
||||
.map(ref -> ref.getElement())
|
||||
.sorted(Comparator.comparingInt(element -> element.getTextRange().getStartOffset()))
|
||||
.toList();
|
||||
for (PsiElement expression : refExpressions) {
|
||||
if (expressions == null) {
|
||||
expressions = new ArrayList<>();
|
||||
while (expression instanceof PsiExpression) {
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ class Test {
|
||||
System.out.println(s1);
|
||||
}
|
||||
|
||||
private String newMethod(String s2, String s11) {
|
||||
System.out.println(s2);
|
||||
private String newMethod(String x, String s11) {
|
||||
System.out.println(x);
|
||||
return s11;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user