Revert createClassLikeInfo method signature change, depreceate it ...
instead and make alternative method for refactored usages. Should fix compatibility with the Spek framework plugin.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve.lazy.data;
|
||||
|
||||
import kotlin.DeprecationLevel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.psi.KtClass;
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject;
|
||||
@@ -23,8 +24,18 @@ import org.jetbrains.kotlin.psi.KtObjectDeclaration;
|
||||
|
||||
public class KtClassInfoUtil {
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #createClassOrObjectInfo(KtClassOrObject)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@kotlin.Deprecated(message = "Use createClassOrObjectInfo(KtClassOrObject) instead", level = DeprecationLevel.ERROR)
|
||||
@NotNull
|
||||
public static KtClassOrObjectInfo<? extends KtClassOrObject> createClassLikeInfo(@NotNull KtClassOrObject classOrObject) {
|
||||
public static KtClassLikeInfo createClassLikeInfo(@NotNull KtClassOrObject classOrObject) {
|
||||
return createClassOrObjectInfo(classOrObject);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static KtClassOrObjectInfo<? extends KtClassOrObject> createClassOrObjectInfo(@NotNull KtClassOrObject classOrObject) {
|
||||
if (classOrObject instanceof KtClass) {
|
||||
return new KtClassInfo((KtClass) classOrObject);
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ abstract class AbstractPsiBasedDeclarationProvider(storageManager: StorageManage
|
||||
is KtTypeAlias ->
|
||||
typeAliases.put(declaration.nameAsName.safeNameForLazyResolve(), declaration)
|
||||
is KtClassOrObject ->
|
||||
classesAndObjects.put(declaration.nameAsName.safeNameForLazyResolve(), KtClassInfoUtil.createClassLikeInfo(declaration))
|
||||
classesAndObjects.put(declaration.nameAsName.safeNameForLazyResolve(), KtClassInfoUtil.createClassOrObjectInfo(declaration))
|
||||
is KtScript ->
|
||||
scripts.put(KtScriptInfo(declaration).script.nameAsName, KtScriptInfo(declaration))
|
||||
is KtDestructuringDeclaration -> {
|
||||
|
||||
+1
-3
@@ -18,9 +18,7 @@ import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorBase;
|
||||
import org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl;
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory;
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory0;
|
||||
import org.jetbrains.kotlin.diagnostics.Errors;
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
|
||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
@@ -454,7 +452,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
@Nullable
|
||||
private static KtClassLikeInfo getCompanionObjectInfo(@Nullable KtObjectDeclaration companionObject) {
|
||||
if (companionObject != null) {
|
||||
return KtClassInfoUtil.createClassLikeInfo(companionObject);
|
||||
return KtClassInfoUtil.createClassOrObjectInfo(companionObject);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ class LocalClassDescriptorHolder(
|
||||
},
|
||||
containingDeclaration,
|
||||
classOrObject.nameAsSafeName,
|
||||
KtClassInfoUtil.createClassLikeInfo(classOrObject),
|
||||
KtClassInfoUtil.createClassOrObjectInfo(classOrObject),
|
||||
classOrObject.hasModifier(KtTokens.EXTERNAL_KEYWORD)
|
||||
)
|
||||
writableScope?.addClassifierDescriptor(classDescriptor!!)
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ class StubBasedPackageMemberDeclarationProvider(
|
||||
|
||||
override fun getClassOrObjectDeclarations(name: Name): Collection<KtClassOrObjectInfo<*>> = runReadAction {
|
||||
KotlinFullClassNameIndex.getInstance().get(childName(name), project, searchScope)
|
||||
.map { KtClassInfoUtil.createClassLikeInfo(it) }
|
||||
.map { KtClassInfoUtil.createClassOrObjectInfo(it) }
|
||||
}
|
||||
|
||||
override fun getScriptDeclarations(name: Name): Collection<KtScriptInfo> = runReadAction {
|
||||
|
||||
Reference in New Issue
Block a user