Provide incremental analysis of a file when it is applicable

#KT32868 Fixed
This commit is contained in:
Vladimir Dolzhenko
2019-07-27 16:18:53 +02:00
parent c7bd6d8ede
commit 4b2834c4a8
68 changed files with 730 additions and 318 deletions
+4
View File
@@ -0,0 +1,4 @@
// OUT_OF_CODE_BLOCK: FALSE
fun some(): Int = run { 12 + <caret> }
// TYPE: 1
+1 -1
View File
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun main() {
fun some = 12<caret>
}
+2 -5
View File
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: FALSE
class A {
init {
@@ -6,7 +6,4 @@ class A {
<caret>
}
}
}
// TODO
// SKIP_ANALYZE_CHECK
}
+1 -1
View File
@@ -1,2 +1,2 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
fun some() = <caret>12
+1 -1
View File
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
fun test() {<caret>
}
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun test() {
class Test {
<caret>
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
// (Investigation starts from parent)
fun test() : Int = <caret>12
@@ -1,3 +1,3 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun test() : Int = 12 + <caret>12
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
val o = object {
fun test() {
<caret>
+1 -1
View File
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
class Some {
fun <caret>
}
@@ -0,0 +1,11 @@
// OUT_OF_CODE_BLOCK: TRUE
class A {
fun foo(): Int = 12
fun bar(): Int = foo() + <caret>
}
// TYPE: 1
// TODO
// SKIP_ANALYZE_CHECK
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
class Test {
val more : Int = 0
val test : Int
@@ -0,0 +1,11 @@
// OUT_OF_CODE_BLOCK: FALSE
class A {
fun foo(): Int = 12
}
fun A.bar(): Int {
return foo() + <caret>
}
// TYPE: 1
@@ -0,0 +1,9 @@
// OUT_OF_CODE_BLOCK: TRUE
class A {
fun foo(): Int = 12
}
fun A.bar() = foo() + <caret>
// TYPE: 1
@@ -0,0 +1,11 @@
// OUT_OF_CODE_BLOCK: TRUE
class A {
fun foo(): Int = 12
}
fun A.bar(): Int = foo() + <caret>
// TYPE: 1
// TODO
// SKIP_ANALYZE_CHECK
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
val a = 1
fun test() = if (a) {
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
data class Test(val a : Int, val b : Int)
+1 -1
View File
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun test() {
val some = if () {
fun other() {
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
interface Some
fun test() {
+1 -1
View File
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
interface Some
fun test() {
@@ -1,2 +0,0 @@
// TRUE
fun more() = { println<caret> }
+1 -1
View File
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun main() {
jq() { pri<caret> }
@@ -1,5 +1,4 @@
// FALSE
// Important for 173 branch! OOCB is TRUE in this test because of IDEA-185462
// OUT_OF_CODE_BLOCK: FALSE
class B(val a: A)
val B.foo: Int
@@ -0,0 +1,9 @@
// OUT_OF_CODE_BLOCK: FALSE
fun twice(s: String): String {
val repeatFun: String.(Int) -> String = { t -> this.repeat(<caret>) }
return repeatFun(s, 2)
}
// TYPE: t
+1 -1
View File
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun test() {
val a = 1<caret>
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
class Test {
class Other {
<caret>
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
class Test {
class Other {
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
class Test {
class Other {
@@ -0,0 +1,7 @@
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: 'Int`
class InPropertyAccessorSpecifyType {
val prop1: Int
get():<caret> = 42
}
@@ -0,0 +1,8 @@
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: '@Throws(Exception::class)`
class InPropertyAccessorWithAnnotation {
val prop1: Int
<caret>
get() = 42
}
@@ -1,6 +1,6 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
val test : Int
get() = <caret>12
// TODO
// SKIP_ANALYZE_CHECK
// TODO: Investigate
// SKIP_ANALYZE_CHECK
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
class A {
fun foo(): Int = 12
@@ -0,0 +1,10 @@
// OUT_OF_CODE_BLOCK: FALSE
class A {
fun foo(): Int = 12
}
class B(val a: A) {
val prop1: Int
get() = a.fo<caret>o()
}
@@ -1,6 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: FALSE
class Test {
val a : () -> Int = { <caret>pri }
}
// SKIP_ANALYZE_CHECK
}
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
class Test {
val a = "aasdf<caret>"
}
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
// Navigation from "class B: A()" should move to valid constructor even after changing type in lambda
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
open class A(a: () -> Unit)
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
open class A(a: () -> Unit) {
constructor(f: (String) -> Unit) : this({ -> f("") })
+2
View File
@@ -0,0 +1,2 @@
// OUT_OF_CODE_BLOCK: FALSE
fun more() { println<caret> }
+2 -5
View File
@@ -1,10 +1,7 @@
// TRUE
// OUT_OF_CODE_BLOCK: FALSE
class A {
init {
ca<caret>ll()
}
}
// TODO:
// SKIP_ANALYZE_CHECK
}
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
fun test() {
fun hello() {
<caret>
@@ -0,0 +1,8 @@
// OUT_OF_CODE_BLOCK: FALSE
class LocalFunWithBodyInClass {
fun test() {
fun hello() {
<caret>
}
}
}
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
object Some {
fun test() {
<caret>
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
object Some {
fun test() {
@@ -1,12 +1,9 @@
// TRUE
// OUT_OF_CODE_BLOCK: FALSE
// Problem with lazy initialization of nullable properties
interface Some
val test: Some = object: Some {
fun test() {
<caret>
}
}
// SKIP_ANALYZE_CHECK
}
@@ -1,6 +1,4 @@
// TRUE
// Problem with lazy initialization of nullable properties
// OUT_OF_CODE_BLOCK: FALSE
val test: Int? = if (true) {
fun test() {
@@ -9,6 +7,4 @@ val test: Int? = if (true) {
}
else {
}
// SKIP_ANALYZE_CHECK
}
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: FALSE
// Problem with lazy initialization of nullable properties
interface Some
@@ -7,6 +7,4 @@ val test: Some? = object: Some {
fun test() {
<caret>
}
}
// SKIP_ANALYZE_CHECK
}
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
// TODO: Investigate
@@ -1,5 +1,3 @@
// TRUE
// OUT_OF_CODE_BLOCK: FALSE
val test: String = "<caret>"
// SKIP_ANALYZE_CHECK
val test: String = "<caret>"
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
abstract class S(val f: () -> Unit)
+1 -1
View File
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
// SKIP_ANALYZE_CHECK
fun test() {<caret>
@@ -1,4 +1,4 @@
// FALSE
// OUT_OF_CODE_BLOCK: FALSE
plugins {
<caret>
}
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
fun foo() = 1
@@ -1,4 +1,4 @@
// TRUE
// OUT_OF_CODE_BLOCK: TRUE
1<caret>
// SKIP_ANALYZE_CHECK