FIR IDE: Add IDE tests for sample compiler plugin

This commit is contained in:
Roman Golyshev
2022-02-22 03:00:55 +03:00
parent fed08aaff5
commit 8bcdc70adc
32 changed files with 790 additions and 0 deletions
@@ -0,0 +1,3 @@
KtErrorCallInfo:
candidateCalls = []
diagnostic = ERROR<UNRESOLVED_REFERENCE: Unresolved reference: serializeFirstTarget>
@@ -0,0 +1,15 @@
// WITH_FIR_TEST_COMPILER_PLUGIN
package test
@org.jetbrains.kotlin.fir.plugin.MySerializable
class FirstTarget
@org.jetbrains.kotlin.fir.plugin.MySerializable
class SecondTarget
@org.jetbrains.kotlin.fir.plugin.CoreSerializer
class Serializer
fun test(serializer: Serializer, target: FirstTarget) {
serializer.<expr>serializeFirstTarget</expr>(target)
}
@@ -0,0 +1,26 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = serializer
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = test/Serializer.serializeFirstTarget(<dispatch receiver>: test.Serializer, x: test.FirstTarget): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = test.FirstTarget
symbol = x: test.FirstTarget
]
argumentMapping = {
target -> (KtVariableLikeSignature:
name = x
receiverType = null
returnType = test.FirstTarget
symbol = x: test.FirstTarget)
}
@@ -0,0 +1,3 @@
KtErrorCallInfo:
candidateCalls = []
diagnostic = ERROR<UNRESOLVED_REFERENCE: Unresolved reference: dummyTest>
@@ -0,0 +1,9 @@
// WITH_FIR_TEST_COMPILER_PLUGIN
package test
@org.jetbrains.kotlin.fir.plugin.DummyFunction
class Test
fun test() {
<expr>dummyTest</expr>(Test())
}
@@ -0,0 +1,24 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = test/dummyTest(value: test.Test): kotlin.String
valueParameters = [
KtVariableLikeSignature:
name = value
receiverType = null
returnType = test.Test
symbol = value: test.Test
]
argumentMapping = {
Test() -> (KtVariableLikeSignature:
name = value
receiverType = null
returnType = test.Test
symbol = value: test.Test)
}