FIR IDE: Add Add Import quickfix

This quickfix can import unresolved types and callables

It currently does not support Java types and is not as advanced as in
the old plugin

Also, enable tests that now pass
This commit is contained in:
Roman Golyshev
2021-04-16 13:26:52 +05:00
committed by Space
parent 3ad9e4cb5c
commit 22db894076
13 changed files with 293 additions and 2 deletions
@@ -0,0 +1,9 @@
import importTrait.data.TestTrait
// "Import" "true"
// FIR_IGNORE
// ERROR: Unresolved reference: TestTrait
fun test() {
val a: TestTrait<String, Int>? = null
}
@@ -0,0 +1,3 @@
package importTrait.data
interface TestTrait<A, B>
@@ -0,0 +1,7 @@
// "Import" "true"
// FIR_IGNORE
// ERROR: Unresolved reference: TestTrait
fun test() {
val a: <caret>TestTrait<String, Int>? = null
}
@@ -1,6 +1,7 @@
import importTrait.data.TestTrait
// "Import" "true"
// IGNORE_FIR
// ERROR: Unresolved reference: TestTrait
fun test() {
@@ -1,4 +1,5 @@
// "Import" "true"
// IGNORE_FIR
// ERROR: Unresolved reference: TestTrait
fun test() {
@@ -0,0 +1,3 @@
package sometest
private fun privateFun() {}
@@ -0,0 +1,8 @@
// "Import" "false"
// ACTION: Create function 'privateFun'
// ACTION: Rename reference
// ERROR: Unresolved reference: privateFun
fun test() {
<caret>privateFun()
}