More consistent intention texts

This commit is contained in:
Valentin Kipyatkov
2015-07-21 13:26:13 +03:00
parent fb430575c0
commit 7611f480c1
3 changed files with 7 additions and 8 deletions
@@ -36,7 +36,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
public class AddForLoopIndicesIntention : JetSelfTargetingRangeIntention<JetForExpression>(javaClass(), "Add indices to 'for' loop"), LowPriorityAction {
public class AddForLoopIndicesIntention : JetSelfTargetingRangeIntention<JetForExpression>(javaClass(), "Add indices to for-loop"), LowPriorityAction {
private val WITH_INDEX_FQ_NAME = "kotlin.withIndex"
override fun applicabilityRange(element: JetForExpression): TextRange? {
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
public class ConvertForEachToForLoopIntention : JetSelfTargetingOffsetIndependentIntention<JetSimpleNameExpression>(javaClass(), "Replace with a for loop") {
public class ConvertForEachToForLoopIntention : JetSelfTargetingOffsetIndependentIntention<JetSimpleNameExpression>(javaClass(), "Replace with a for-loop") {
override fun isApplicableTo(element: JetSimpleNameExpression): Boolean {
if (element.getReferencedName() != "forEach") return false
@@ -16,19 +16,18 @@
package org.jetbrains.kotlin.idea.intentions
import com.intellij.find.FindManager
import com.intellij.find.impl.FindManagerImpl
import com.intellij.openapi.editor.Editor
import com.intellij.psi.search.searches.ReferencesSearch
import com.intellij.usageView.UsageInfo
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.findUsages.KotlinPropertyFindUsagesOptions
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.JetCallExpression
import org.jetbrains.kotlin.psi.JetDotQualifiedExpression
import org.jetbrains.kotlin.psi.JetForExpression
import org.jetbrains.kotlin.psi.JetPsiFactory
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
public class RemoveForLoopIndicesIntention : JetSelfTargetingIntention<JetForExpression>(
javaClass(), "Remove indices in 'for' loop") {
javaClass(), "Remove indices in for-loop") {
override fun applyTo(element: JetForExpression, editor: Editor) {
val parameter = element.getMultiParameter()!!
val range = element.getLoopRange() as JetDotQualifiedExpression