Generate Injectors: simplify and remove redundancy

This commit is contained in:
Pavel V. Talanov
2014-02-13 16:01:12 +04:00
parent 00cbd11b84
commit 6c77ea91c5
13 changed files with 372 additions and 487 deletions
@@ -92,15 +92,16 @@ public class BuiltInsReferenceResolver extends AbstractProjectComponent {
Predicates.<PsiFile>alwaysFalse(), true, false, Collections.<AnalyzerScriptParameter>emptyList());
ModuleDescriptorImpl module = new ModuleDescriptorImpl(
Name.special("<fake_module>"), Collections.<ImportPath>emptyList(), PlatformToKotlinClassMap.EMPTY);
BindingTraceContext trace = new BindingTraceContext();
InjectorForTopDownAnalyzerBasic injector = new InjectorForTopDownAnalyzerBasic(
myProject, topDownAnalysisParameters, new BindingTraceContext(), module, PlatformToKotlinClassMap.EMPTY);
myProject, topDownAnalysisParameters, trace, module, PlatformToKotlinClassMap.EMPTY);
TopDownAnalyzer analyzer = injector.getTopDownAnalyzer();
analyzer.analyzeFiles(jetBuiltInsFiles, Collections.<AnalyzerScriptParameter>emptyList());
builtinsPackageFragment = analyzer.getPackageFragmentProvider().getOrCreateFragment(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME);
builtInsSources = Sets.newHashSet(jetBuiltInsFiles);
bindingContext = injector.getBindingTrace().getBindingContext();
bindingContext = trace.getBindingContext();
}
};