From bbbdfd25d9a80167e787a70175ec787ce4e7b700 Mon Sep 17 00:00:00 2001 From: Ross Hanson Date: Fri, 9 May 2014 05:36:46 -0400 Subject: [PATCH] KT-4820: Added new tests, introduced functionality to detect overridden functions, other minor fixes --- .../before.kt.template | 2 +- .../intentions/AddForLoopIndicesIntention.kt | 28 +++++------ .../RemoveForLoopIndicesIntention.kt | 49 +++++++------------ .../inapplicableExistingIndices.kt | 2 +- .../inapplicableOverridenFunction.kt | 9 ++++ .../inapplicableSyntaxError.kt | 7 +++ .../inapplicableUnorderedCollection.kt | 2 +- .../addForLoopIndicesIntention/intArray.kt | 6 +++ .../intArray.kt.after | 6 +++ .../addForLoopIndicesIntention/iterable.kt | 6 +++ .../iterable.kt.after | 6 +++ .../listWithType.kt | 2 +- .../listWithType.kt.after | 2 +- .../addForLoopIndicesIntention/objectArray.kt | 6 +++ .../objectArray.kt.after | 6 +++ .../simpleIntList.kt | 2 +- .../simpleIntList.kt.after | 2 +- .../simpleSortedMap.kt | 6 --- .../simpleSortedMap.kt.after | 6 --- .../addForLoopIndicesIntention/stream.kt | 6 +++ .../stream.kt.after | 6 +++ .../addForLoopIndicesIntention/string.kt | 6 +++ .../string.kt.after | 6 +++ .../inapplicableIndexUse.kt | 6 ++- .../inapplicableOverridenFunction.kt | 11 +++++ .../loopWithType.kt | 2 +- .../loopWithType.kt.after | 2 +- .../simpleLoopWithIndices.kt | 2 +- .../simpleLoopWithIndices.kt.after | 2 +- .../CodeTransformationTestGenerated.java | 41 ++++++++++++++-- 30 files changed, 170 insertions(+), 75 deletions(-) create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/inapplicableOverridenFunction.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/inapplicableSyntaxError.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/intArray.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/intArray.kt.after create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/iterable.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/iterable.kt.after create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt.after delete mode 100644 idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt delete mode 100644 idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt.after create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/stream.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/stream.kt.after create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/string.kt create mode 100644 idea/testData/intentions/addForLoopIndicesIntention/string.kt.after create mode 100644 idea/testData/intentions/removeForLoopIndicesIntention/inapplicableOverridenFunction.kt diff --git a/idea/resources/intentionDescriptions/RemoveForLoopIndicesIntention/before.kt.template b/idea/resources/intentionDescriptions/RemoveForLoopIndicesIntention/before.kt.template index 362674c6894..6c743b16877 100644 --- a/idea/resources/intentionDescriptions/RemoveForLoopIndicesIntention/before.kt.template +++ b/idea/resources/intentionDescriptions/RemoveForLoopIndicesIntention/before.kt.template @@ -1,3 +1,3 @@ -for ((i,x) in foo.withIndices()) { +for ((i, x) in foo.withIndices()) { } \ No newline at end of file diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/AddForLoopIndicesIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/AddForLoopIndicesIntention.kt index e35eac6c5d8..1fc57a46af1 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/AddForLoopIndicesIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/AddForLoopIndicesIntention.kt @@ -23,18 +23,13 @@ import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression import com.intellij.psi.util.PsiTreeUtil import com.intellij.psi.PsiDocumentManager import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache -import org.jetbrains.jet.di.InjectorForMacros import org.jetbrains.jet.lang.resolve.BindingContext -import org.jetbrains.jet.lang.types.TypeUtils -import org.jetbrains.jet.lang.resolve.ObservableBindingTrace -import org.jetbrains.jet.lang.resolve.BindingTraceContext -import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo import org.jetbrains.jet.lang.psi.JetParenthesizedExpression import com.intellij.codeInsight.template.TemplateBuilderImpl import com.intellij.codeInsight.template.impl.TemplateManagerImpl import org.jetbrains.jet.lang.resolve.DescriptorUtils -import org.jetbrains.jet.lang.descriptors.ModuleDescriptor - +import org.jetbrains.jet.analyzer.analyzeInContext +import org.jetbrains.jet.lang.psi.JetCallExpression public class AddForLoopIndicesIntention : JetSelfTargetingIntention( "add.for.loop.indices", javaClass()) { @@ -69,19 +64,20 @@ public class AddForLoopIndicesIntention : JetSelfTargetingIntention())!! - val components = InjectorForMacros(element.getProject(), module) - val dataFlowInfo = bindingContext[BindingContext.NON_DEFAULT_EXPRESSION_DATA_FLOW, element] ?: DataFlowInfo.EMPTY - val bindingTrace = ObservableBindingTrace(BindingTraceContext()) - val expressionType = components.getExpressionTypingServices()!!.getTypeInfo(scope, potentialExpression, TypeUtils.NO_EXPECTED_TYPE, dataFlowInfo, bindingTrace) - return expressionType.getType() != null + val functionSelector = potentialExpression.getSelectorExpression() as JetCallExpression + val updatedContext = potentialExpression.analyzeInContext(scope) + val callScope = updatedContext[BindingContext.RESOLVED_CALL, functionSelector.getCalleeExpression()!!] ?: return false + val callFqName = DescriptorUtils.getFqNameSafe(callScope.getCandidateDescriptor()) + return callFqName.toString() == "kotlin.withIndices" } } \ No newline at end of file diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/RemoveForLoopIndicesIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/RemoveForLoopIndicesIntention.kt index 593902be45e..2bbbee48faa 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/RemoveForLoopIndicesIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/RemoveForLoopIndicesIntention.kt @@ -18,25 +18,16 @@ package org.jetbrains.jet.plugin.intentions import org.jetbrains.jet.lang.psi.JetForExpression import com.intellij.openapi.editor.Editor -import org.jetbrains.jet.lang.psi.JetPsiFactory import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression import org.jetbrains.jet.lang.psi.JetPsiUtil -import org.jetbrains.jet.lang.cfg.PseudocodeVariablesData.VariableUseState -import org.jetbrains.jet.lang.cfg.pseudocode.PseudocodeUtil import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache -import org.jetbrains.jet.lang.psi.JetFile -import org.jetbrains.jet.lang.resolve.ObservableBindingTrace -import org.jetbrains.jet.lang.resolve.BindingTraceContext -import org.jetbrains.jet.lang.cfg.JetFlowInformationProvider -import org.jetbrains.jet.lang.cfg.JetControlFlowProcessor -import com.intellij.debugger.jdi.LocalVariablesUtil -import com.siyeh.ig.psiutils.VariableAccessUtils -import com.google.dart.compiler.util.AstUtil import com.intellij.find.FindManager import com.intellij.find.impl.FindManagerImpl import com.intellij.usageView.UsageInfo -import com.intellij.util.Processor import org.jetbrains.jet.plugin.findUsages.KotlinPropertyFindUsagesOptions +import org.jetbrains.jet.lang.resolve.BindingContext +import org.jetbrains.jet.lang.psi.JetCallExpression +import org.jetbrains.jet.lang.resolve.DescriptorUtils public class RemoveForLoopIndicesIntention : JetSelfTargetingIntention( "remove.for.loop.indices", javaClass()) { @@ -46,7 +37,8 @@ public class RemoveForLoopIndicesIntention : JetSelfTargetingIntention { - override fun process(t: UsageInfo?): Boolean { - usageCount[0] = usageCount[0] + 1 - return true - } - } - findHandler.processElementUsages(indexVar,processor,options) - } - } - usageFinderRunnable.run() - return usageCount[0] == 0 + var usageCount = 0 + val processorLambda: (UsageInfo?) -> Boolean = { t -> usageCount++; false } + findHandler.processElementUsages(indexVar, processorLambda, options) + return usageCount == 0 } } \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/inapplicableExistingIndices.kt b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableExistingIndices.kt index 486762bc85c..b9b2b899071 100644 --- a/idea/testData/intentions/addForLoopIndicesIntention/inapplicableExistingIndices.kt +++ b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableExistingIndices.kt @@ -1,5 +1,5 @@ //IS_APPLICABLE: FALSE -//ERROR: Unresolved reference: withIndices +// WITH_RUNTIME fun b(c: List) { for ((indexVariable, d) in c.withIndices()) { diff --git a/idea/testData/intentions/addForLoopIndicesIntention/inapplicableOverridenFunction.kt b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableOverridenFunction.kt new file mode 100644 index 00000000000..c16ceeb8a97 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableOverridenFunction.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME +// IS_APPLICABLE: FALSE +fun String.withIndices(): Int = 42 + +fun foo(s: String) { + for (a in s) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/inapplicableSyntaxError.kt b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableSyntaxError.kt new file mode 100644 index 00000000000..130fb1e80ba --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableSyntaxError.kt @@ -0,0 +1,7 @@ +//IS_APPLICABLE: FALSE +//ERROR: Unresolved reference: b +fun foo() { + for (a in b) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/inapplicableUnorderedCollection.kt b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableUnorderedCollection.kt index 7a8f65b05a4..42c9ecb7ee7 100644 --- a/idea/testData/intentions/addForLoopIndicesIntention/inapplicableUnorderedCollection.kt +++ b/idea/testData/intentions/addForLoopIndicesIntention/inapplicableUnorderedCollection.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: FALSE -// ERROR: For-loop range must have an iterator() method +// WITH_RUNTIME fun foo(bar: Map) { for (a in bar) { diff --git a/idea/testData/intentions/addForLoopIndicesIntention/intArray.kt b/idea/testData/intentions/addForLoopIndicesIntention/intArray.kt new file mode 100644 index 00000000000..40ab0ca1785 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/intArray.kt @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: IntArray) { + for (a in bar) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/intArray.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/intArray.kt.after new file mode 100644 index 00000000000..317eb113f87 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/intArray.kt.after @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: IntArray) { + for ((index, a) in bar.withIndices()) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/iterable.kt b/idea/testData/intentions/addForLoopIndicesIntention/iterable.kt new file mode 100644 index 00000000000..aca19b4b400 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/iterable.kt @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: Iterable) { + for (a in bar) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/iterable.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/iterable.kt.after new file mode 100644 index 00000000000..4351c3856a9 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/iterable.kt.after @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: Iterable) { + for ((index, a) in bar.withIndices()) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt b/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt index 87e8b8a6e66..0cadfa4e63b 100644 --- a/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt +++ b/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt @@ -1,4 +1,4 @@ -// ERROR: Unresolved reference: listOf +// WITH_RUNTIME fun a() { val b = listOf(1,2,3,4,5) for (c : Int in b) { diff --git a/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt.after index 652142c4963..633543f3ffe 100644 --- a/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt.after +++ b/idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt.after @@ -1,4 +1,4 @@ -// ERROR: Unresolved reference: listOf +// WITH_RUNTIME fun a() { val b = listOf(1,2,3,4,5) for ((index, c : Int) in b.withIndices()) { diff --git a/idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt b/idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt new file mode 100644 index 00000000000..32c665ac8a3 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: Array) { + for (a in bar) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt.after new file mode 100644 index 00000000000..07f226b0945 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt.after @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: Array) { + for ((index, a) in bar.withIndices()) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt b/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt index b3a5c63ecf1..f7472f3e066 100644 --- a/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt +++ b/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt @@ -1,4 +1,4 @@ -// ERROR: Unresolved reference: listOf +// WITH_RUNTIME fun a() { val b = listOf(1,2,3,4,5) for (c in b) { diff --git a/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt.after index 51d6a853ab6..68e44be3929 100644 --- a/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt.after +++ b/idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt.after @@ -1,4 +1,4 @@ -// ERROR: Unresolved reference: listOf +// WITH_RUNTIME fun a() { val b = listOf(1,2,3,4,5) for ((index, c) in b.withIndices()) { diff --git a/idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt b/idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt deleted file mode 100644 index dea2fc57b32..00000000000 --- a/idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt +++ /dev/null @@ -1,6 +0,0 @@ -//ERROR: Unresolved reference: SortedMap -fun a(b: SortedMap) { - for (c in b) { - - } -} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt.after deleted file mode 100644 index dffa48df2f5..00000000000 --- a/idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt.after +++ /dev/null @@ -1,6 +0,0 @@ -//ERROR: Unresolved reference: SortedMap -fun a(b: SortedMap) { - for ((index, c) in b.withIndices()) { - - } -} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/stream.kt b/idea/testData/intentions/addForLoopIndicesIntention/stream.kt new file mode 100644 index 00000000000..94eb1690af9 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/stream.kt @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: Stream) { + for (a in bar) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/stream.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/stream.kt.after new file mode 100644 index 00000000000..15ba5726654 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/stream.kt.after @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: Stream) { + for ((index, a) in bar.withIndices()) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/string.kt b/idea/testData/intentions/addForLoopIndicesIntention/string.kt new file mode 100644 index 00000000000..d838de6f97e --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/string.kt @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: String) { + for (a in bar) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/addForLoopIndicesIntention/string.kt.after b/idea/testData/intentions/addForLoopIndicesIntention/string.kt.after new file mode 100644 index 00000000000..1d015a4fd97 --- /dev/null +++ b/idea/testData/intentions/addForLoopIndicesIntention/string.kt.after @@ -0,0 +1,6 @@ +//WITH_RUNTIME +fun foo(bar: String) { + for ((index, a) in bar.withIndices()) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableIndexUse.kt b/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableIndexUse.kt index 554c2be803d..9f043ae07e4 100644 --- a/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableIndexUse.kt +++ b/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableIndexUse.kt @@ -1,7 +1,9 @@ // IS_APPLICABLE: FALSE -//ERROR: Unresolved reference: withIndices -fun foo(b: List) { +//WITH_RUNTIME + +fun foo(b: List) : Int { for ((i, c) in b.withIndices()) { return i } + return 0 } \ No newline at end of file diff --git a/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableOverridenFunction.kt b/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableOverridenFunction.kt new file mode 100644 index 00000000000..7f3a7fd589d --- /dev/null +++ b/idea/testData/intentions/removeForLoopIndicesIntention/inapplicableOverridenFunction.kt @@ -0,0 +1,11 @@ +// WITH_RUNTIME +// IS_APPLICABLE: FALSE +import java.util.LinkedList + +fun Int.withIndices(): List> = LinkedList>() + +fun foo(s: Int) { + for ((index, a) in s.withIndices()) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt b/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt index ce29523424a..116f672c62a 100644 --- a/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt +++ b/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt @@ -1,4 +1,4 @@ -//ERROR: Unresolved reference: withIndices +//WITH_RUNTIME fun foo(bar: List) { for ((i : Int, b: Int) in bar.withIndices()) { diff --git a/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt.after b/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt.after index 401456e86c3..59f246f69bd 100644 --- a/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt.after +++ b/idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt.after @@ -1,4 +1,4 @@ -//ERROR: Unresolved reference: withIndices +//WITH_RUNTIME fun foo(bar: List) { for (b: Int in bar) { diff --git a/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt b/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt index b66702744fd..f734f259947 100644 --- a/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt +++ b/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt @@ -1,4 +1,4 @@ -//ERROR: Unresolved reference: withIndices +//WITH_RUNTIME fun foo(bar: List) { for ((i,a) in bar.withIndices()) { diff --git a/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt.after b/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt.after index 08489a0e8a4..1a04724adc8 100644 --- a/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt.after +++ b/idea/testData/intentions/removeForLoopIndicesIntention/simpleLoopWithIndices.kt.after @@ -1,4 +1,4 @@ -//ERROR: Unresolved reference: withIndices +//WITH_RUNTIME fun foo(bar: List) { for (a in bar) { diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java index a89feba5e2d..07b8675f937 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java @@ -4252,24 +4252,54 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/inapplicableExistingIndices.kt"); } + @TestMetadata("inapplicableOverridenFunction.kt") + public void testInapplicableOverridenFunction() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/inapplicableOverridenFunction.kt"); + } + + @TestMetadata("inapplicableSyntaxError.kt") + public void testInapplicableSyntaxError() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/inapplicableSyntaxError.kt"); + } + @TestMetadata("inapplicableUnorderedCollection.kt") public void testInapplicableUnorderedCollection() throws Exception { doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/inapplicableUnorderedCollection.kt"); } + @TestMetadata("intArray.kt") + public void testIntArray() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/intArray.kt"); + } + + @TestMetadata("iterable.kt") + public void testIterable() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/iterable.kt"); + } + @TestMetadata("listWithType.kt") public void testListWithType() throws Exception { doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/listWithType.kt"); } + @TestMetadata("objectArray.kt") + public void testObjectArray() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/objectArray.kt"); + } + @TestMetadata("simpleIntList.kt") public void testSimpleIntList() throws Exception { doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/simpleIntList.kt"); } - @TestMetadata("simpleSortedMap.kt") - public void testSimpleSortedMap() throws Exception { - doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/simpleSortedMap.kt"); + @TestMetadata("stream.kt") + public void testStream() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/stream.kt"); + } + + @TestMetadata("string.kt") + public void testString() throws Exception { + doTestAddForLoopIndicesIntention("idea/testData/intentions/addForLoopIndicesIntention/string.kt"); } } @@ -4290,6 +4320,11 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT doTestRemoveForLoopIndicesIntention("idea/testData/intentions/removeForLoopIndicesIntention/inapplicableIndexUse.kt"); } + @TestMetadata("inapplicableOverridenFunction.kt") + public void testInapplicableOverridenFunction() throws Exception { + doTestRemoveForLoopIndicesIntention("idea/testData/intentions/removeForLoopIndicesIntention/inapplicableOverridenFunction.kt"); + } + @TestMetadata("loopWithType.kt") public void testLoopWithType() throws Exception { doTestRemoveForLoopIndicesIntention("idea/testData/intentions/removeForLoopIndicesIntention/loopWithType.kt");