Minor
This commit is contained in:
@@ -199,7 +199,7 @@ public val DeclarationDescriptor.parentsWithSelf: Sequence<DeclarationDescriptor
|
||||
public val DeclarationDescriptor.parents: Sequence<DeclarationDescriptor>
|
||||
get() = parentsWithSelf.drop(1)
|
||||
|
||||
private val HIDDEN_ANNOTATION_FQ_NAME = FqName("kotlin.HiddenDeclaration") /*TODO*/
|
||||
private val HIDDEN_ANNOTATION_FQ_NAME = FqName(HiddenDeclaration::class.qualifiedName!!)
|
||||
|
||||
public fun DeclarationDescriptor.isAnnotatedAsHidden(): Boolean = annotations.findAnnotation(HIDDEN_ANNOTATION_FQ_NAME) != null
|
||||
|
||||
|
||||
@@ -107,10 +107,10 @@ public abstract class DeprecatedSymbolUsageFixBase(
|
||||
public fun replaceWithPattern(descriptor: DeclarationDescriptor, project: Project): ReplaceWith? {
|
||||
val annotationClass = descriptor.builtIns.getDeprecatedAnnotation()
|
||||
val annotation = descriptor.getAnnotations().findAnnotation(DescriptorUtils.getFqNameSafe(annotationClass)) ?: return null
|
||||
val replaceWithValue = annotation.argumentValue("replaceWith"/*TODO: kotlin.deprecated::replaceWith.name*/) as? AnnotationDescriptor ?: return null
|
||||
val pattern = replaceWithValue.argumentValue("expression"/*TODO: kotlin.ReplaceWith::expression.name*/) as? String ?: return null
|
||||
val replaceWithValue = annotation.argumentValue(kotlin.deprecated::replaceWith.name) as? AnnotationDescriptor ?: return null
|
||||
val pattern = replaceWithValue.argumentValue(kotlin.ReplaceWith::expression.name) as? String ?: return null
|
||||
if (pattern.isEmpty()) return null
|
||||
val importValues = replaceWithValue.argumentValue("imports"/*TODO: kotlin.ReplaceWith::imports.name*/) as? List<*> ?: return null
|
||||
val importValues = replaceWithValue.argumentValue(kotlin.ReplaceWith::imports.name) as? List<*> ?: return null
|
||||
if (importValues.any { it !is StringValue }) return null
|
||||
val imports = importValues.map { (it as StringValue).value }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user