Introduce FIR resolution API with lazy resolve to use in IDE

Now lazy resolve atomic element is a file (declaration-level resolve)
or a callable declaration (expression-level resolve)

#KT-24351 In Progress
This commit is contained in:
Mikhail Glukhikh
2019-07-26 21:25:57 +03:00
parent 1cd559a626
commit 760fb668bb
29 changed files with 683 additions and 35 deletions
+5
View File
@@ -0,0 +1,5 @@
fun callMe() = 42
fun other() {
val x = 1
}
+7
View File
@@ -0,0 +1,7 @@
FILE: callMe.kt
public final fun callMe(): R|kotlin/Int| {
^callMe Int(42)
}
public final fun other(): R|kotlin/Unit| {
lval x: <implicit> = Int(1)
}
+11
View File
@@ -0,0 +1,11 @@
fun main() {
<caret>callMe()
foo()
bar(1, 2)
}
fun foo() {
val y = 2.0
}
fun bar(x: Int, y: Int) = x + y
+12
View File
@@ -0,0 +1,12 @@
FILE: main.kt
public final fun main(): R|kotlin/Unit| {
R|/callMe|()
R|/foo|()
R|/bar|(Int(1), Int(2))
}
public final fun foo(): R|kotlin/Unit| {
lval y: <implicit> = Double(2.0)
}
public final fun bar(x: R|kotlin/Int|, y: R|kotlin/Int|): R|kotlin/Int| {
^bar R|<local>/x|.R|kotlin/Int.plus|(R|<local>/y|)
}
+1
View File
@@ -0,0 +1 @@
R|/callMe|()
+3
View File
@@ -0,0 +1,3 @@
{
"mainFile": "main.kt"
}
+3
View File
@@ -0,0 +1,3 @@
package root
fun foo() = <caret>myProperty
+4
View File
@@ -0,0 +1,4 @@
FILE: main.kt
public final fun foo(): R|kotlin/Int| {
^foo R|root/myProperty|
}
@@ -0,0 +1,3 @@
package root
val myProperty get() = 42
@@ -0,0 +1,5 @@
FILE: myProperty.kt
public final val myProperty: R|kotlin/Int|
public get(): R|kotlin/Int| {
^ Int(42)
}
@@ -0,0 +1 @@
R|root/myProperty|
@@ -0,0 +1,3 @@
{
"mainFile": "main.kt"
}