Debugger: implement findExpression method correctly to make work Alt+Click in debugger

This commit is contained in:
Natalia Ukhorskaya
2014-04-11 12:42:38 +04:00
parent bd737a32fb
commit 45d78dae5a
28 changed files with 404 additions and 6 deletions
@@ -0,0 +1,5 @@
fun foo() {
1 <caret>+ 1
}
// EXPECTED: 1 + 1
@@ -0,0 +1,7 @@
fun foo() {
<caret>bar()
}
fun bar() = 1
// EXPECTED: bar()
@@ -0,0 +1,4 @@
val a = 1
val b = <caret>a
// EXPECTED: a
@@ -0,0 +1,7 @@
fun foo() {
1.<caret>foo()
}
fun Int.foo() = 1
// EXPECTED: 1.foo()
@@ -0,0 +1,8 @@
fun foo() {
val a = 1
bar(<caret>a)
}
fun bar(i: Int) = 1
// EXPECTED: a
@@ -0,0 +1,7 @@
fun foo() {
<caret>bar { }
}
fun bar(f: () -> Unit) = 1
// EXPECTED: bar { }
@@ -0,0 +1,10 @@
fun foo() {
val klass = MyClass()
klass<caret>[1]
}
class MyClass {
fun get(i: Int): Int = 1
}
// EXPECTED: klass[1]
@@ -0,0 +1,7 @@
fun foo() {
1 <caret>foo 1
}
fun Int.foo(i: Int) = 1
// EXPECTED: 1 foo 1
@@ -0,0 +1,8 @@
fun foo() {
val a = 1
<caret>a foo 1
}
fun Int.foo(i: Int) = 1
// EXPECTED: a
@@ -0,0 +1,5 @@
fun foo() {
1 <caret>is Int
}
// EXPECTED: 1 is Int
@@ -0,0 +1,3 @@
<caret>val a = 1
// EXPECTED: null
@@ -0,0 +1,3 @@
<caret>public fun foo() = 1
// EXPECTED: null
@@ -0,0 +1,5 @@
fun foo(i: Int) {
<caret>i
}
// EXPECTED: i
@@ -0,0 +1,6 @@
val a = 1
fun foo() {
<caret>a
}
// EXPECTED: a
@@ -0,0 +1,3 @@
val <caret>a = 1
// EXPECTED: null
@@ -0,0 +1,10 @@
fun foo() {
val klass = MyClass()
klass.<caret>bar
}
class MyClass {
val bar = 1
}
// EXPECTED: klass.bar
@@ -0,0 +1,10 @@
fun foo() {
val klass = MyClass()
<caret>klass.bar()
}
class MyClass {
fun bar() = 1
}
// EXPECTED: klass
@@ -0,0 +1,10 @@
fun foo() {
val klass = MyClass()
klass.<caret>bar()
}
class MyClass {
fun bar() = 1
}
// EXPECTED: klass.bar()
@@ -0,0 +1,11 @@
class Derived: Base() {
fun test() {
<caret>super.test()
}
}
open class Base {
fun test() {}
}
// EXPECTED: super.test()
@@ -0,0 +1,7 @@
class MyClass {
fun test() {
<caret>this.test()
}
}
// EXPECTED: this.test()
@@ -0,0 +1,7 @@
class MyClass {
fun Int.test() {
<caret>this@MyClass
}
}
// EXPECTED: this@MyClass
@@ -0,0 +1,5 @@
fun foo() {
<caret>+1
}
// EXPECTED: +1