Refactoring: Rename JetClsMethod -> JetPsiMethodWrapper
Source element in Kotlin mustn't be wrapped into read-only class-elements
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ package org.jetbrains.jet.lang.resolve.java.jetAsJava;
|
|||||||
import com.intellij.psi.PsiMethod;
|
import com.intellij.psi.PsiMethod;
|
||||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
||||||
|
|
||||||
/** ClsMethod created for Kotlin declaration for it to be resolved from Java */
|
/** Java method created for Kotlin declaration to make it resolvable in Java */
|
||||||
public interface JetClsMethod extends PsiMethod {
|
public interface KotlinLightMethod extends PsiMethod {
|
||||||
JetDeclaration getOrigin();
|
JetDeclaration getOrigin();
|
||||||
}
|
}
|
||||||
+3
-3
@@ -34,7 +34,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext;
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.lang.resolve.java.mapping.JavaToKotlinClassMap;
|
import org.jetbrains.jet.lang.resolve.java.mapping.JavaToKotlinClassMap;
|
||||||
import org.jetbrains.jet.lang.resolve.java.resolver.DescriptorResolverUtils;
|
import org.jetbrains.jet.lang.resolve.java.resolver.DescriptorResolverUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.resolver.TypeUsage;
|
import org.jetbrains.jet.lang.resolve.java.resolver.TypeUsage;
|
||||||
@@ -238,8 +238,8 @@ public class SignaturesPropagationData {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeclarationDescriptor superFun = superMethod.getPsi() instanceof JetClsMethod
|
DeclarationDescriptor superFun = superMethod.getPsi() instanceof KotlinLightMethod
|
||||||
? trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, ((JetClsMethod) superMethod.getPsi()).getOrigin())
|
? trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, ((KotlinLightMethod) superMethod.getPsi()).getOrigin())
|
||||||
: findSuperFunction(superclassToFunctions.get(classFqName), superMethod);
|
: findSuperFunction(superclassToFunctions.get(classFqName), superMethod);
|
||||||
if (superFun == null) {
|
if (superFun == null) {
|
||||||
// Super methods which are Object methods in interfaces are not loaded by JDR.
|
// Super methods which are Object methods in interfaces are not loaded by JDR.
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
|
||||||
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
|
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||||
import org.jetbrains.jet.utils.ExceptionUtils;
|
import org.jetbrains.jet.utils.ExceptionUtils;
|
||||||
@@ -177,7 +177,7 @@ public class LightClassUtil {
|
|||||||
List<PsiMethod> methods = new SmartList<PsiMethod>();
|
List<PsiMethod> methods = new SmartList<PsiMethod>();
|
||||||
for (PsiMethod method : psiClass.getMethods()) {
|
for (PsiMethod method : psiClass.getMethods()) {
|
||||||
try {
|
try {
|
||||||
if (method instanceof JetClsMethod && ((JetClsMethod) method).getOrigin() == declaration) {
|
if (method instanceof KotlinLightMethod && ((KotlinLightMethod) method).getOrigin() == declaration) {
|
||||||
methods.add(method);
|
methods.add(method);
|
||||||
if (!collectAll) {
|
if (!collectAll) {
|
||||||
return methods;
|
return methods;
|
||||||
|
|||||||
+3
-3
@@ -27,7 +27,7 @@ import com.intellij.util.ArrayUtil;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -110,8 +110,8 @@ public class KotlinCalleeMethodsTreeStructure extends KotlinCallTreeStructure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Kotlin function or property invoked from Java code
|
// Kotlin function or property invoked from Java code
|
||||||
if (targetElement instanceof JetClsMethod) {
|
if (targetElement instanceof KotlinLightMethod) {
|
||||||
return buildChildrenByKotlinTarget(descriptor, ((JetClsMethod) targetElement).getOrigin());
|
return buildChildrenByKotlinTarget(descriptor, ((KotlinLightMethod) targetElement).getOrigin());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetElement instanceof JetElement) {
|
if (targetElement instanceof JetElement) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import org.jetbrains.jet.lang.descriptors.impl.LocalVariableDescriptor;
|
|||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
import org.jetbrains.jet.lang.types.NamespaceType;
|
import org.jetbrains.jet.lang.types.NamespaceType;
|
||||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||||
@@ -116,7 +116,7 @@ public class JetRefactoringUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static PsiElement toJetDeclarationOrMethod(PsiMethod method) {
|
private static PsiElement toJetDeclarationOrMethod(PsiMethod method) {
|
||||||
return (method instanceof JetClsMethod) ? ((JetClsMethod) method).getOrigin() : method;
|
return (method instanceof KotlinLightMethod) ? ((KotlinLightMethod) method).getOrigin() : method;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -311,8 +311,8 @@ public class JetRefactoringUtil {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static String formatJavaOrLightMethod(@NotNull PsiMethod method) {
|
public static String formatJavaOrLightMethod(@NotNull PsiMethod method) {
|
||||||
if (method instanceof JetClsMethod) {
|
if (method instanceof KotlinLightMethod) {
|
||||||
JetDeclaration declaration = ((JetClsMethod) method).getOrigin();
|
JetDeclaration declaration = ((KotlinLightMethod) method).getOrigin();
|
||||||
BindingContext bindingContext =
|
BindingContext bindingContext =
|
||||||
AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
|
AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
|
||||||
DeclarationDescriptor descriptor =
|
DeclarationDescriptor descriptor =
|
||||||
|
|||||||
+3
-4
@@ -31,8 +31,7 @@ import org.jetbrains.jet.lang.descriptors.*;
|
|||||||
import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor;
|
import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
import org.jetbrains.jet.plugin.codeInsight.DescriptorToDeclarationUtil;
|
import org.jetbrains.jet.plugin.codeInsight.DescriptorToDeclarationUtil;
|
||||||
import org.jetbrains.jet.renderer.DescriptorRenderer;
|
import org.jetbrains.jet.renderer.DescriptorRenderer;
|
||||||
@@ -126,13 +125,13 @@ public final class JetChangeSignatureData implements JetMethodDescriptor {
|
|||||||
List<PsiMethod> jetLightMethods = ContainerUtil.filter(overridingMethods, new Condition<PsiMethod>() {
|
List<PsiMethod> jetLightMethods = ContainerUtil.filter(overridingMethods, new Condition<PsiMethod>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean value(PsiMethod method) {
|
public boolean value(PsiMethod method) {
|
||||||
return method instanceof JetClsMethod;
|
return method instanceof KotlinLightMethod;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
List<JetDeclaration> jetFunctions = ContainerUtil.map(jetLightMethods, new Function<PsiMethod, JetDeclaration>() {
|
List<JetDeclaration> jetFunctions = ContainerUtil.map(jetLightMethods, new Function<PsiMethod, JetDeclaration>() {
|
||||||
@Override
|
@Override
|
||||||
public JetDeclaration fun(PsiMethod method) {
|
public JetDeclaration fun(PsiMethod method) {
|
||||||
return ((JetClsMethod) method).getOrigin();
|
return ((KotlinLightMethod) method).getOrigin();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
result.addAll(jetFunctions);
|
result.addAll(jetFunctions);
|
||||||
|
|||||||
+13
-11
@@ -47,7 +47,7 @@ import org.jetbrains.jet.lang.descriptors.Modality;
|
|||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
import org.jetbrains.jet.lexer.JetTokens;
|
||||||
import org.jetbrains.jet.plugin.JetBundle;
|
import org.jetbrains.jet.plugin.JetBundle;
|
||||||
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
||||||
@@ -158,8 +158,8 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
|
|
||||||
@SuppressWarnings("MethodOverridesStaticMethodOfSuperclass")
|
@SuppressWarnings("MethodOverridesStaticMethodOfSuperclass")
|
||||||
public static boolean isInside(@NotNull PsiElement place, @NotNull PsiElement ancestor) {
|
public static boolean isInside(@NotNull PsiElement place, @NotNull PsiElement ancestor) {
|
||||||
if (ancestor instanceof JetClsMethod) {
|
if (ancestor instanceof KotlinLightMethod) {
|
||||||
ancestor = ((JetClsMethod) ancestor).getOrigin();
|
ancestor = ((KotlinLightMethod) ancestor).getOrigin();
|
||||||
}
|
}
|
||||||
return JavaSafeDeleteProcessor.isInside(place, ancestor);
|
return JavaSafeDeleteProcessor.isInside(place, ancestor);
|
||||||
}
|
}
|
||||||
@@ -319,7 +319,8 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
for (PsiMethod overridingMethod : overridingMethods) {
|
for (PsiMethod overridingMethod : overridingMethods) {
|
||||||
Collection<PsiReference> overridingReferences =
|
Collection<PsiReference> overridingReferences =
|
||||||
ReferencesSearch.search(
|
ReferencesSearch.search(
|
||||||
overridingMethod instanceof JetClsMethod ? ((JetClsMethod) overridingMethod).getOrigin() : overridingMethod
|
overridingMethod instanceof KotlinLightMethod
|
||||||
|
? ((KotlinLightMethod) overridingMethod).getOrigin() : overridingMethod
|
||||||
).findAll();
|
).findAll();
|
||||||
methodToReferences.put(overridingMethod, overridingReferences);
|
methodToReferences.put(overridingMethod, overridingReferences);
|
||||||
}
|
}
|
||||||
@@ -585,7 +586,8 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
) {
|
) {
|
||||||
PsiMethod[] methods = method.findSuperMethods();
|
PsiMethod[] methods = method.findSuperMethods();
|
||||||
for (PsiMethod superMethod : methods) {
|
for (PsiMethod superMethod : methods) {
|
||||||
PsiElement relevantElement = superMethod instanceof JetClsMethod ? ((JetClsMethod) superMethod).getOrigin() : superMethod;
|
PsiElement relevantElement = superMethod instanceof KotlinLightMethod
|
||||||
|
? ((KotlinLightMethod) superMethod).getOrigin() : superMethod;
|
||||||
relevantElement = JetPsiUtil.ascendIfPropertyAccessor(relevantElement);
|
relevantElement = JetPsiUtil.ascendIfPropertyAccessor(relevantElement);
|
||||||
if (ArrayUtilRt.find(ignore, relevantElement) < 0 && !MethodSignatureUtil.isSuperMethod(originalMethod, superMethod)) {
|
if (ArrayUtilRt.find(ignore, relevantElement) < 0 && !MethodSignatureUtil.isSuperMethod(originalMethod, superMethod)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -745,8 +747,8 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkPsiMethodEquality(@NotNull PsiMethod method1, @NotNull PsiMethod method2) {
|
private static boolean checkPsiMethodEquality(@NotNull PsiMethod method1, @NotNull PsiMethod method2) {
|
||||||
if (method1 instanceof JetClsMethod && method2 instanceof JetClsMethod) {
|
if (method1 instanceof KotlinLightMethod && method2 instanceof KotlinLightMethod) {
|
||||||
return ((JetClsMethod) method1).getOrigin().equals(((JetClsMethod) method2).getOrigin());
|
return ((KotlinLightMethod) method1).getOrigin().equals(((KotlinLightMethod) method2).getOrigin());
|
||||||
}
|
}
|
||||||
return method1.equals(method2);
|
return method1.equals(method2);
|
||||||
}
|
}
|
||||||
@@ -756,8 +758,8 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
Collection<PsiMethod> overridingMethods = OverridingMethodsSearch.search(method, true).findAll();
|
Collection<PsiMethod> overridingMethods = OverridingMethodsSearch.search(method, true).findAll();
|
||||||
overrideLoop:
|
overrideLoop:
|
||||||
for (PsiMethod overridingMethod : overridingMethods) {
|
for (PsiMethod overridingMethod : overridingMethods) {
|
||||||
PsiElement overridingElement = overridingMethod instanceof JetClsMethod
|
PsiElement overridingElement = overridingMethod instanceof KotlinLightMethod
|
||||||
? ((JetClsMethod) overridingMethod).getOrigin()
|
? ((KotlinLightMethod) overridingMethod).getOrigin()
|
||||||
: overridingMethod;
|
: overridingMethod;
|
||||||
|
|
||||||
Collection<PsiMethod> currentSuperMethods = new ArrayList<PsiMethod>();
|
Collection<PsiMethod> currentSuperMethods = new ArrayList<PsiMethod>();
|
||||||
@@ -854,8 +856,8 @@ public class KotlinSafeDeleteProcessor extends JavaSafeDeleteProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void addParameter(@NotNull PsiMethod method, @NotNull Set<PsiElement> result, int parameterIndex) {
|
private static void addParameter(@NotNull PsiMethod method, @NotNull Set<PsiElement> result, int parameterIndex) {
|
||||||
if (method instanceof JetClsMethod) {
|
if (method instanceof KotlinLightMethod) {
|
||||||
JetDeclaration declaration = ((JetClsMethod) method).getOrigin();
|
JetDeclaration declaration = ((KotlinLightMethod) method).getOrigin();
|
||||||
if (declaration instanceof JetNamedFunction) {
|
if (declaration instanceof JetNamedFunction) {
|
||||||
result.add(((JetNamedFunction) declaration).getValueParameters().get(parameterIndex));
|
result.add(((JetNamedFunction) declaration).getValueParameters().get(parameterIndex));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.jetbrains.jet.lang.psi.JetFile;
|
|||||||
import org.jetbrains.jet.lang.psi.JetReferenceExpression;
|
import org.jetbrains.jet.lang.psi.JetReferenceExpression;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -88,7 +88,7 @@ public abstract class JetPsiReference implements PsiPolyVariantReference {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isReferenceTo(PsiElement element) {
|
public boolean isReferenceTo(PsiElement element) {
|
||||||
PsiElement target = resolve();
|
PsiElement target = resolve();
|
||||||
PsiElement mirrorElement = element instanceof JetClsMethod ? ((JetClsMethod) element).getOrigin() : null;
|
PsiElement mirrorElement = element instanceof KotlinLightMethod ? ((KotlinLightMethod) element).getOrigin() : null;
|
||||||
return target == element || (mirrorElement != null && target == mirrorElement) || (target != null && target.getNavigationElement() == element);
|
return target == element || (mirrorElement != null && target == mirrorElement) || (target != null && target.getNavigationElement() == element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import com.intellij.util.containers.ContainerUtil;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.asJava.LightClassUtil;
|
import org.jetbrains.jet.asJava.LightClassUtil;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod;
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod;
|
||||||
|
|
||||||
public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, DefinitionsScopedSearch.SearchParameters> {
|
public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, DefinitionsScopedSearch.SearchParameters> {
|
||||||
@Override
|
@Override
|
||||||
@@ -116,7 +116,8 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
|
|||||||
for (PsiMethod method : accessors) {
|
for (PsiMethod method : accessors) {
|
||||||
PsiMethod[] implementations = MethodImplementationsSearch.getMethodImplementations(method, scope);
|
PsiMethod[] implementations = MethodImplementationsSearch.getMethodImplementations(method, scope);
|
||||||
for (PsiMethod implementation : implementations) {
|
for (PsiMethod implementation : implementations) {
|
||||||
PsiElement mirrorElement = implementation instanceof JetClsMethod ? ((JetClsMethod) implementation).getOrigin() : null;
|
PsiElement mirrorElement = implementation instanceof KotlinLightMethod
|
||||||
|
? ((KotlinLightMethod) implementation).getOrigin() : null;
|
||||||
if (mirrorElement instanceof JetProperty || mirrorElement instanceof JetParameter) {
|
if (mirrorElement instanceof JetProperty || mirrorElement instanceof JetParameter) {
|
||||||
if (!consumer.process(mirrorElement)) {
|
if (!consumer.process(mirrorElement)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
||||||
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache
|
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache
|
||||||
import com.intellij.psi.PsiReference
|
import com.intellij.psi.PsiReference
|
||||||
import org.jetbrains.jet.lang.resolve.java.jetAsJava.JetClsMethod
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod
|
||||||
import org.jetbrains.jet.lang.resolve.OverridingUtil
|
import org.jetbrains.jet.lang.resolve.OverridingUtil
|
||||||
import org.jetbrains.jet.plugin.references.JetPsiReference
|
import org.jetbrains.jet.plugin.references.JetPsiReference
|
||||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor
|
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor
|
||||||
@@ -43,6 +43,7 @@ import org.jetbrains.jet.asJava.LightClassUtil
|
|||||||
import org.jetbrains.jet.lang.resolve.java.JvmAbi
|
import org.jetbrains.jet.lang.resolve.java.JvmAbi
|
||||||
import org.jetbrains.jet.codegen.PropertyCodegen
|
import org.jetbrains.jet.codegen.PropertyCodegen
|
||||||
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor
|
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor
|
||||||
|
import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod
|
||||||
|
|
||||||
// Navigation element of the resolved reference
|
// Navigation element of the resolved reference
|
||||||
// For property accessor return enclosing property
|
// For property accessor return enclosing property
|
||||||
@@ -161,7 +162,7 @@ fun PsiReference.isPropertyReadOnlyUsage(): Boolean {
|
|||||||
if (JetUsageTypeProvider.getUsageType(getElement()) == UsageType.READ) return true
|
if (JetUsageTypeProvider.getUsageType(getElement()) == UsageType.READ) return true
|
||||||
|
|
||||||
val refTarget = resolve()
|
val refTarget = resolve()
|
||||||
if (refTarget is JetClsMethod) {
|
if (refTarget is KotlinLightMethod) {
|
||||||
val origin = refTarget.getOrigin()
|
val origin = refTarget.getOrigin()
|
||||||
val declaration: JetNamedDeclaration? = when (origin) {
|
val declaration: JetNamedDeclaration? = when (origin) {
|
||||||
is JetPropertyAccessor -> origin.getParentByType(javaClass<JetProperty>())
|
is JetPropertyAccessor -> origin.getParentByType(javaClass<JetProperty>())
|
||||||
|
|||||||
Reference in New Issue
Block a user