From 2203fb3231c22170a4b2ff2b26c37259524197e7 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 10 Jun 2015 10:55:11 +0300 Subject: [PATCH] Renamed intention class --- .../after.kt.template | 0 .../before.kt.template | 0 .../description.html | 0 idea/src/META-INF/plugin.xml | 2 +- .../debugger/evaluate/extractFunctionForDebuggerUtil.kt | 4 ++-- ...Arguments.kt => InsertExplicitTypeArgumentsIntention.kt} | 2 +- .../kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt | 6 +++--- .../intentions/insertExplicitTypeArguments/.intention | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename idea/resources/intentionDescriptions/{InsertExplicitTypeArguments => InsertExplicitTypeArgumentsIntention}/after.kt.template (100%) rename idea/resources/intentionDescriptions/{InsertExplicitTypeArguments => InsertExplicitTypeArgumentsIntention}/before.kt.template (100%) rename idea/resources/intentionDescriptions/{InsertExplicitTypeArguments => InsertExplicitTypeArgumentsIntention}/description.html (100%) rename idea/src/org/jetbrains/kotlin/idea/intentions/{InsertExplicitTypeArguments.kt => InsertExplicitTypeArgumentsIntention.kt} (94%) diff --git a/idea/resources/intentionDescriptions/InsertExplicitTypeArguments/after.kt.template b/idea/resources/intentionDescriptions/InsertExplicitTypeArgumentsIntention/after.kt.template similarity index 100% rename from idea/resources/intentionDescriptions/InsertExplicitTypeArguments/after.kt.template rename to idea/resources/intentionDescriptions/InsertExplicitTypeArgumentsIntention/after.kt.template diff --git a/idea/resources/intentionDescriptions/InsertExplicitTypeArguments/before.kt.template b/idea/resources/intentionDescriptions/InsertExplicitTypeArgumentsIntention/before.kt.template similarity index 100% rename from idea/resources/intentionDescriptions/InsertExplicitTypeArguments/before.kt.template rename to idea/resources/intentionDescriptions/InsertExplicitTypeArgumentsIntention/before.kt.template diff --git a/idea/resources/intentionDescriptions/InsertExplicitTypeArguments/description.html b/idea/resources/intentionDescriptions/InsertExplicitTypeArgumentsIntention/description.html similarity index 100% rename from idea/resources/intentionDescriptions/InsertExplicitTypeArguments/description.html rename to idea/resources/intentionDescriptions/InsertExplicitTypeArgumentsIntention/description.html diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 2139f428048..2d42c6dd175 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -727,7 +727,7 @@ - org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArguments + org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArgumentsIntention Kotlin diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt index c205f0b953c..63c1f872c6c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.idea.util.application.runReadAction import com.intellij.psi.PsiManager import com.intellij.psi.impl.PsiModificationTrackerImpl import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArguments +import org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArgumentsIntention import org.jetbrains.kotlin.idea.util.psi.patternMatching.toRange import org.jetbrains.kotlin.idea.actions.internal.KotlinInternalMode import org.jetbrains.kotlin.idea.caches.resolve.analyze @@ -252,7 +252,7 @@ private fun addDebugExpressionBeforeContextElement(codeFragment: JetCodeFragment private fun replaceByRunFunction(expression: JetExpression): JetCallExpression { val callExpression = JetPsiFactory(expression).createExpression("run { \n${expression.getText()} \n}") as JetCallExpression val replaced = expression.replaced(callExpression) - val typeArguments = InsertExplicitTypeArguments.createTypeArguments(replaced, replaced.analyze()) + val typeArguments = InsertExplicitTypeArgumentsIntention.createTypeArguments(replaced, replaced.analyze()) if (typeArguments?.getArguments()?.isNotEmpty() ?: false) { val calleeExpression = replaced.getCalleeExpression() replaced.addAfter(typeArguments!!, calleeExpression) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArgumentsIntention.kt similarity index 94% rename from idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt rename to idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArgumentsIntention.kt index 5858d41507b..0e2296c19b8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArguments.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/InsertExplicitTypeArgumentsIntention.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall import org.jetbrains.kotlin.types.ErrorUtils -public class InsertExplicitTypeArguments : JetSelfTargetingRangeIntention(javaClass(), "Add explicit type arguments"), LowPriorityAction { +public class InsertExplicitTypeArgumentsIntention : JetSelfTargetingRangeIntention(javaClass(), "Add explicit type arguments"), LowPriorityAction { override fun applicabilityRange(element: JetCallExpression): TextRange? { return if (isApplicableTo(element, element.analyze())) element.getCalleeExpression()!!.getTextRange() else null } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt index 5774b3029a0..2bc6c77d327 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ReplaceWithAnnotationAnalyzer.kt @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.idea.core.copied import org.jetbrains.kotlin.idea.core.replaced import org.jetbrains.kotlin.idea.imports.canBeReferencedViaImport import org.jetbrains.kotlin.idea.imports.importableFqName -import org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArguments +import org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArgumentsIntention import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.FqNameUnsafe import org.jetbrains.kotlin.name.Name @@ -100,8 +100,8 @@ object ReplaceWithAnnotationAnalyzer { val typeArgsToAdd = ArrayList>() expression.forEachDescendantOfType { - if (InsertExplicitTypeArguments.isApplicableTo(it, bindingContext)) { - typeArgsToAdd.add(it to InsertExplicitTypeArguments.createTypeArguments(it, bindingContext)!!) + if (InsertExplicitTypeArgumentsIntention.isApplicableTo(it, bindingContext)) { + typeArgsToAdd.add(it to InsertExplicitTypeArgumentsIntention.createTypeArguments(it, bindingContext)!!) } } diff --git a/idea/testData/intentions/insertExplicitTypeArguments/.intention b/idea/testData/intentions/insertExplicitTypeArguments/.intention index a8098650d35..0264d06ad81 100644 --- a/idea/testData/intentions/insertExplicitTypeArguments/.intention +++ b/idea/testData/intentions/insertExplicitTypeArguments/.intention @@ -1 +1 @@ -org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArguments +org.jetbrains.kotlin.idea.intentions.InsertExplicitTypeArgumentsIntention