mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
treeWalkUp: stop at member level to avoid skipping anonymous classes
This commit is contained in:
@@ -741,7 +741,7 @@ public class LambdaUtil {
|
||||
break;
|
||||
}
|
||||
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class);
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiMember.class);
|
||||
if (psiCall == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
class It {
|
||||
|
||||
Function<It, TextRange> f = new Function<It, TextRange>() {
|
||||
@Override
|
||||
public TextRange apply(final It it) {
|
||||
long offset = 9;
|
||||
return offset == 0 ? it.range() : it.range().shiftRight((int) offset);
|
||||
}
|
||||
};
|
||||
|
||||
class TextRange {
|
||||
public TextRange shiftRight(final int offset) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
TextRange range() {
|
||||
return new TextRange();
|
||||
}
|
||||
|
||||
}
|
||||
+1
@@ -71,6 +71,7 @@ public class LambdaRedundantCastTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
public void testEnumConstantWithFunctionalExpressionArg() throws Exception { doTest(); }
|
||||
public void testSecondLevelOverload() throws Exception { doTest(); }
|
||||
public void testStopAtMemberLevelDuringWalkUp() throws Exception { doTest(); }
|
||||
|
||||
public void testIDEA154861() { doTest();}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user