a more scala-friendly source-level accessibility check

This commit is contained in:
peter
2012-02-17 19:20:31 +01:00
parent a9bf3ffe37
commit 43e5f35bd8
2 changed files with 8 additions and 5 deletions
@@ -903,9 +903,12 @@ public class JavaCompletionUtil {
}
if (pkgContext) {
PsiFile classFile = psiClass.getContainingFile();
if (classFile instanceof PsiClassOwner && StringUtil.isEmpty(((PsiClassOwner)classFile).getPackageName())) {
return false;
PsiClass topLevel = PsiUtil.getTopLevelClass(psiClass);
if (topLevel != null) {
String fqName = topLevel.getQualifiedName();
if (fqName != null && StringUtil.isEmpty(StringUtil.getPackageName(fqName))) {
return false;
}
}
}