Do not create TopDownAnalysisContext in injectors
This commit is contained in:
@@ -23,7 +23,6 @@ import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
|
||||
import org.jetbrains.jet.lang.resolve.TopDownAnalyzer;
|
||||
import org.jetbrains.jet.lang.resolve.TopDownAnalysisContext;
|
||||
import org.jetbrains.jet.lang.resolve.MutablePackageFragmentProvider;
|
||||
import org.jetbrains.jet.lang.types.DependencyClassByQualifiedNameResolverDummyImpl;
|
||||
import org.jetbrains.jet.lang.resolve.BodyResolver;
|
||||
@@ -67,7 +66,6 @@ public class InjectorForTopDownAnalyzerForJs {
|
||||
private final ModuleDescriptorImpl moduleDescriptor;
|
||||
private final PlatformToKotlinClassMap platformToKotlinClassMap;
|
||||
private final TopDownAnalyzer topDownAnalyzer;
|
||||
private final TopDownAnalysisContext topDownAnalysisContext;
|
||||
private final MutablePackageFragmentProvider mutablePackageFragmentProvider;
|
||||
private final DependencyClassByQualifiedNameResolverDummyImpl dependencyClassByQualifiedNameResolverDummy;
|
||||
private final BodyResolver bodyResolver;
|
||||
@@ -111,7 +109,6 @@ public class InjectorForTopDownAnalyzerForJs {
|
||||
this.moduleDescriptor = moduleDescriptor;
|
||||
this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
|
||||
this.topDownAnalyzer = new TopDownAnalyzer();
|
||||
this.topDownAnalysisContext = new TopDownAnalysisContext(topDownAnalysisParameters);
|
||||
this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(getModuleDescriptor());
|
||||
this.dependencyClassByQualifiedNameResolverDummy = new DependencyClassByQualifiedNameResolverDummyImpl();
|
||||
this.bodyResolver = new BodyResolver();
|
||||
@@ -187,7 +184,7 @@ public class InjectorForTopDownAnalyzerForJs {
|
||||
expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
|
||||
expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
|
||||
expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
|
||||
expressionTypingComponents.setGlobalContext(topDownAnalysisContext);
|
||||
expressionTypingComponents.setGlobalContext(topDownAnalysisParameters);
|
||||
expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
|
||||
|
||||
forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
|
||||
@@ -264,8 +261,4 @@ public class InjectorForTopDownAnalyzerForJs {
|
||||
return this.topDownAnalyzer;
|
||||
}
|
||||
|
||||
public TopDownAnalysisContext getTopDownAnalysisContext() {
|
||||
return this.topDownAnalysisContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.analyzer.AnalyzerFacadeForEverything;
|
||||
import org.jetbrains.jet.di.InjectorForLazyResolve;
|
||||
import org.jetbrains.jet.context.ContextPackage;
|
||||
import org.jetbrains.jet.context.GlobalContextImpl;
|
||||
import org.jetbrains.jet.di.InjectorForLazyResolve;
|
||||
import org.jetbrains.jet.di.InjectorForTopDownAnalyzerForJs;
|
||||
import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
|
||||
import org.jetbrains.jet.lang.descriptors.DependencyKind;
|
||||
@@ -37,7 +37,6 @@ import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.*;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.declarations.FileBasedDeclarationProviderFactory;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.k2js.config.Config;
|
||||
@@ -109,9 +108,10 @@ public final class AnalyzerFacadeForJS {
|
||||
Collection<JetFile> allFiles = libraryModule != null ?
|
||||
files :
|
||||
Config.withJsLibAdded(files, config);
|
||||
injector.getTopDownAnalyzer().analyzeFiles(allFiles, Collections.<AnalyzerScriptParameter>emptyList());
|
||||
TopDownAnalysisContext topDownAnalysisContext =
|
||||
injector.getTopDownAnalyzer().analyzeFiles(allFiles, Collections.<AnalyzerScriptParameter>emptyList());
|
||||
BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ?
|
||||
new CachedBodiesResolveContext(injector.getTopDownAnalysisContext()) :
|
||||
new CachedBodiesResolveContext(topDownAnalysisContext) :
|
||||
null;
|
||||
return AnalyzeExhaust.success(trace.getBindingContext(), bodiesResolveContext, owner);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user