mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
goto implementation: when no implementations are possible (e.g. static method), include self into presentation
This commit is contained in:
@@ -249,6 +249,18 @@ public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCas
|
||||
assertEquals("A", aClass.getName());
|
||||
}
|
||||
|
||||
public void testStaticMethodReference() {
|
||||
PsiFile file = myFixture.addFileToProject("Foo.java",
|
||||
"class C {\n" +
|
||||
" static void a(){}\n" +
|
||||
" {a<caret>();}" +
|
||||
"}");
|
||||
myFixture.configureFromExistingVirtualFile(file.getVirtualFile());
|
||||
|
||||
final PsiElement[] impls = getTargets(file);
|
||||
assertEquals(1, impls.length);
|
||||
}
|
||||
|
||||
private PsiElement[] getTargets(PsiFile file) {
|
||||
GotoTargetHandler.GotoData gotoData = CodeInsightTestUtil.gotoImplementation(myFixture.getEditor(), file);
|
||||
assertNotNull(gotoData);
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ public class ImplementationSearcher {
|
||||
return null;
|
||||
}
|
||||
PsiElement foundElement = result[0];
|
||||
return foundElement != null ? new PsiElement[] {foundElement} : null;
|
||||
return foundElement != null ? new PsiElement[] {foundElement} : PsiElement.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
protected boolean canShowPopupWithOneItem(PsiElement element) {
|
||||
|
||||
Reference in New Issue
Block a user