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.GlobalContextImpl; 021 import org.jetbrains.jet.storage.LockBasedStorageManager; 022 import org.jetbrains.jet.lang.descriptors.ModuleDescriptorImpl; 023 import org.jetbrains.jet.lang.PlatformToKotlinClassMap; 024 import org.jetbrains.jet.lang.resolve.lazy.declarations.DeclarationProviderFactory; 025 import org.jetbrains.jet.lang.resolve.BindingTrace; 026 import org.jetbrains.jet.lang.resolve.lazy.ResolveSession; 027 import org.jetbrains.jet.lang.types.DependencyClassByQualifiedNameResolverDummyImpl; 028 import org.jetbrains.jet.lang.resolve.AnnotationResolver; 029 import org.jetbrains.jet.lang.resolve.calls.CallResolver; 030 import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver; 031 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices; 032 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingComponents; 033 import org.jetbrains.jet.lang.types.expressions.ControlStructureTypingUtils; 034 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils; 035 import org.jetbrains.jet.lang.types.expressions.ForLoopConventionsChecker; 036 import org.jetbrains.jet.lang.reflect.ReflectionTypes; 037 import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver; 038 import org.jetbrains.jet.lang.resolve.DescriptorResolver; 039 import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver; 040 import org.jetbrains.jet.lang.resolve.TypeResolver; 041 import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver; 042 import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider; 043 import org.jetbrains.jet.lang.resolve.calls.CandidateResolver; 044 import org.jetbrains.jet.lang.psi.JetImportsFactory; 045 import org.jetbrains.jet.lang.resolve.lazy.ScopeProvider; 046 import org.jetbrains.jet.lang.resolve.ScriptBodyResolver; 047 import org.jetbrains.jet.lang.resolve.ScriptParameterResolver; 048 import org.jetbrains.annotations.NotNull; 049 import javax.annotation.PreDestroy; 050 051 /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */ 052 @SuppressWarnings("ALL") 053 public class InjectorForLazyResolve { 054 055 private final Project project; 056 private final GlobalContextImpl globalContext; 057 private final LockBasedStorageManager lockBasedStorageManager; 058 private final ModuleDescriptorImpl moduleDescriptor; 059 private final PlatformToKotlinClassMap platformToKotlinClassMap; 060 private final DeclarationProviderFactory declarationProviderFactory; 061 private final BindingTrace bindingTrace; 062 private final ResolveSession resolveSession; 063 private final DependencyClassByQualifiedNameResolverDummyImpl dependencyClassByQualifiedNameResolverDummy; 064 private final AnnotationResolver annotationResolver; 065 private final CallResolver callResolver; 066 private final ArgumentTypeResolver argumentTypeResolver; 067 private final ExpressionTypingServices expressionTypingServices; 068 private final ExpressionTypingComponents expressionTypingComponents; 069 private final ControlStructureTypingUtils controlStructureTypingUtils; 070 private final ExpressionTypingUtils expressionTypingUtils; 071 private final ForLoopConventionsChecker forLoopConventionsChecker; 072 private final ReflectionTypes reflectionTypes; 073 private final CallExpressionResolver callExpressionResolver; 074 private final DescriptorResolver descriptorResolver; 075 private final DelegatedPropertyResolver delegatedPropertyResolver; 076 private final TypeResolver typeResolver; 077 private final QualifiedExpressionResolver qualifiedExpressionResolver; 078 private final CallResolverExtensionProvider callResolverExtensionProvider; 079 private final CandidateResolver candidateResolver; 080 private final JetImportsFactory jetImportsFactory; 081 private final ScopeProvider scopeProvider; 082 private final ScriptBodyResolver scriptBodyResolver; 083 private final ScriptParameterResolver scriptParameterResolver; 084 085 public InjectorForLazyResolve( 086 @NotNull Project project, 087 @NotNull GlobalContextImpl globalContext, 088 @NotNull ModuleDescriptorImpl moduleDescriptor, 089 @NotNull DeclarationProviderFactory declarationProviderFactory, 090 @NotNull BindingTrace bindingTrace 091 ) { 092 this.project = project; 093 this.globalContext = globalContext; 094 this.lockBasedStorageManager = globalContext.getStorageManager(); 095 this.moduleDescriptor = moduleDescriptor; 096 this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap(); 097 this.declarationProviderFactory = declarationProviderFactory; 098 this.bindingTrace = bindingTrace; 099 this.resolveSession = new ResolveSession(project, globalContext, moduleDescriptor, declarationProviderFactory, bindingTrace); 100 this.dependencyClassByQualifiedNameResolverDummy = new DependencyClassByQualifiedNameResolverDummyImpl(); 101 this.annotationResolver = new AnnotationResolver(); 102 this.callResolver = new CallResolver(); 103 this.argumentTypeResolver = new ArgumentTypeResolver(); 104 this.expressionTypingComponents = new ExpressionTypingComponents(); 105 this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents); 106 this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices); 107 this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver); 108 this.forLoopConventionsChecker = new ForLoopConventionsChecker(); 109 this.reflectionTypes = new ReflectionTypes(moduleDescriptor); 110 this.callExpressionResolver = new CallExpressionResolver(); 111 this.descriptorResolver = new DescriptorResolver(); 112 this.delegatedPropertyResolver = new DelegatedPropertyResolver(); 113 this.typeResolver = new TypeResolver(); 114 this.qualifiedExpressionResolver = new QualifiedExpressionResolver(); 115 this.callResolverExtensionProvider = new CallResolverExtensionProvider(); 116 this.candidateResolver = new CandidateResolver(); 117 this.jetImportsFactory = new JetImportsFactory(); 118 this.scopeProvider = new ScopeProvider(getResolveSession()); 119 this.scriptBodyResolver = new ScriptBodyResolver(); 120 this.scriptParameterResolver = new ScriptParameterResolver(); 121 122 this.resolveSession.setAnnotationResolve(annotationResolver); 123 this.resolveSession.setDescriptorResolver(descriptorResolver); 124 this.resolveSession.setJetImportFactory(jetImportsFactory); 125 this.resolveSession.setQualifiedExpressionResolver(qualifiedExpressionResolver); 126 this.resolveSession.setScopeProvider(scopeProvider); 127 this.resolveSession.setScriptBodyResolver(scriptBodyResolver); 128 this.resolveSession.setScriptParameterResolver(scriptParameterResolver); 129 this.resolveSession.setTypeResolver(typeResolver); 130 131 annotationResolver.setCallResolver(callResolver); 132 annotationResolver.setStorageManager(lockBasedStorageManager); 133 annotationResolver.setTypeResolver(typeResolver); 134 135 callResolver.setArgumentTypeResolver(argumentTypeResolver); 136 callResolver.setCandidateResolver(candidateResolver); 137 callResolver.setExpressionTypingServices(expressionTypingServices); 138 callResolver.setTypeResolver(typeResolver); 139 140 argumentTypeResolver.setExpressionTypingServices(expressionTypingServices); 141 argumentTypeResolver.setTypeResolver(typeResolver); 142 143 expressionTypingServices.setAnnotationResolver(annotationResolver); 144 expressionTypingServices.setCallExpressionResolver(callExpressionResolver); 145 expressionTypingServices.setCallResolver(callResolver); 146 expressionTypingServices.setDescriptorResolver(descriptorResolver); 147 expressionTypingServices.setExtensionProvider(callResolverExtensionProvider); 148 expressionTypingServices.setProject(project); 149 expressionTypingServices.setTypeResolver(typeResolver); 150 151 expressionTypingComponents.setCallResolver(callResolver); 152 expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils); 153 expressionTypingComponents.setExpressionTypingServices(expressionTypingServices); 154 expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils); 155 expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker); 156 expressionTypingComponents.setGlobalContext(globalContext); 157 expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap); 158 expressionTypingComponents.setReflectionTypes(reflectionTypes); 159 160 forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices); 161 forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils); 162 forLoopConventionsChecker.setProject(project); 163 164 callExpressionResolver.setExpressionTypingServices(expressionTypingServices); 165 166 descriptorResolver.setAnnotationResolver(annotationResolver); 167 descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver); 168 descriptorResolver.setExpressionTypingServices(expressionTypingServices); 169 descriptorResolver.setStorageManager(lockBasedStorageManager); 170 descriptorResolver.setTypeResolver(typeResolver); 171 172 delegatedPropertyResolver.setCallResolver(callResolver); 173 delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices); 174 175 typeResolver.setAnnotationResolver(annotationResolver); 176 typeResolver.setModuleDescriptor(moduleDescriptor); 177 typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver); 178 179 candidateResolver.setArgumentTypeResolver(argumentTypeResolver); 180 181 jetImportsFactory.setProject(project); 182 183 scriptBodyResolver.setExpressionTypingServices(expressionTypingServices); 184 185 scriptParameterResolver.setDependencyClassByQualifiedNameResolver(dependencyClassByQualifiedNameResolverDummy); 186 187 } 188 189 @PreDestroy 190 public void destroy() { 191 } 192 193 public ResolveSession getResolveSession() { 194 return this.resolveSession; 195 } 196 197 }