mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 20:39:40 +07:00
IDEA-70184 Class F cannot be referenced from static context error after Smart Completion invocation
This commit is contained in:
@@ -116,7 +116,8 @@ public class JavaInheritorsGetter extends CompletionProvider<CompletionParameter
|
||||
final PsiClass psiClass = PsiUtil.resolveClassInType(type);
|
||||
if (psiClass == null) return null;
|
||||
|
||||
if (HighlightClassUtil.checkCreateInnerClassFromStaticContext(parameters.getPosition(), null, psiClass) != null) {
|
||||
if ((parameters.getInvocationCount() < 2 || psiClass instanceof PsiCompiledElement) &&
|
||||
HighlightClassUtil.checkCreateInnerClassFromStaticContext(parameters.getPosition(), null, psiClass) != null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
public class Test{
|
||||
|
||||
public class F {}
|
||||
|
||||
public int x(F f) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Test test = new Test();
|
||||
test.x(new F())<caret>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
public class Test{
|
||||
|
||||
public class F {}
|
||||
|
||||
public int x(F f) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Test test = new Test();
|
||||
test.x(new <caret>);
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,7 @@ public class SecondSmartTypeCompletionTest extends LightCompletionTestCase {
|
||||
|
||||
public void testNoObjectMethodsAsFirstPart() throws Throwable { doTest(); }
|
||||
public void testGetClassLoader() throws Throwable { doTest(); }
|
||||
public void testNewStaticProblem() throws Throwable { doTest(); }
|
||||
|
||||
public void testChainingPerformance() throws Throwable {
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
Reference in New Issue
Block a user