CliLightClassGenerationSupport: correctly find facade files

This fixes a problem where JvmPackageName annotation could force file
    facades to be in the package different to declared kotlin package
This commit is contained in:
Pavel V. Talanov
2018-03-02 18:46:55 +01:00
parent 00ee5e3d16
commit 27d7bb595f
6 changed files with 66 additions and 18 deletions
@@ -202,6 +202,7 @@ public class JavaElementFinder extends PsiElementFinder implements KotlinFinderM
@NotNull
public PsiFile[] getPackageFiles(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
FqName packageFQN = new FqName(psiPackage.getQualifiedName());
// TODO: this does not take into account JvmPackageName annotation
Collection<KtFile> result = lightClassGenerationSupport.findFilesForPackage(packageFQN, scope);
return result.toArray(new PsiFile[result.size()]);
}