diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/CommentSaver.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/CommentSaver.kt index 85c3757aadc..4583870720c 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/CommentSaver.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/CommentSaver.kt @@ -448,7 +448,7 @@ public class CommentSaver(originalElements: PsiChildRange, private val saveLineB private val nonSpaceAndNonEmptyFilter = { element: PsiElement -> element !is PsiWhiteSpace && element.getTextLength() > 0 } companion object { - //TODO: making it private causes error on runtime + //TODO: making it private causes error on runtime (KT-7874?) val PsiElement.tokenType: JetToken? get() = getNode().getElementType() as? JetToken } diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/DeprecatedCallableAddReplaceWithIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/DeprecatedCallableAddReplaceWithIntention.kt index 0e49e33b434..a71469dfb9d 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/DeprecatedCallableAddReplaceWithIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/DeprecatedCallableAddReplaceWithIntention.kt @@ -46,7 +46,6 @@ public class DeprecatedCallableAddReplaceWithInspection : IntentionBasedInspecti public class DeprecatedCallableAddReplaceWithIntention : JetSelfTargetingRangeIntention( javaClass(), "Add 'replaceWith' argument to specify replacement pattern", "Add 'replaceWith' argument to 'deprecated' annotation" ) { - //TODO: use ReplaceWith from package kotlin private class ReplaceWith(val expression: String, vararg val imports: String) override fun applicabilityRange(element: JetCallableDeclaration): TextRange? { @@ -99,7 +98,7 @@ public class DeprecatedCallableAddReplaceWithIntention : JetSelfTargetingRangeIn if (DescriptorUtils.getFqName(descriptor).asString() != "kotlin.deprecated") continue val replaceWithArguments = resolvedCall.getValueArguments().entrySet() - .single { it.key.getName().asString() == "replaceWith"/*TODO*/ }.value + .single { it.key.getName().asString() == "replaceWith"/*TODO: kotlin.deprecated::replaceWith.name*/ }.value return if (replaceWithArguments.getArguments().isEmpty()) entry else null } return null diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedSymbolUsageFixBase.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedSymbolUsageFixBase.kt index 65a1e0d6c46..45b78884bf4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedSymbolUsageFixBase.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedSymbolUsageFixBase.kt @@ -109,11 +109,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 - //TODO: code duplication - val replaceWithValue = annotation.argumentValue("replaceWith"/*TODO*/) as? AnnotationDescriptor ?: return null - val pattern = replaceWithValue.argumentValue("expression"/*TODO*/) as? String ?: 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 if (pattern.isEmpty()) return null - val importValues = replaceWithValue.argumentValue("imports"/*TODO*/) as? List<*> ?: return null + val importValues = replaceWithValue.argumentValue("imports"/*TODO: kotlin.ReplaceWith::imports.name*/) as? List<*> ?: return null if (importValues.any { it !is StringValue }) return null val imports = importValues.map { (it as StringValue).getValue() } @@ -303,8 +302,6 @@ public abstract class DeprecatedSymbolUsageFixBase( resolvedCall: ResolvedCall, bindingContext: BindingContext, project: Project): Argument? { - //TODO: named parameters - keep named form if makes sense - //TODO: keep functional literal argument form val resolvedArgument = resolvedCall.getValueArguments()[parameter]!! when (resolvedArgument) { is ExpressionValueArgument -> { @@ -550,7 +547,6 @@ public abstract class DeprecatedSymbolUsageFixBase( } } - //TODO: do this before processing of optional parameters private fun restoreFunctionLiteralArguments(expression: JetExpression) { val callExpressions = ArrayList() diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt index 259211b8576..687d553e9b9 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt @@ -49,7 +49,6 @@ import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import java.util.ArrayList import java.util.LinkedHashSet -//TODO: use ReplaceWith from package kotlin data class ReplaceWith(val expression: String, vararg val imports: String) object ReplaceWithAnnotationAnalyzer {