KT-5874 Support code completion of label names after "continue@" and "break@"

#KT-5874 Fixed
This commit is contained in:
Valentin Kipyatkov
2014-12-26 20:25:00 +03:00
parent 4800a02e69
commit 51678d0a45
18 changed files with 178 additions and 24 deletions
@@ -1,3 +1,5 @@
fun t() {
brea<caret>
while (true) {
brea<caret>
}
}
@@ -1,3 +1,5 @@
fun t() {
break<caret>
while (true) {
break<caret>
}
}
@@ -0,0 +1,21 @@
fun foo() {
@myFor
for (i in 1..10) {
@myWhile
while (x()) {
@myDo
do {
<caret>
} while (y())
}
}
}
// EXIST: { lookupString: "break", itemText: "break", tailText: null, attributes: "bold" }
// EXIST: { lookupString: "continue", itemText: "continue", tailText: null, attributes: "bold" }
// EXIST: { lookupString: "break@myDo", itemText: "break", tailText: "@myDo", attributes: "bold" }
// EXIST: { lookupString: "continue@myDo", itemText: "continue", tailText: "@myDo", attributes: "bold" }
// EXIST: { lookupString: "break@myWhile", itemText: "break", tailText: "@myWhile", attributes: "bold" }
// EXIST: { lookupString: "continue@myWhile", itemText: "continue", tailText: "@myWhile", attributes: "bold" }
// EXIST: { lookupString: "break@myFor", itemText: "break", tailText: "@myFor", attributes: "bold" }
// EXIST: { lookupString: "continue@myFor", itemText: "continue", tailText: "@myFor", attributes: "bold" }
@@ -0,0 +1,17 @@
fun foo() {
@myFor
for (i in 1..10) {
@myWhile
while (x()) {
@myDo
do {
break@<caret>
} while (y())
}
}
}
// EXIST: { lookupString: "break@myDo", itemText: "break", tailText: "@myDo", attributes: "bold" }
// EXIST: { lookupString: "break@myWhile", itemText: "break", tailText: "@myWhile", attributes: "bold" }
// EXIST: { lookupString: "break@myFor", itemText: "break", tailText: "@myFor", attributes: "bold" }
// NUMBER: 3
@@ -0,0 +1,17 @@
fun foo() {
@myFor
for (i in 1..10) {
@myWhile
while (x()) {
@myDo
do {
continue@<caret>
} while (y())
}
}
}
// EXIST: { lookupString: "continue@myDo", itemText: "continue", tailText: "@myDo", attributes: "bold" }
// EXIST: { lookupString: "continue@myWhile", itemText: "continue", tailText: "@myWhile", attributes: "bold" }
// EXIST: { lookupString: "continue@myFor", itemText: "continue", tailText: "@myFor", attributes: "bold" }
// NUMBER: 3
@@ -5,8 +5,6 @@ fun foo(p: Int) {
z()
}
// EXIST: break
// EXIST: continue
// EXIST: do
// EXIST: false
// EXIST: for
@@ -21,4 +19,4 @@ fun foo(p: Int) {
// EXIST: try
// EXIST: when
// EXIST: while
// NUMBER: 16
// NUMBER: 14
@@ -2,9 +2,7 @@ fun foo() {
<caret>
}
// EXIST: break
// EXIST: class
// EXIST: continue
// EXIST: do
// EXIST: false
// EXIST: for
@@ -23,4 +21,4 @@ fun foo() {
// EXIST: var
// EXIST: when
// EXIST: while
// NUMBER: 21
// NUMBER: 19
@@ -1,7 +1,5 @@
fun foo() = <caret>
// EXIST: break
// EXIST: continue
// EXIST: do
// EXIST: false
// EXIST: for
@@ -15,4 +13,4 @@ fun foo() = <caret>
// EXIST: try
// EXIST: when
// EXIST: while
// NUMBER: 15
// NUMBER: 13
@@ -1,8 +1,6 @@
val prop: Int
get() = <caret>
// EXIST: break
// EXIST: continue
// EXIST: do
// EXIST: false
// EXIST: for
@@ -16,4 +14,4 @@ val prop: Int
// EXIST: try
// EXIST: when
// EXIST: while
// NUMBER: 15
// NUMBER: 13
@@ -1,7 +1,5 @@
fun foo(p: Int = <caret>)
// EXIST: break
// EXIST: continue
// EXIST: do
// EXIST: false
// EXIST: for
@@ -16,4 +14,4 @@ fun foo(p: Int = <caret>)
// EXIST: try
// EXIST: when
// EXIST: while
// NUMBER: 16
// NUMBER: 14
@@ -1,7 +1,5 @@
var a : Int = <caret>
// EXIST: break
// EXIST: continue
// EXIST: do
// EXIST: false
// EXIST: for
@@ -15,4 +13,4 @@ var a : Int = <caret>
// EXIST: try
// EXIST: when
// EXIST: while
// NUMBER: 15
// NUMBER: 13
@@ -0,0 +1,14 @@
fun foo() {
@myFor
for (i in 1..10) {
while (x()) {
fun localFun(a: Int) {
if (a > 0) {
br<caret>
}
}
}
}
}
// NUMBER: 0
@@ -0,0 +1,12 @@
fun foo() {
@myFor
for (i in 1..10) {
while (x()) {
"abc".filter {
br<caret>
}
}
}
}
// NUMBER: 0
@@ -0,0 +1,14 @@
fun foo() {
@myFor
for (i in 1..10) {
while (x()) {
fun localFun(a: Int) {
if (a > 0) {
con<caret>
}
}
}
}
}
// NUMBER: 0
@@ -8,8 +8,10 @@ class Test(val br2 = 12) {
fun brf() = 112
fun test(br4: Int) {
val br5 = 14
br<caret>
while (true) {
val br5 = 14
br<caret>
}
}
}