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.descriptors.impl.ModuleDescriptorImpl;
023    import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
024    import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
025    import org.jetbrains.jet.lang.resolve.lazy.declarations.DeclarationProviderFactory;
026    import org.jetbrains.jet.lang.resolve.BindingTrace;
027    import org.jetbrains.jet.lang.resolve.AdditionalCheckerProvider;
028    import org.jetbrains.jet.lang.types.DynamicTypesSettings;
029    import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
030    import org.jetbrains.jet.context.LazyResolveToken;
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.lang.resolve.calls.CallResolverExtensionProvider;
047    import org.jetbrains.jet.lang.resolve.PartialBodyResolveProvider;
048    import org.jetbrains.jet.lang.resolve.calls.CallCompleter;
049    import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
050    import org.jetbrains.jet.lang.resolve.calls.tasks.TaskPrioritizer;
051    import org.jetbrains.jet.lang.psi.JetImportsFactory;
052    import org.jetbrains.jet.lang.resolve.lazy.ScopeProvider;
053    import org.jetbrains.jet.lang.resolve.lazy.ScopeProvider.AdditionalFileScopeProvider;
054    import org.jetbrains.jet.lang.resolve.ScriptBodyResolver;
055    import org.jetbrains.annotations.NotNull;
056    import javax.annotation.PreDestroy;
057    
058    /* This file is generated by org.jetbrains.jet.generators.injectors.InjectorsPackage. DO NOT EDIT! */
059    @SuppressWarnings("all")
060    public class InjectorForLazyResolve {
061    
062        private final Project project;
063        private final GlobalContext globalContext;
064        private final StorageManager storageManager;
065        private final ModuleDescriptorImpl moduleDescriptor;
066        private final KotlinBuiltIns kotlinBuiltIns;
067        private final PlatformToKotlinClassMap platformToKotlinClassMap;
068        private final DeclarationProviderFactory declarationProviderFactory;
069        private final BindingTrace bindingTrace;
070        private final AdditionalCheckerProvider additionalCheckerProvider;
071        private final DynamicTypesSettings dynamicTypesSettings;
072        private final ResolveSession resolveSession;
073        private final LazyResolveToken lazyResolveToken;
074        private final AnnotationResolver annotationResolver;
075        private final CallResolver callResolver;
076        private final ArgumentTypeResolver argumentTypeResolver;
077        private final ExpressionTypingServices expressionTypingServices;
078        private final ExpressionTypingComponents expressionTypingComponents;
079        private final ControlStructureTypingUtils controlStructureTypingUtils;
080        private final ExpressionTypingUtils expressionTypingUtils;
081        private final ForLoopConventionsChecker forLoopConventionsChecker;
082        private final ReflectionTypes reflectionTypes;
083        private final CallExpressionResolver callExpressionResolver;
084        private final DescriptorResolver descriptorResolver;
085        private final DelegatedPropertyResolver delegatedPropertyResolver;
086        private final TypeResolver typeResolver;
087        private final QualifiedExpressionResolver qualifiedExpressionResolver;
088        private final FlexibleTypeCapabilitiesProvider flexibleTypeCapabilitiesProvider;
089        private final CallResolverExtensionProvider callResolverExtensionProvider;
090        private final PartialBodyResolveProvider partialBodyResolveProvider;
091        private final CallCompleter callCompleter;
092        private final CandidateResolver candidateResolver;
093        private final TaskPrioritizer taskPrioritizer;
094        private final JetImportsFactory jetImportsFactory;
095        private final ScopeProvider scopeProvider;
096        private final AdditionalFileScopeProvider additionalFileScopeProvider;
097        private final ScriptBodyResolver scriptBodyResolver;
098    
099        public InjectorForLazyResolve(
100            @NotNull Project project,
101            @NotNull GlobalContext globalContext,
102            @NotNull ModuleDescriptorImpl moduleDescriptor,
103            @NotNull DeclarationProviderFactory declarationProviderFactory,
104            @NotNull BindingTrace bindingTrace,
105            @NotNull AdditionalCheckerProvider additionalCheckerProvider,
106            @NotNull DynamicTypesSettings dynamicTypesSettings
107        ) {
108            this.project = project;
109            this.globalContext = globalContext;
110            this.storageManager = globalContext.getStorageManager();
111            this.moduleDescriptor = moduleDescriptor;
112            this.kotlinBuiltIns = moduleDescriptor.getBuiltIns();
113            this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
114            this.declarationProviderFactory = declarationProviderFactory;
115            this.bindingTrace = bindingTrace;
116            this.additionalCheckerProvider = additionalCheckerProvider;
117            this.dynamicTypesSettings = dynamicTypesSettings;
118            this.resolveSession = new ResolveSession(project, globalContext, moduleDescriptor, declarationProviderFactory, bindingTrace);
119            this.lazyResolveToken = new LazyResolveToken();
120            this.annotationResolver = new AnnotationResolver();
121            this.callResolver = new CallResolver();
122            this.argumentTypeResolver = new ArgumentTypeResolver();
123            this.expressionTypingComponents = new ExpressionTypingComponents();
124            this.expressionTypingServices = new ExpressionTypingServices(expressionTypingComponents);
125            this.controlStructureTypingUtils = new ControlStructureTypingUtils(expressionTypingServices);
126            this.expressionTypingUtils = new ExpressionTypingUtils(expressionTypingServices, callResolver, kotlinBuiltIns);
127            this.forLoopConventionsChecker = new ForLoopConventionsChecker();
128            this.reflectionTypes = new ReflectionTypes(moduleDescriptor);
129            this.callExpressionResolver = new CallExpressionResolver();
130            this.descriptorResolver = new DescriptorResolver();
131            this.delegatedPropertyResolver = new DelegatedPropertyResolver();
132            this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
133            this.flexibleTypeCapabilitiesProvider = new FlexibleTypeCapabilitiesProvider();
134            this.typeResolver = new TypeResolver(annotationResolver, qualifiedExpressionResolver, moduleDescriptor, flexibleTypeCapabilitiesProvider, storageManager, lazyResolveToken, dynamicTypesSettings);
135            this.callResolverExtensionProvider = new CallResolverExtensionProvider();
136            this.partialBodyResolveProvider = new PartialBodyResolveProvider();
137            this.candidateResolver = new CandidateResolver();
138            this.callCompleter = new CallCompleter(argumentTypeResolver, candidateResolver);
139            this.taskPrioritizer = new TaskPrioritizer(storageManager);
140            this.jetImportsFactory = new JetImportsFactory();
141            this.scopeProvider = new ScopeProvider(getResolveSession());
142            this.additionalFileScopeProvider = new AdditionalFileScopeProvider();
143            this.scriptBodyResolver = new ScriptBodyResolver();
144    
145            this.resolveSession.setAnnotationResolve(annotationResolver);
146            this.resolveSession.setDescriptorResolver(descriptorResolver);
147            this.resolveSession.setJetImportFactory(jetImportsFactory);
148            this.resolveSession.setQualifiedExpressionResolver(qualifiedExpressionResolver);
149            this.resolveSession.setScopeProvider(scopeProvider);
150            this.resolveSession.setScriptBodyResolver(scriptBodyResolver);
151            this.resolveSession.setTypeResolver(typeResolver);
152    
153            annotationResolver.setCallResolver(callResolver);
154            annotationResolver.setStorageManager(storageManager);
155            annotationResolver.setTypeResolver(typeResolver);
156    
157            callResolver.setArgumentTypeResolver(argumentTypeResolver);
158            callResolver.setCallCompleter(callCompleter);
159            callResolver.setCandidateResolver(candidateResolver);
160            callResolver.setExpressionTypingServices(expressionTypingServices);
161            callResolver.setTaskPrioritizer(taskPrioritizer);
162            callResolver.setTypeResolver(typeResolver);
163    
164            argumentTypeResolver.setBuiltIns(kotlinBuiltIns);
165            argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
166            argumentTypeResolver.setTypeResolver(typeResolver);
167    
168            expressionTypingServices.setAnnotationResolver(annotationResolver);
169            expressionTypingServices.setBuiltIns(kotlinBuiltIns);
170            expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
171            expressionTypingServices.setCallResolver(callResolver);
172            expressionTypingServices.setDescriptorResolver(descriptorResolver);
173            expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
174            expressionTypingServices.setPartialBodyResolveProvider(partialBodyResolveProvider);
175            expressionTypingServices.setProject(project);
176            expressionTypingServices.setTypeResolver(typeResolver);
177    
178            expressionTypingComponents.setAdditionalCheckerProvider(additionalCheckerProvider);
179            expressionTypingComponents.setBuiltIns(kotlinBuiltIns);
180            expressionTypingComponents.setCallResolver(callResolver);
181            expressionTypingComponents.setControlStructureTypingUtils(controlStructureTypingUtils);
182            expressionTypingComponents.setDynamicTypesSettings(dynamicTypesSettings);
183            expressionTypingComponents.setExpressionTypingServices(expressionTypingServices);
184            expressionTypingComponents.setExpressionTypingUtils(expressionTypingUtils);
185            expressionTypingComponents.setForLoopConventionsChecker(forLoopConventionsChecker);
186            expressionTypingComponents.setGlobalContext(globalContext);
187            expressionTypingComponents.setPlatformToKotlinClassMap(platformToKotlinClassMap);
188            expressionTypingComponents.setReflectionTypes(reflectionTypes);
189    
190            forLoopConventionsChecker.setBuiltIns(kotlinBuiltIns);
191            forLoopConventionsChecker.setExpressionTypingServices(expressionTypingServices);
192            forLoopConventionsChecker.setExpressionTypingUtils(expressionTypingUtils);
193            forLoopConventionsChecker.setProject(project);
194    
195            callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
196    
197            descriptorResolver.setAnnotationResolver(annotationResolver);
198            descriptorResolver.setBuiltIns(kotlinBuiltIns);
199            descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
200            descriptorResolver.setExpressionTypingServices(expressionTypingServices);
201            descriptorResolver.setStorageManager(storageManager);
202            descriptorResolver.setTypeResolver(typeResolver);
203    
204            delegatedPropertyResolver.setBuiltIns(kotlinBuiltIns);
205            delegatedPropertyResolver.setCallResolver(callResolver);
206            delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);
207    
208            candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
209    
210            jetImportsFactory.setProject(project);
211    
212            scopeProvider.setAdditionalFileScopesProvider(additionalFileScopeProvider);
213    
214            scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
215    
216        }
217    
218        @PreDestroy
219        public void destroy() {
220        }
221    
222        public ResolveSession getResolveSession() {
223            return this.resolveSession;
224        }
225    
226    }