001 /* 002 * Copyright 2010-2014 JetBrains s.r.o. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.jetbrains.jet.di; 018 019 import com.intellij.openapi.project.Project; 020 import org.jetbrains.jet.context.GlobalContext; 021 import org.jetbrains.jet.storage.StorageManager; 022 import org.jetbrains.jet.lang.resolve.lazy.KotlinCodeAnalyzer; 023 import org.jetbrains.jet.lang.resolve.BindingTrace; 024 import org.jetbrains.jet.lang.resolve.AdditionalCheckerProvider; 025 import org.jetbrains.jet.lang.types.DynamicTypesSettings; 026 import org.jetbrains.jet.lang.descriptors.ModuleDescriptor; 027 import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; 028 import org.jetbrains.jet.lang.PlatformToKotlinClassMap; 029 import org.jetbrains.jet.lang.resolve.LazyTopDownAnalyzer; 030 import org.jetbrains.jet.lang.resolve.BodyResolver; 031 import org.jetbrains.jet.lang.resolve.AnnotationResolver; 032 import org.jetbrains.jet.lang.resolve.calls.CallResolver; 033 import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver; 034 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices; 035 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents; 036 import org.jetbrains.jet.lang.types.expressions.ControlStructureTypingUtils; 037 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils; 038 import org.jetbrains.jet.lang.types.expressions.ForLoopConventionsChecker; 039 import org.jetbrains.jet.lang.reflect.ReflectionTypes; 040 import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver; 041 import org.jetbrains.jet.lang.resolve.DescriptorResolver; 042 import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver; 043 import org.jetbrains.jet.lang.resolve.TypeResolver; 044 import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver; 045 import org.jetbrains.jet.lang.resolve.TypeResolver.FlexibleTypeCapabilitiesProvider; 046 import org.jetbrains.jet.context.LazinessToken; 047 import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider; 048 import org.jetbrains.jet.lang.resolve.PartialBodyResolveProvider; 049 import org.jetbrains.jet.lang.resolve.calls.CallCompleter; 050 import org.jetbrains.jet.lang.resolve.calls.CandidateResolver; 051 import org.jetbrains.jet.lang.resolve.calls.tasks.TaskPrioritizer; 052 import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer; 053 import org.jetbrains.jet.lang.resolve.DeclarationsChecker; 054 import org.jetbrains.jet.lang.resolve.ModifiersChecker; 055 import org.jetbrains.jet.lang.resolve.FunctionAnalyzerExtension; 056 import org.jetbrains.jet.lang.resolve.ScriptBodyResolver; 057 import org.jetbrains.jet.lang.resolve.DeclarationResolver; 058 import org.jetbrains.jet.lang.resolve.ImportsResolver; 059 import org.jetbrains.jet.lang.psi.JetImportsFactory; 060 import org.jetbrains.jet.lang.resolve.OverloadResolver; 061 import org.jetbrains.jet.lang.resolve.OverrideResolver; 062 import org.jetbrains.jet.lang.resolve.TopDownAnalyzer; 063 import org.jetbrains.jet.lang.resolve.MutablePackageFragmentProvider; 064 import org.jetbrains.jet.lang.resolve.TypeHierarchyResolver; 065 import org.jetbrains.jet.lang.resolve.ScriptHeaderResolver; 066 import org.jetbrains.jet.lang.resolve.varianceChecker.VarianceChecker; 067 import org.jetbrains.annotations.NotNull; 068 import javax.annotation.PreDestroy; 069 070 /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */ 071 @SuppressWarnings("all") 072 public class InjectorForLazyBodyResolve { 073 074 private final Project project; 075 private final GlobalContext globalContext; 076 private final StorageManager storageManager; 077 private final KotlinCodeAnalyzer analyzer; 078 private final BindingTrace bindingTrace; 079 private final AdditionalCheckerProvider additionalCheckerProvider; 080 private final DynamicTypesSettings dynamicTypesSettings; 081 private final ModuleDescriptor moduleDescriptor; 082 private final KotlinBuiltIns kotlinBuiltIns; 083 private final PlatformToKotlinClassMap platformToKotlinClassMap; 084 private final LazyTopDownAnalyzer lazyTopDownAnalyzer; 085 private final BodyResolver bodyResolver; 086 private final AnnotationResolver annotationResolver; 087 private final CallResolver callResolver; 088 private final ArgumentTypeResolver argumentTypeResolver; 089 private final ExpressionTypingServices expressionTypingServices; 090 private final ExpressionTypingComponents expressionTypingComponents; 091 private final ControlStructureTypingUtils controlStructureTypingUtils; 092 private final ExpressionTypingUtils expressionTypingUtils; 093 private final ForLoopConventionsChecker forLoopConventionsChecker; 094 private final ReflectionTypes reflectionTypes; 095 private final CallExpressionResolver callExpressionResolver; 096 private final DescriptorResolver descriptorResolver; 097 private final DelegatedPropertyResolver delegatedPropertyResolver; 098 private final TypeResolver typeResolver; 099 private final QualifiedExpressionResolver qualifiedExpressionResolver; 100 private final FlexibleTypeCapabilitiesProvider flexibleTypeCapabilitiesProvider; 101 private final LazinessToken lazinessToken; 102 private final CallResolverExtensionProvider callResolverExtensionProvider; 103 private final PartialBodyResolveProvider partialBodyResolveProvider; 104 private final CallCompleter callCompleter; 105 private final CandidateResolver candidateResolver; 106 private final TaskPrioritizer taskPrioritizer; 107 private final ControlFlowAnalyzer controlFlowAnalyzer; 108 private final DeclarationsChecker declarationsChecker; 109 private final ModifiersChecker modifiersChecker; 110 private final FunctionAnalyzerExtension functionAnalyzerExtension; 111 private final ScriptBodyResolver scriptBodyResolver; 112 private final DeclarationResolver declarationResolver; 113 private final ImportsResolver importsResolver; 114 private final JetImportsFactory jetImportsFactory; 115 private final OverloadResolver overloadResolver; 116 private final OverrideResolver overrideResolver; 117 private final TopDownAnalyzer topDownAnalyzer; 118 private final MutablePackageFragmentProvider mutablePackageFragmentProvider; 119 private final TypeHierarchyResolver typeHierarchyResolver; 120 private final ScriptHeaderResolver scriptHeaderResolver; 121 private final VarianceChecker varianceChecker; 122 123 public InjectorForLazyBodyResolve( 124 @NotNull Project project, 125 @NotNull GlobalContext globalContext, 126 @NotNull KotlinCodeAnalyzer analyzer, 127 @NotNull BindingTrace bindingTrace, 128 @NotNull AdditionalCheckerProvider additionalCheckerProvider, 129 @NotNull DynamicTypesSettings dynamicTypesSettings 130 ) { 131 this.project = project; 132 this.globalContext = globalContext; 133 this.storageManager = globalContext.getStorageManager(); 134 this.analyzer = analyzer; 135 this.bindingTrace = bindingTrace; 136 this.additionalCheckerProvider = additionalCheckerProvider; 137 this.dynamicTypesSettings = dynamicTypesSettings; 138 this.moduleDescriptor = analyzer.getModuleDescriptor(); 139 this.kotlinBuiltIns = moduleDescriptor.getBuiltIns(); 140 this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap(); 141 this.lazyTopDownAnalyzer = new LazyTopDownAnalyzer(); 142 this.bodyResolver = new BodyResolver(); 143 this.annotationResolver = new AnnotationResolver(); 144 this.callResolver = new CallResolver(); 145 this.argumentTypeResolver = new ArgumentTypeResolver(); 146 this.expressionTypingComponents = new ExpressionTypingComponents(); 147 this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents); 148 this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices); 149 this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver, kotlinBuiltIns); 150 this.forLoopConventionsChecker = new ForLoopConventionsChecker(); 151 this.reflectionTypes = new ReflectionTypes(moduleDescriptor); 152 this.callExpressionResolver = new CallExpressionResolver(); 153 this.descriptorResolver = new DescriptorResolver(); 154 this.delegatedPropertyResolver = new DelegatedPropertyResolver(); 155 this.qualifiedExpressionResolver = new QualifiedExpressionResolver(); 156 this.flexibleTypeCapabilitiesProvider = new FlexibleTypeCapabilitiesProvider(); 157 this.lazinessToken = new LazinessToken(); 158 this.typeResolver = new TypeResolver(annotationResolver, qualifiedExpressionResolver, moduleDescriptor, flexibleTypeCapabilitiesProvider, storageManager, lazinessToken, dynamicTypesSettings); 159 this.callResolverExtensionProvider = new CallResolverExtensionProvider(); 160 this.partialBodyResolveProvider = new PartialBodyResolveProvider(); 161 this.candidateResolver = new CandidateResolver(); 162 this.callCompleter = new CallCompleter(argumentTypeResolver, candidateResolver); 163 this.taskPrioritizer = new TaskPrioritizer(storageManager); 164 this.controlFlowAnalyzer = new ControlFlowAnalyzer(); 165 this.declarationsChecker = new DeclarationsChecker(); 166 this.modifiersChecker = new ModifiersChecker(bindingTrace, additionalCheckerProvider); 167 this.functionAnalyzerExtension = new FunctionAnalyzerExtension(); 168 this.scriptBodyResolver = new ScriptBodyResolver(); 169 this.declarationResolver = new DeclarationResolver(); 170 this.importsResolver = new ImportsResolver(); 171 this.jetImportsFactory = new JetImportsFactory(); 172 this.overloadResolver = new OverloadResolver(); 173 this.overrideResolver = new OverrideResolver(); 174 this.topDownAnalyzer = new TopDownAnalyzer(); 175 this.mutablePackageFragmentProvider = new MutablePackageFragmentProvider(moduleDescriptor); 176 this.typeHierarchyResolver = new TypeHierarchyResolver(); 177 this.scriptHeaderResolver = new ScriptHeaderResolver(); 178 this.varianceChecker = new VarianceChecker(bindingTrace); 179 180 this.lazyTopDownAnalyzer.setBodyResolver(bodyResolver); 181 this.lazyTopDownAnalyzer.setDeclarationResolver(declarationResolver); 182 this.lazyTopDownAnalyzer.setKotlinCodeAnalyzer(analyzer); 183 this.lazyTopDownAnalyzer.setModuleDescriptor(moduleDescriptor); 184 this.lazyTopDownAnalyzer.setOverloadResolver(overloadResolver); 185 this.lazyTopDownAnalyzer.setOverrideResolver(overrideResolver); 186 this.lazyTopDownAnalyzer.setTopDownAnalyzer(topDownAnalyzer); 187 this.lazyTopDownAnalyzer.setTrace(bindingTrace); 188 this.lazyTopDownAnalyzer.setVarianceChecker(varianceChecker); 189 190 bodyResolver.setAnnotationResolver(annotationResolver); 191 bodyResolver.setCallResolver(callResolver); 192 bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer); 193 bodyResolver.setDeclarationsChecker(declarationsChecker); 194 bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver); 195 bodyResolver.setExpressionTypingServices(expressionTypingServices); 196 bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension); 197 bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver); 198 bodyResolver.setTrace(bindingTrace); 199 200 annotationResolver.setCallResolver(callResolver); 201 annotationResolver.setStorageManager(storageManager); 202 annotationResolver.setTypeResolver(typeResolver); 203 204 callResolver.setArgumentTypeResolver(argumentTypeResolver); 205 callResolver.setCallCompleter(callCompleter); 206 callResolver.setCandidateResolver(candidateResolver); 207 callResolver.setExpressionTypingServices(expressionTypingServices); 208 callResolver.setTaskPrioritizer(taskPrioritizer); 209 callResolver.setTypeResolver(typeResolver); 210 211 argumentTypeResolver.setBuiltIns(kotlinBuiltIns); 212 argumentTypeResolver.setExpressionTypingServices(expressionTypingServices); 213 argumentTypeResolver.setTypeResolver(typeResolver); 214 215 expressionTypingServices.setAnnotationResolver(annotationResolver); 216 expressionTypingServices.setBuiltIns(kotlinBuiltIns); 217 expressionTypingServices.setCallExpressionResolver(callExpressionResolver); 218 expressionTypingServices.setCallResolver(callResolver); 219 expressionTypingServices.setDescriptorResolver(descriptorResolver); 220 expressionTypingServices.setExtensionProvider(callResolverExtensionProvider); 221 expressionTypingServices.setPartialBodyResolveProvider(partialBodyResolveProvider); 222 expressionTypingServices.setProject(project); 223 expressionTypingServices.setTypeResolver(typeResolver); 224 225 expressionTypingComponents.setAdditionalCheckerProvider(additionalCheckerProvider); 226 expressionTypingComponents.setBuiltIns(kotlinBuiltIns); 227 expressionTypingComponents.setCallResolver(callResolver); 228 expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils); 229 expressionTypingComponents.setDynamicTypesSettings(dynamicTypesSettings); 230 expressionTypingComponents.setExpressionTypingServices(expressionTypingServices); 231 expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils); 232 expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker); 233 expressionTypingComponents.setGlobalContext(globalContext); 234 expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap); 235 expressionTypingComponents.setReflectionTypes(reflectionTypes); 236 237 forLoopConventionsChecker.setBuiltIns(kotlinBuiltIns); 238 forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices); 239 forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils); 240 forLoopConventionsChecker.setProject(project); 241 242 callExpressionResolver.setExpressionTypingServices(expressionTypingServices); 243 244 descriptorResolver.setAnnotationResolver(annotationResolver); 245 descriptorResolver.setBuiltIns(kotlinBuiltIns); 246 descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver); 247 descriptorResolver.setExpressionTypingServices(expressionTypingServices); 248 descriptorResolver.setStorageManager(storageManager); 249 descriptorResolver.setTypeResolver(typeResolver); 250 251 delegatedPropertyResolver.setBuiltIns(kotlinBuiltIns); 252 delegatedPropertyResolver.setCallResolver(callResolver); 253 delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices); 254 255 candidateResolver.setArgumentTypeResolver(argumentTypeResolver); 256 257 controlFlowAnalyzer.setTrace(bindingTrace); 258 259 declarationsChecker.setDescriptorResolver(descriptorResolver); 260 declarationsChecker.setModifiersChecker(modifiersChecker); 261 declarationsChecker.setTrace(bindingTrace); 262 263 functionAnalyzerExtension.setTrace(bindingTrace); 264 265 scriptBodyResolver.setExpressionTypingServices(expressionTypingServices); 266 267 declarationResolver.setAnnotationResolver(annotationResolver); 268 declarationResolver.setDescriptorResolver(descriptorResolver); 269 declarationResolver.setImportsResolver(importsResolver); 270 declarationResolver.setTrace(bindingTrace); 271 272 importsResolver.setImportsFactory(jetImportsFactory); 273 importsResolver.setModuleDescriptor(moduleDescriptor); 274 importsResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver); 275 importsResolver.setTrace(bindingTrace); 276 277 jetImportsFactory.setProject(project); 278 279 overloadResolver.setTrace(bindingTrace); 280 281 overrideResolver.setTrace(bindingTrace); 282 283 topDownAnalyzer.setBodyResolver(bodyResolver); 284 topDownAnalyzer.setDeclarationResolver(declarationResolver); 285 topDownAnalyzer.setModuleDescriptor(moduleDescriptor); 286 topDownAnalyzer.setOverloadResolver(overloadResolver); 287 topDownAnalyzer.setOverrideResolver(overrideResolver); 288 topDownAnalyzer.setPackageFragmentProvider(mutablePackageFragmentProvider); 289 topDownAnalyzer.setTypeHierarchyResolver(typeHierarchyResolver); 290 topDownAnalyzer.setVarianceChecker(varianceChecker); 291 292 typeHierarchyResolver.setDescriptorResolver(descriptorResolver); 293 typeHierarchyResolver.setImportsResolver(importsResolver); 294 typeHierarchyResolver.setPackageFragmentProvider(mutablePackageFragmentProvider); 295 typeHierarchyResolver.setScriptHeaderResolver(scriptHeaderResolver); 296 typeHierarchyResolver.setTrace(bindingTrace); 297 298 scriptHeaderResolver.setPackageFragmentProvider(mutablePackageFragmentProvider); 299 scriptHeaderResolver.setTrace(bindingTrace); 300 301 } 302 303 @PreDestroy 304 public void destroy() { 305 } 306 307 public LazyTopDownAnalyzer getLazyTopDownAnalyzer() { 308 return this.lazyTopDownAnalyzer; 309 } 310 311 }