Use special index to record files corresponding to static facade classes.

This commit is contained in:
Dmitry Petrov
2015-08-06 10:44:27 +03:00
committed by Michael Bogdanov
parent ab8b5d05ed
commit 83336553df
7 changed files with 96 additions and 11 deletions
@@ -214,8 +214,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
@NotNull
@Override
public Collection<PsiClass> getFacadeClasses(@NotNull FqName facadeFqName, @NotNull GlobalSearchScope scope) {
Collection<JetFile> filesInPackage = findFilesForPackage(facadeFqName.parent(), scope);
List<JetFile> filesForFacade = PackagePartClassUtils.getFilesForFacade(facadeFqName, filesInPackage);
Collection<JetFile> filesForFacade = findFilesForFacade(facadeFqName, scope);
if (filesForFacade.isEmpty()) return Collections.emptyList();
//noinspection RedundantTypeArguments
@@ -226,6 +225,8 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
@NotNull
@Override
public Collection<JetFile> findFilesForFacade(@NotNull FqName facadeFqName, @NotNull GlobalSearchScope scope) {
// TODO We need a way to plug some platform-dependent stuff into LazyTopDownAnalyzer.
// It already performs some ad hoc stuff for packages->files mapping, anyway.
Collection<JetFile> filesInPackage = findFilesForPackage(facadeFqName.parent(), scope);
return PackagePartClassUtils.getFilesForFacade(facadeFqName, filesInPackage);
}