mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
IDEA-91371
This commit is contained in:
@@ -97,7 +97,7 @@ public class InlineLocalHandler extends JavaInlineActionHandler {
|
||||
if (parentPsiClass == containingClass) {
|
||||
if (innerClass instanceof PsiLambdaExpression) {
|
||||
if (PsiTreeUtil.isAncestor(innerClass, local, false)) {
|
||||
innerClassesWithUsages.add(((PsiLambdaExpression)innerClass).getBody());
|
||||
innerClassesWithUsages.add(element);
|
||||
} else {
|
||||
innerClassesWithUsages.add(innerClass);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
{
|
||||
Runnable x = () -> {
|
||||
String hello = new String("hello");
|
||||
System.out.println(<caret>hello);
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
{
|
||||
Runnable x = () -> {
|
||||
System.out.println(new String("hello"));
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -161,6 +161,10 @@ public class InlineLocalTest extends LightCodeInsightTestCase {
|
||||
public void testLocalVarInsideLambdaBody1() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testLocalVarInsideLambdaBody2() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testLocalVarInsideLambdaBodyWriteUsage() throws Exception {
|
||||
doTest(true, "Cannot perform refactoring.\n" +
|
||||
|
||||
Reference in New Issue
Block a user