Optimization to reuse BindingContext in completion
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
fun foo(p1: Int, p2: String): Int {
|
||||
val v1 = p2<change>
|
||||
val v2 = 123
|
||||
return <before><caret>
|
||||
}
|
||||
|
||||
// TYPE: ".hashCode()"
|
||||
// COMPLETION_TYPE: SMART
|
||||
// EXIST: v1
|
||||
// EXIST: v2
|
||||
// EXIST: p1
|
||||
// ABSENT: p2
|
||||
@@ -0,0 +1,2 @@
|
||||
No up-to-date data from previous completion
|
||||
PSI-tree has changed inside current scope
|
||||
@@ -0,0 +1,12 @@
|
||||
fun foo(p: Int, p1: String): Int {
|
||||
val v1 = p<change>
|
||||
val v2 = 123
|
||||
return <before><caret>
|
||||
}
|
||||
|
||||
// TYPE: "1"
|
||||
// COMPLETION_TYPE: SMART
|
||||
// ABSENT: v1
|
||||
// EXIST: v2
|
||||
// EXIST: p
|
||||
// ABSENT: p1
|
||||
@@ -0,0 +1,2 @@
|
||||
No up-to-date data from previous completion
|
||||
PSI-tree has changed inside current scope
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun foo(p: Any): String {
|
||||
if (p !is String) return ""
|
||||
r<before><change>
|
||||
}
|
||||
|
||||
// TYPE: "eturn "
|
||||
// COMPLETION_TYPE: SMART
|
||||
// EXIST: p
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
No up-to-date data from previous completion
|
||||
Statement position is the same - analyzing only one statement:
|
||||
return IntellijIdeaRulezzz
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun foo(p: Any): String {
|
||||
println(1)
|
||||
if (<before><change>
|
||||
}
|
||||
|
||||
fun bar(s: String): Boolean = true
|
||||
|
||||
// TYPE: "p is String && bar("
|
||||
// COMPLETION_TYPE: SMART
|
||||
// EXIST: p
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
No up-to-date data from previous completion
|
||||
Statement position is the same - analyzing only one statement:
|
||||
if (p is String && bar(IntellijIdeaRulezzz$
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fun foo(p1: Int, p2: String): String {
|
||||
val v1 = p1.toString()
|
||||
val v2 = 123
|
||||
if (p1 > 0) {
|
||||
print(1)
|
||||
print(2)
|
||||
}
|
||||
else
|
||||
r<before><change>
|
||||
}
|
||||
|
||||
// TYPE: "eturn "
|
||||
// COMPLETION_TYPE: SMART
|
||||
// ABSENT: p1
|
||||
// EXIST: p2
|
||||
// EXIST: v1
|
||||
// ABSENT: v2
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
No up-to-date data from previous completion
|
||||
Current statement is too complex to use optimization
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun foo(p: String?): String {
|
||||
println()
|
||||
bar(p!!, <before><change>)
|
||||
}
|
||||
|
||||
fun bar(s: String, p: Int) { }
|
||||
|
||||
// BACKSPACES: 4
|
||||
// TYPE: "."
|
||||
// EXIST: { itemText: "substring", attributes: "grayed" }
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
No up-to-date data from previous completion
|
||||
Statement position is the same - analyzing only one statement:
|
||||
bar(p.IntellijIdeaRulezzz$
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo(p1: Int, p2: String): String {
|
||||
r<before><change>
|
||||
}
|
||||
|
||||
// TYPE: "eturn "
|
||||
// COMPLETION_TYPE: SMART
|
||||
// ABSENT: p1
|
||||
// EXIST: p2
|
||||
@@ -0,0 +1,3 @@
|
||||
No up-to-date data from previous completion
|
||||
Statement position is the same - analyzing only one statement:
|
||||
return IntellijIdeaRulezzz
|
||||
@@ -0,0 +1,10 @@
|
||||
fun foo(): Int {
|
||||
println()
|
||||
return <before><caret>
|
||||
}
|
||||
|
||||
val xxx<change>
|
||||
|
||||
// TYPE: " = 1"
|
||||
// COMPLETION_TYPE: SMART
|
||||
// EXIST: xxx
|
||||
@@ -0,0 +1,2 @@
|
||||
No up-to-date data from previous completion
|
||||
No up-to-date data from previous completion
|
||||
@@ -0,0 +1,17 @@
|
||||
fun foo(p1: Any, p2: Any) {
|
||||
if (p1 !is String) return
|
||||
val v1 = "a"
|
||||
val v2 = 123
|
||||
println("a")
|
||||
bar(x<before><change>)
|
||||
if (p2 !is String) return
|
||||
}
|
||||
|
||||
fun bar(s: String){}
|
||||
|
||||
// BACKSPACES: 1
|
||||
// COMPLETION_TYPE: SMART
|
||||
// EXIST: v1
|
||||
// ABSENT: v2
|
||||
// EXIST: p1
|
||||
// ABSENT: p2
|
||||
@@ -0,0 +1,3 @@
|
||||
No up-to-date data from previous completion
|
||||
Statement position is the same - analyzing only one statement:
|
||||
bar(IntellijIdeaRulezzz$
|
||||
@@ -0,0 +1,12 @@
|
||||
fun foo(p1: Int, p2: String): String {
|
||||
val v1 = p1.toString()
|
||||
val v2 = 123
|
||||
r<before><change>
|
||||
}
|
||||
|
||||
// TYPE: "eturn "
|
||||
// COMPLETION_TYPE: SMART
|
||||
// ABSENT: p1
|
||||
// EXIST: p2
|
||||
// EXIST: v1
|
||||
// ABSENT: v2
|
||||
@@ -0,0 +1,3 @@
|
||||
No up-to-date data from previous completion
|
||||
Statement position is the same - analyzing only one statement:
|
||||
return IntellijIdeaRulezzz
|
||||
Reference in New Issue
Block a user