add android completion tests
- add android plugin test classes as test library - add base android test cases for kotlin, setting up android facet and sdk
This commit is contained in:
committed by
Yan Zhulanow
parent
08245ffe1c
commit
adbe9afd4a
@@ -34,6 +34,11 @@ import org.jetbrains.kotlin.analyzer.ModuleContent
|
||||
import org.jetbrains.kotlin.di.InjectorForLazyResolveWithJava
|
||||
import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.jet.lang.psi.JetFile
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import org.jetbrains.jet.lang.resolve.android.AndroidUIXmlProcessor
|
||||
import java.util.ArrayList
|
||||
import org.jetbrains.jet.lang.resolve.android.searchAndAddAndroidDeclarations
|
||||
|
||||
public class JvmResolverForModule(
|
||||
override val lazyResolveSession: ResolveSession,
|
||||
@@ -56,8 +61,10 @@ public object JvmAnalyzerFacade : AnalyzerFacade<JvmResolverForModule, JvmPlatfo
|
||||
resolverForProject: ResolverForProject<M, JvmResolverForModule>
|
||||
): JvmResolverForModule {
|
||||
val (syntheticFiles, moduleContentScope) = moduleContent
|
||||
val filesToAnalyze = searchAndAddAndroidDeclarations(project, syntheticFiles)
|
||||
val declarationProviderFactory = DeclarationProviderFactoryService.createDeclarationProviderFactory(
|
||||
project, globalContext.storageManager, syntheticFiles, if (moduleInfo.isLibrary) GlobalSearchScope.EMPTY_SCOPE else moduleContentScope
|
||||
project, globalContext.storageManager, filesToAnalyze,
|
||||
if (moduleInfo.isLibrary) GlobalSearchScope.EMPTY_SCOPE else moduleContentScope
|
||||
)
|
||||
|
||||
val moduleClassResolver = ModuleClassResolverImpl { javaClass ->
|
||||
|
||||
-9
@@ -17,13 +17,11 @@
|
||||
package org.jetbrains.kotlin.resolve.jvm;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.resolve.android.AndroidUIXmlProcessor;
|
||||
import org.jetbrains.kotlin.analyzer.AnalysisResult;
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
import org.jetbrains.kotlin.context.GlobalContext;
|
||||
@@ -174,11 +172,4 @@ public enum TopDownAnalyzerFacadeForJVM {
|
||||
module.seal();
|
||||
return module;
|
||||
}
|
||||
|
||||
private static Collection<JetFile> searchAndAddAndroidDeclarations(Project project, Collection<JetFile> files) {
|
||||
AndroidUIXmlProcessor parser = ServiceManager.getService(project, AndroidUIXmlProcessor.class);
|
||||
JetFile file = parser.parseToPsi(project);
|
||||
if (file != null) files.add(file);
|
||||
return files;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user