UsageLocation -> LookupLocation

This commit is contained in:
Zalim Bashorov
2015-08-04 22:03:20 +03:00
parent 96696c6846
commit 2aa4c383cd
52 changed files with 190 additions and 194 deletions
@@ -60,7 +60,7 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode;
import org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil;
import org.jetbrains.kotlin.resolve.lazy.KotlinCodeAnalyzer;
import org.jetbrains.kotlin.resolve.scopes.JetScope;
import org.jetbrains.kotlin.resolve.scopes.UsageLocation;
import org.jetbrains.kotlin.resolve.scopes.LookupLocation;
import java.io.IOException;
import java.util.*;
@@ -140,7 +140,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
if (declaration instanceof JetFunction) {
JetFunction jetFunction = (JetFunction) declaration;
Name name = jetFunction.getNameAsSafeName();
Collection<FunctionDescriptor> functions = packageDescriptor.getMemberScope().getFunctions(name, UsageLocation.NO_LOCATION);
Collection<FunctionDescriptor> functions = packageDescriptor.getMemberScope().getFunctions(name, LookupLocation.NO_LOCATION);
for (FunctionDescriptor descriptor : functions) {
ForceResolveUtil.forceResolveAllContents(descriptor);
}
@@ -148,7 +148,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
else if (declaration instanceof JetProperty) {
JetProperty jetProperty = (JetProperty) declaration;
Name name = jetProperty.getNameAsSafeName();
Collection<VariableDescriptor> properties = packageDescriptor.getMemberScope().getProperties(name, UsageLocation.NO_LOCATION);
Collection<VariableDescriptor> properties = packageDescriptor.getMemberScope().getProperties(name, LookupLocation.NO_LOCATION);
for (VariableDescriptor descriptor : properties) {
ForceResolveUtil.forceResolveAllContents(descriptor);
}
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.scopes.JetScope
import org.jetbrains.kotlin.resolve.scopes.JetScopeImpl
import org.jetbrains.kotlin.resolve.scopes.UsageLocation
import org.jetbrains.kotlin.resolve.scopes.LookupLocation
import org.jetbrains.kotlin.types.ErrorUtils.createErrorType
import org.jetbrains.kotlin.types.TypeProjection
import org.jetbrains.kotlin.types.TypeSubstitution
@@ -49,7 +49,7 @@ private class ScopeWithMissingDependencies(val fqName: FqName, val containing: D
p.println("Special scope for decompiler, containing class with any name")
}
override fun getClassifier(name: Name, location: UsageLocation): ClassifierDescriptor? {
override fun getClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? {
return MissingDependencyErrorClassDescriptor(getContainingDeclaration(), fqName.child(name))
}
}
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.BindingTraceContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.scopes.ChainedScope
import org.jetbrains.kotlin.resolve.scopes.JetScope
import org.jetbrains.kotlin.resolve.scopes.UsageLocation
import org.jetbrains.kotlin.resolve.scopes.LookupLocation
import org.jetbrains.kotlin.types.*
import java.util.HashMap
@@ -105,6 +105,6 @@ public object HeuristicSignatures {
private class TypeParametersScope(params: Collection<TypeParameterDescriptor>) : JetScope by JetScope.Empty {
private val paramsByName = params.map { it.getName() to it }.toMap()
override fun getClassifier(name: Name, location: UsageLocation) = paramsByName[name]
override fun getClassifier(name: Name, location: LookupLocation) = paramsByName[name]
}
}
@@ -54,7 +54,7 @@ import org.jetbrains.kotlin.renderer.NameShortness;
import org.jetbrains.kotlin.resolve.FunctionDescriptorUtil;
import org.jetbrains.kotlin.resolve.VisibilityUtil;
import org.jetbrains.kotlin.resolve.scopes.JetScope;
import org.jetbrains.kotlin.resolve.scopes.UsageLocation;
import org.jetbrains.kotlin.resolve.scopes.LookupLocation;
import org.jetbrains.kotlin.types.JetType;
import org.jetbrains.kotlin.types.TypeUtils;
import org.jetbrains.kotlin.types.checker.JetTypeChecker;
@@ -268,7 +268,7 @@ public class ChangeMemberFunctionSignatureFix extends JetHintAction<JetNamedFunc
Name name = functionDescriptor.getName();
for (JetType type : TypeUtils.getAllSupertypes(classDescriptor.getDefaultType())) {
JetScope scope = type.getMemberScope();
for (FunctionDescriptor function : scope.getFunctions(name, UsageLocation.NO_LOCATION)) {
for (FunctionDescriptor function : scope.getFunctions(name, LookupLocation.NO_LOCATION)) {
if (!function.getKind().isReal()) continue;
if (function.getModality().isOverridable())
superFunctions.add(function);
@@ -74,7 +74,7 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode;
import org.jetbrains.kotlin.resolve.scopes.JetScope;
import org.jetbrains.kotlin.resolve.scopes.UsageLocation;
import org.jetbrains.kotlin.resolve.scopes.LookupLocation;
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver;
import org.jetbrains.kotlin.types.JetType;
@@ -615,8 +615,8 @@ public class JetChangeSignatureUsageProcessor implements ChangeSignatureUsagePro
if (!kind.getIsConstructor() && callableScope != null && !info.getNewName().isEmpty()) {
Name newName = Name.identifier(info.getNewName());
Collection<? extends CallableDescriptor> conflicts = oldDescriptor instanceof FunctionDescriptor
? callableScope.getFunctions(newName, UsageLocation.NO_LOCATION)
: callableScope.getProperties(newName, UsageLocation.NO_LOCATION);
? callableScope.getFunctions(newName, LookupLocation.NO_LOCATION)
: callableScope.getProperties(newName, LookupLocation.NO_LOCATION);
for (CallableDescriptor conflict : conflicts) {
if (conflict == oldDescriptor) continue;
@@ -639,7 +639,7 @@ public class JetChangeSignatureUsageProcessor implements ChangeSignatureUsagePro
}
if (parametersScope != null) {
if (kind == JetMethodDescriptor.Kind.PRIMARY_CONSTRUCTOR && valOrVar != JetValVar.None) {
for (VariableDescriptor property : parametersScope.getProperties(Name.identifier(parameterName), UsageLocation.NO_LOCATION)) {
for (VariableDescriptor property : parametersScope.getProperties(Name.identifier(parameterName), LookupLocation.NO_LOCATION)) {
PsiElement propertyDeclaration = DescriptorToSourceUtils.descriptorToDeclaration(property);
if (propertyDeclaration != null && !(propertyDeclaration.getParent() instanceof JetParameterList)) {