Renamed intentions package

This commit is contained in:
Valentin Kipyatkov
2015-05-12 13:57:45 +03:00
parent 8095aabd42
commit 096df91972
142 changed files with 509 additions and 509 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceBinaryInfixIntention
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun plus(a: Int, vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test.p<caret>lus(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun plus(a: Int, vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test + 1
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun plus(vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test.p<caret>lus(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun plus(vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test + 1
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun plus(a: Int, b: Int=5): Test = Test()
}
val test = Test()
test.pl<caret>us(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun plus(a: Int, b: Int=5): Test = Test()
}
val test = Test()
test + 1
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '/' operator
fun test() {
class Test {
fun div(a: Int): Test = Test()
}
val test = Test()
test.div<caret>(1)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '/' operator
fun test() {
class Test {
fun div(a: Int): Test = Test()
}
val test = Test()
test / 1
}
@@ -0,0 +1,6 @@
fun test() {
class Test()
fun Test.div(a: Int): Test = Test()
val test = Test()
test.div<caret>(1)
}
@@ -0,0 +1,6 @@
fun test() {
class Test()
fun Test.div(a: Int): Test = Test()
val test = Test()
test / 1
}
@@ -0,0 +1,9 @@
fun test() {
class Test {
fun plus(fn: () -> Test): Test = fn()
}
val test = Test()
test.pl<caret>us {
Test()
}
}
@@ -0,0 +1,9 @@
fun test() {
class Test {
fun plus(fn: () -> Test): Test = fn()
}
val test = Test()
test + {
Test()
}
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '-' operator
fun test() {
class Test {
fun minus(a: Int): Test = Test()
}
val test = Test()
test.min<caret>us(1)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '-' operator
fun test() {
class Test {
fun minus(a: Int): Test = Test()
}
val test = Test()
test - 1
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun plus(a: Int=1, b: Int=2) : Int = 0
}
val test = Test()
test.p<caret>lus(b=3)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '%' operator
fun test() {
class Test {
fun mod(a: Int): Test = Test()
}
val test = Test()
test.mod<caret>(1)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '%' operator
fun test() {
class Test {
fun mod(a: Int): Test = Test()
}
val test = Test()
test % 1
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test {
fun plus(a: Int, b: Int): Test = Test()
}
val test = Test()
test.pl<caret>us(1, 2)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '+' operator
fun test() {
class Test {
fun plus(a: Int): Test = Test()
}
val test = Test()
test.pl<caret>us(1)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '+' operator
fun test() {
class Test {
fun plus(a: Int): Test = Test()
}
val test = Test()
test + 1
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '..' operator
fun test() {
class Test {
fun rangeTo(a: Int): Test = Test()
}
val test = Test()
test.rangeTo<caret>(1)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '..' operator
fun test() {
class Test {
fun rangeTo(a: Int): Test = Test()
}
val test = Test()
test..1
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '*' operator
fun test() {
class Test {
fun times(a: Int): Test = Test()
}
val test = Test()
test.time<caret>s(1)
}
@@ -0,0 +1,8 @@
// INTENTION_TEXT: Replace with '*' operator
fun test() {
class Test {
fun times(a: Int): Test = Test()
}
val test = Test()
test * 1
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test {
fun div<T>(a: Test): T? = a as? T
}
val test = Test()
test.div<caret><Int>(Test())
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun plus(vararg b: Int, c: Int = 0): Int = 0
}
val test = Test()
test.plus<caret>(c=5)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun plus(vararg b: Int, c: Int = 0): Int = 0
}
val test = Test()
test.plus<caret>(0, 1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun plus(a: Int): Test = Test()
}
val test = Test()
test.pl<caret>us(a=1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun plus(a: Int): Test = Test()
}
val test = Test()
test + 1
}
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceContainsIntention
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
test.contai<caret>ns(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
1 in test
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(c: Int, vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
test.contai<caret>ns(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(c: Int, vararg a: Int, b: Int = 0): Boolean = true
}
val test = Test()
1 in test
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(a: Int, b: Int=5) : Boolean = true
}
val test = Test()
test.c<caret>ontains(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(a: Int, b: Int=5) : Boolean = true
}
val test = Test()
1 in test
}
@@ -0,0 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(a: Int) : Boolean = true
}
val test = Test()
doSomething(test.c<caret>ontains(0).toString())
}
@@ -0,0 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(a: Int) : Boolean = true
}
val test = Test()
doSomething((0 in test).toString())
}
@@ -0,0 +1,6 @@
fun test() {
class Test()
fun Test.contains(a: Int) : Boolean = true
val test = Test()
test.c<caret>ontains(1)
}
@@ -0,0 +1,6 @@
fun test() {
class Test()
fun Test.contains(a: Int) : Boolean = true
val test = Test()
1 in test
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
test.c<caret>ontains {
true
}
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test();
{
true
} in test
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test();
test.c<caret>ontains {
true
}
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test();
{
true
} in test
}
@@ -0,0 +1,11 @@
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
if (true) {
test.c<caret>ontains {
true
}
}
}
@@ -0,0 +1,11 @@
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
if (true) {
{
true
} in test
}
}
@@ -0,0 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
doSomething(test.c<caret>ontains { true }.toString())
}
@@ -0,0 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
doSomething(({ true } in test).toString())
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
// ERROR: Cannot find a parameter with this name: c
fun test() {
class Test{
fun contains(a: Int=1, b: Int=2): Boolean = true
}
val test = Test()
test.c<caret>ontains(c=3)
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
// ERROR: No value passed for parameter b
fun test() {
class Test{
fun contains(a: Int, b: Int): Boolean = true
}
val test = Test()
test.cont<caret>ains(0)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun contains(a: Int=1, b: Int=2) : Boolean = true
}
val test = Test()
test.contai<caret>ns(b=3)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun contains(a: Int, b: Int) : Boolean = true
}
val test = Test()
test.c<caret>ontains(1, 2)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(a: Int) : Boolean = true
}
val test = Test()
test.c<caret>ontains(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(a: Int) : Boolean = true
}
val test = Test()
1 in test
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains<T>(a: T): Boolean = false
}
val test = Test()
test.contai<caret>ns<Int>(1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains<T>(a: T): Boolean = false
}
val test = Test()
1 in test
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun contains(vararg b: Int, c: Int = 0): Boolean = true
}
val test = Test()
test.contains<caret>(c=5)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun contains(vararg b: Int, c: Int = 0): Boolean = true
}
val test = Test()
test.contains<caret>(0, 1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(a: Int=1, b: Int=2) : Boolean = true
}
val test = Test()
test.c<caret>ontains(a=5)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun contains(a: Int=1, b: Int=2) : Boolean = true
}
val test = Test()
5 in test
}
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceGetIntention
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test.g<caret>et(1, 3, 4, 5)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test[1, 3, 4, 5]
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
}
val test = Test()
test.g<caret>et(1, 2) { i ->
i
}
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun get(a: Int, b: Int, fn: (i: Int) -> Int) : Int = 0
}
val test = Test()
test[1, 2, { i ->
i
}]
}
@@ -0,0 +1,10 @@
// IS_APPLICABLE: false
// ERROR: An argument is already passed for this parameter
// ERROR: No value passed for parameter b
fun test() {
class Test{
fun get(a: Int, b: Int) : Int = 0
}
val test = Test()
test.g<caret>et(a=0, a=1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test()
fun Test.get(i: Int) : Int = 0
val test = Test()
test.g<caret>et(0)
}
@@ -0,0 +1,7 @@
fun test() {
class Test()
fun Test.get(i: Int) : Int = 0
val test = Test()
test[0]
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun get(fn: (i: Int) -> Int) : Int = 0
}
val test = Test()
test.g<caret>et() { i ->
i
}
}
@@ -0,0 +1,9 @@
fun test() {
class Test{
fun get(fn: (i: Int) -> Int) : Int = 0
}
val test = Test()
test[{ i ->
i
}]
}
@@ -0,0 +1,127 @@
<problems>
<problem>
<file>unnamedAndNamed.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/unnamedAndNamed.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>unacceptableVararg.kt</file>
<line>7</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/unacceptableVararg.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>singleNamedArgument.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/singleNamedArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>singleArgument.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/singleArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>namedAndFunction.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/namedAndFunction.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>multiArgument.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/multiArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>missingDefaultArgument.kt</file>
<line>7</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/missingDefaultArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>missingArgument.kt</file>
<line>8</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/missingArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>invalidArgument.kt</file>
<line>8</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/invalidArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>functionalArgument.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/functionalArgument.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>extensionFunction.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/extensionFunction.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>duplicateArguments.kt</file>
<line>9</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/duplicateArguments.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>argumentAndFunction.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/argumentAndFunction.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
<problem>
<file>acceptableVararg.kt</file>
<line>6</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/acceptableVararg.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Explicit 'get'</problem_class>
<description>Replace 'get' call with index operator</description>
</problem>
</problems>
@@ -0,0 +1 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.intentions.ExplicitGetInspection
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
// ERROR: Cannot find a parameter with this name: c
fun test() {
class Test{
fun get(a: Int=1, b: Int=2) : Int = 0
}
val test = Test()
test.g<caret>et(c=3)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun get(a: Int=1, b: Int=2) : Int = 0
}
val test = Test()
test.g<caret>et(b=3)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun get(a: Int, b: Int) : Int = 0
}
val test = Test()
test.g<caret>et(1, 2)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun get(a: Int, b: Int) : Int = 0
}
val test = Test()
test[1, 2]
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun get() : Int = 0
}
val test = Test()
test.g<caret>et()
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
// ERROR: Unresolved reference: got
fun test() {
class Test{
fun get(i: Int) : Int = 0
}
val test = Test()
test.g<caret>ot(0)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun get(i: Int) : Int = 0
}
val test = Test()
test.g<caret>et(0)
}
@@ -0,0 +1,7 @@
fun test() {
class Test{
fun get(i: Int) : Int = 0
}
val test = Test()
test[0]
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun get(a: Int, vararg b: Int, c: Int = 0) : Int = 0
}
val test = Test()
test.g<caret>et(1, 3, 4, c=5)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
fun test() {
class Test{
fun get(a: Int = 0, b: Int = 1, c: Int = 2, d: Int = 3) : Int = 0
}
val test = Test()
test.g<caret>et(1, c=3, b=2)
}
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.conventionNameCalls.ReplaceInvokeIntention
@@ -0,0 +1,7 @@
fun test() {
class Test(val v: Int)
fun Test.invoke(): Unit = Unit
Test(1).i<caret>nvoke()
}
@@ -0,0 +1,7 @@
fun test() {
class Test(val v: Int)
fun Test.invoke(): Unit = Unit
Test(1)<caret>()
}
@@ -0,0 +1,8 @@
fun test() {
class Test()
fun Test.invoke(): Unit = Unit
val test = Test()
test.i<caret>nvoke()
}
@@ -0,0 +1,8 @@
fun test() {
class Test()
fun Test.invoke(): Unit = Unit
val test = Test()
test()
}
@@ -0,0 +1,9 @@
fun test() {
class Test {
fun invoke(fn: () -> Unit) {}
}
val test = Test()
test.i<caret>nvoke {
}
}
@@ -0,0 +1,9 @@
fun test() {
class Test {
fun invoke(fn: () -> Unit) {}
}
val test = Test()
test {
}
}
@@ -0,0 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test {
fun invoke(a: Int, vararg b: String, fn: () -> Unit): String = "test"
}
val test = Test()
doSomething(test.i<caret>nvoke(1, "a", "b") { })
}
@@ -0,0 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test {
fun invoke(a: Int, vararg b: String, fn: () -> Unit): String = "test"
}
val test = Test()
doSomething(test(1, "a", "b") { })
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke(a: Int, b: String) {}
}
val test = Test()
test.i<caret>nvoke(b = "s", a = 1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke(a: Int, b: String) {}
}
val test = Test()
test(b = "s", a = 1)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke() {}
}
val test = Test()
test.i<caret>nvoke()
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke() {}
}
val test = Test()
test()
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke<T>(a: Int) {}
}
val test = Test()
test.i<caret>nvoke<Int>(0)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke<T>(a: Int) {}
}
val test = Test()
test<Int>(0)
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke<T>(fn: () -> T) {}
}
val test = Test()
test.i<caret>nvoke<Int> { 0 }
}
@@ -0,0 +1,7 @@
fun test() {
class Test {
fun invoke<T>(fn: () -> T) {}
}
val test = Test()
test<Int> { 0 }
}

Some files were not shown because too many files have changed in this diff Show More