IDEA-86810 Find Usages not finding usages when I do it on decompiled stub source

This commit is contained in:
peter
2012-06-04 20:20:21 +02:00
parent 0e35f229a4
commit fa4c2a6916
3 changed files with 18 additions and 3 deletions
@@ -0,0 +1,5 @@
import javax.swing.JLabel;
public class Usage {
JLabel s;
}
@@ -89,6 +89,12 @@ public class FindUsagesTest extends PsiTestCase{
assertEquals(1, ReferencesSearch.search(method).findAll().size());
}
public void testLibraryClassUsageFromDecompiledSource() {
PsiElement decompiled =
((PsiCompiledElement)myJavaFacade.findClass("javax.swing.JLabel", GlobalSearchScope.allScope(myProject))).getMirror();
assertEquals(2, ReferencesSearch.search(decompiled).findAll().size());
}
public void testImplicitConstructorUsage() throws Throwable {
PsiMethod[] ctrs = myJavaFacade.findClass("Foo", GlobalSearchScope.allScope(myProject)).getConstructors();
PsiMethod method = ctrs[0];