Light Classes: Delegate getUseScope() to original elements
#KT-6699 Fixed
This commit is contained in:
+7
@@ -31,6 +31,7 @@ import com.intellij.psi.impl.java.stubs.PsiJavaFileStub;
|
||||
import com.intellij.psi.impl.light.LightClass;
|
||||
import com.intellij.psi.impl.light.LightMethod;
|
||||
import com.intellij.psi.scope.PsiScopeProcessor;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.psi.stubs.PsiClassHolderFileStub;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
@@ -577,6 +578,12 @@ public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SearchScope getUseScope() {
|
||||
return getOrigin().getUseScope();
|
||||
}
|
||||
|
||||
private static boolean checkSuperTypeByFQName(@NotNull ClassDescriptor classDescriptor, @NotNull String qualifiedName, Boolean deep) {
|
||||
if (CommonClassNames.JAVA_LANG_OBJECT.equals(qualifiedName)) return true;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class KotlinLightField<T extends JetDeclaration, D extends PsiFi
|
||||
@NotNull
|
||||
@Override
|
||||
public SearchScope getUseScope() {
|
||||
return delegate.getUseScope();
|
||||
return origin.getUseScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.psi.PsiAnnotationOwner;
|
||||
import com.intellij.psi.PsiModifierList;
|
||||
import com.intellij.psi.PsiParameter;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -105,4 +107,11 @@ public class KotlinLightParameter extends LightParameter implements KotlinLightE
|
||||
public Language getLanguage() {
|
||||
return JetLanguage.INSTANCE;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SearchScope getUseScope() {
|
||||
JetParameter origin = getOrigin();
|
||||
return origin != null ? origin.getUseScope() : GlobalSearchScope.EMPTY_SCOPE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.asJava;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.light.AbstractLightClass;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.idea.JetLanguage;
|
||||
@@ -135,6 +136,12 @@ public class KotlinLightTypeParameter
|
||||
return JetLanguage.INSTANCE;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SearchScope getUseScope() {
|
||||
return getOrigin().getUseScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) return true;
|
||||
|
||||
Reference in New Issue
Block a user