LookupLocation.NO_LOCATION_FROM_IDE -> NoLookupLocation.FROM_IDE
This commit is contained in:
+3
-3
@@ -50,6 +50,7 @@ import org.jetbrains.kotlin.idea.stubindex.JetFullClassNameIndex;
|
||||
import org.jetbrains.kotlin.idea.stubindex.JetTopLevelClassByPackageIndex;
|
||||
import org.jetbrains.kotlin.idea.stubindex.PackageIndexUtil;
|
||||
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil;
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
|
||||
import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
@@ -60,7 +61,6 @@ 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.incremental.components.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, LookupLocation.NO_LOCATION_FROM_IDE);
|
||||
Collection<FunctionDescriptor> functions = packageDescriptor.getMemberScope().getFunctions(name, NoLookupLocation.FROM_IDE);
|
||||
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, LookupLocation.NO_LOCATION_FROM_IDE);
|
||||
Collection<VariableDescriptor> properties = packageDescriptor.getMemberScope().getProperties(name, NoLookupLocation.FROM_IDE);
|
||||
for (VariableDescriptor descriptor : properties) {
|
||||
ForceResolveUtil.forceResolveAllContents(descriptor);
|
||||
}
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.idea.caches.resolve
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.*
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.load.java.sources.JavaSourceElement
|
||||
import org.jetbrains.kotlin.load.java.structure.*
|
||||
import org.jetbrains.kotlin.load.java.structure.impl.*
|
||||
@@ -74,7 +74,7 @@ fun PsiMember.getJavaMemberDescriptor(): DeclarationDescriptor? {
|
||||
}
|
||||
|
||||
public fun JavaDescriptorResolver.resolveMethod(method: JavaMethod): FunctionDescriptor? {
|
||||
return getContainingScope(method)?.getFunctions(method.name, LookupLocation.NO_LOCATION_FROM_IDE)?.findByJavaElement(method)
|
||||
return getContainingScope(method)?.getFunctions(method.name, NoLookupLocation.FROM_IDE)?.findByJavaElement(method)
|
||||
}
|
||||
|
||||
public fun JavaDescriptorResolver.resolveConstructor(constructor: JavaConstructor): ConstructorDescriptor? {
|
||||
@@ -82,7 +82,7 @@ public fun JavaDescriptorResolver.resolveConstructor(constructor: JavaConstructo
|
||||
}
|
||||
|
||||
public fun JavaDescriptorResolver.resolveField(field: JavaField): PropertyDescriptor? {
|
||||
return getContainingScope(field)?.getProperties(field.name, LookupLocation.NO_LOCATION_FROM_IDE)?.findByJavaElement(field) as? PropertyDescriptor
|
||||
return getContainingScope(field)?.getProperties(field.name, NoLookupLocation.FROM_IDE)?.findByJavaElement(field) as? PropertyDescriptor
|
||||
}
|
||||
|
||||
private fun JavaDescriptorResolver.getContainingScope(member: JavaMember): JetScope? {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||
import org.jetbrains.kotlin.idea.imports.canBeReferencedViaImport
|
||||
import org.jetbrains.kotlin.idea.imports.getImportableTargets
|
||||
import org.jetbrains.kotlin.idea.util.ShortenReferences.Options
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
|
||||
@@ -273,7 +273,7 @@ public class ShortenReferences(val options: (JetElement) -> Options = { Options.
|
||||
val typeReference = type.getStrictParentOfType<JetTypeReference>()!!
|
||||
val scope = bindingContext[BindingContext.TYPE_RESOLUTION_SCOPE, typeReference]!!
|
||||
val name = target.getName()
|
||||
val targetByName = if (target is ClassifierDescriptor) scope.getClassifier(name, LookupLocation.NO_LOCATION_FROM_IDE) else scope.getPackage(name)
|
||||
val targetByName = if (target is ClassifierDescriptor) scope.getClassifier(name, NoLookupLocation.FROM_IDE) else scope.getPackage(name)
|
||||
val canShortenNow = targetByName?.asString() == target.asString()
|
||||
|
||||
processQualifiedElement(type, target, canShortenNow)
|
||||
|
||||
Reference in New Issue
Block a user