Use ModuleDescriptor instead of ModuleConfiguration
This commit is contained in:
@@ -236,7 +236,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
|
||||
if (functionFQN != null) {
|
||||
JetImportDirective importDirective = JetPsiFactory.createImportDirective(project, new ImportPath(functionFQN, false));
|
||||
Collection<? extends DeclarationDescriptor> declarationDescriptors = new QualifiedExpressionResolver().analyseImportReference(
|
||||
importDirective, jetScope, new BindingTraceContext(), resolveSession.getModuleConfiguration());
|
||||
importDirective, jetScope, new BindingTraceContext(), resolveSession.getRootModuleDescriptor());
|
||||
for (DeclarationDescriptor declarationDescriptor : declarationDescriptors) {
|
||||
if (declarationDescriptor instanceof FunctionDescriptor) {
|
||||
result.add((FunctionDescriptor) declarationDescriptor);
|
||||
@@ -335,7 +335,7 @@ public class JetShortNamesCache extends PsiShortNamesCache {
|
||||
// Iterate through the function with attempt to resolve found functions
|
||||
for (FqName functionFQN : functionFQNs) {
|
||||
for (CallableDescriptor functionDescriptor : ExpressionTypingUtils.canFindSuitableCall(
|
||||
functionFQN, project, receiverExpression, expressionType, scope, resolveSession.getModuleConfiguration())) {
|
||||
functionFQN, project, receiverExpression, expressionType, scope, resolveSession.getRootModuleDescriptor())) {
|
||||
|
||||
resultDescriptors.add(functionDescriptor);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,6 @@ public class JetSourceNavigationHelper {
|
||||
project,
|
||||
storageManager,
|
||||
moduleDescriptor,
|
||||
DefaultModuleConfiguration.createStandardConfiguration(),
|
||||
providerFactory);
|
||||
|
||||
for (JetNamedDeclaration candidate : candidates) {
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class BaseJetVariableMacro extends Macro {
|
||||
return null;
|
||||
}
|
||||
|
||||
ExpressionTypingServices callResolverContext = new InjectorForMacros(project, analyzeExhaust.getModuleConfiguration()).getExpressionTypingServices();
|
||||
ExpressionTypingServices callResolverContext = new InjectorForMacros(project, analyzeExhaust.getModuleDescriptor()).getExpressionTypingServices();
|
||||
|
||||
List<VariableDescriptor> filteredDescriptors = new ArrayList<VariableDescriptor>();
|
||||
for (DeclarationDescriptor declarationDescriptor : scope.getAllDescriptors()) {
|
||||
|
||||
@@ -38,7 +38,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.asJava.LightClassUtil;
|
||||
import org.jetbrains.jet.lang.ModuleConfiguration;
|
||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils;
|
||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
@@ -46,6 +45,7 @@ import org.jetbrains.jet.lang.resolve.*;
|
||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||
import org.jetbrains.jet.lang.resolve.java.JetFilesProvider;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
||||
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||
import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManagerUtil;
|
||||
import org.jetbrains.jet.plugin.caches.resolve.KotlinDeclarationsCache;
|
||||
import org.jetbrains.jet.plugin.caches.resolve.KotlinDeclarationsCacheImpl;
|
||||
@@ -121,7 +121,7 @@ public final class AnalyzerFacadeWithCache {
|
||||
}
|
||||
|
||||
private static AnalyzeExhaust emptyExhaust() {
|
||||
return AnalyzeExhaust.success(BindingContext.EMPTY, ModuleConfiguration.EMPTY);
|
||||
return AnalyzeExhaust.success(BindingContext.EMPTY, ErrorUtils.getErrorModule());
|
||||
}
|
||||
|
||||
private static AnalyzeExhaust analyzeHeadersWithCacheOnFile(@NotNull JetFile fileToCache) {
|
||||
@@ -143,7 +143,6 @@ public final class AnalyzerFacadeWithCache {
|
||||
|
||||
private static AnalyzeExhaust analyzeBodies(AnalyzeExhaust analyzeExhaustHeaders, JetFile file) {
|
||||
BodiesResolveContext context = analyzeExhaustHeaders.getBodiesResolveContext();
|
||||
ModuleConfiguration moduleConfiguration = analyzeExhaustHeaders.getModuleConfiguration();
|
||||
assert context != null : "Headers resolver should prepare and stored information for bodies resolve";
|
||||
|
||||
// Need to resolve bodies in given file and all in the same package
|
||||
@@ -154,7 +153,7 @@ public final class AnalyzerFacadeWithCache {
|
||||
new DelegatingBindingTrace(analyzeExhaustHeaders.getBindingContext(),
|
||||
"trace to resolve bodies in file", file.getName()),
|
||||
context,
|
||||
moduleConfiguration);
|
||||
analyzeExhaustHeaders.getModuleDescriptor());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.analyzer.AnalyzerFacade;
|
||||
import org.jetbrains.jet.lang.ModuleConfiguration;
|
||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
@@ -59,9 +59,9 @@ public enum JSAnalyzerFacadeForIDEA implements AnalyzerFacade {
|
||||
@NotNull Predicate<PsiFile> filesForBodiesResolve,
|
||||
@NotNull BindingTrace traceContext,
|
||||
@NotNull BodiesResolveContext bodiesResolveContext,
|
||||
@NotNull ModuleConfiguration configuration
|
||||
@NotNull ModuleDescriptor module
|
||||
) {
|
||||
return AnalyzerFacadeForJS.analyzeBodiesInFiles(filesForBodiesResolve, new IDEAConfig(project), traceContext, bodiesResolveContext, configuration);
|
||||
return AnalyzerFacadeForJS.analyzeBodiesInFiles(filesForBodiesResolve, new IDEAConfig(project), traceContext, bodiesResolveContext, module);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.lang.ModuleConfiguration;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -155,7 +154,6 @@ public class MigrateSureInProjectFix extends JetIntentionAction<PsiElement> {
|
||||
Predicates.<PsiFile>alwaysFalse());
|
||||
|
||||
BodiesResolveContext context = analyzeExhaustHeaders.getBodiesResolveContext();
|
||||
ModuleConfiguration moduleConfiguration = analyzeExhaustHeaders.getModuleConfiguration();
|
||||
assert context != null : "Headers resolver should prepare and stored information for bodies resolve";
|
||||
|
||||
// Need to resolve bodies in given file and all in the same package
|
||||
@@ -165,6 +163,6 @@ public class MigrateSureInProjectFix extends JetIntentionAction<PsiElement> {
|
||||
Predicates.<PsiFile>alwaysTrue(),
|
||||
new DelegatingBindingTrace(analyzeExhaustHeaders.getBindingContext(), "trace in migrate sure fix"),
|
||||
context,
|
||||
moduleConfiguration);
|
||||
analyzeExhaustHeaders.getModuleDescriptor());
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -31,7 +31,6 @@ import com.intellij.psi.PsiWhiteSpace;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.HelpID;
|
||||
import com.intellij.refactoring.introduce.inplace.OccurrencesChooser;
|
||||
import com.intellij.refactoring.util.CommonRefactoringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
@@ -128,7 +127,7 @@ public class JetIntroduceVariableHandler extends JetIntroduceHandlerBase {
|
||||
}
|
||||
|
||||
ObservableBindingTrace bindingTrace = new ObservableBindingTrace(new BindingTraceContext());
|
||||
InjectorForMacros injector = new InjectorForMacros(project, analyzeExhaust.getModuleConfiguration());
|
||||
InjectorForMacros injector = new InjectorForMacros(project, analyzeExhaust.getModuleDescriptor());
|
||||
JetType typeNoExpectedType = injector.getExpressionTypingServices().getType(scope, expression,
|
||||
TypeUtils.NO_EXPECTED_TYPE, dataFlowInfo,
|
||||
bindingTrace);
|
||||
|
||||
Reference in New Issue
Block a user