[LL] add tests for FirDeclarationForCompiledElementSearcher

build stub if was not able to load:
expected that in IDE stubs would always be found in the index, for tests -
build from virtual file
This commit is contained in:
Anna Kozlova
2023-06-07 14:56:21 +02:00
committed by teamcity
parent bc306844af
commit 4d97e4c572
39 changed files with 473 additions and 25 deletions
@@ -0,0 +1,4 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtEnumEntry
enum class FooBar {
Baz;
}
@@ -0,0 +1,8 @@
KT element: KtEnumEntry
KT element text:
Baz;
FIR element: FirEnumEntryImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final static [ResolvedTo(BODY_RESOLVE)] enum entry Baz: R|FooBar|
@@ -0,0 +1,4 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtNamedFunction
class FooBar {
fun <T> functionWithTAndAnyValue(otherVal: T & Any) {}
}
@@ -0,0 +1,8 @@
KT element: KtNamedFunction
KT element text:
public final fun <T> functionWithTAndAnyValue(otherVal: T & Any): kotlin.Unit { /* compiled code */ }
FIR element: FirSimpleFunctionImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T> functionWithTAndAnyValue([ResolvedTo(BODY_RESOLVE)] otherVal: R|T & Any|): R|kotlin/Unit|
@@ -0,0 +1,2 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtParameter
fun doSmth(p: String) {}
@@ -0,0 +1,8 @@
KT element: KtParameter
KT element text:
p: kotlin.String
FIR element: FirValueParameterImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
[ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|
@@ -0,0 +1,10 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtConstructor
class FooBar {
val p: String
constructor(p: String) {
this.p = p
}
fun doSmth() {}
}
@@ -0,0 +1,8 @@
KT element: KtSecondaryConstructor
KT element text:
public constructor(p: kotlin.String) { /* compiled code */ }
FIR element: FirConstructorImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|FooBar|
@@ -0,0 +1,4 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtClass
class FooBar {
fun doSmth() {}
}
@@ -0,0 +1,15 @@
KT element: KtClass
KT element text:
public final class FooBar public constructor() {
public final fun doSmth(): kotlin.Unit { /* compiled code */ }
}
FIR element: FirRegularClassImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] class FooBar : R|kotlin/Any| {
public final [ResolvedTo(BODY_RESOLVE)] fun doSmth(): R|kotlin/Unit|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|FooBar|
}
@@ -0,0 +1,4 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtConstructor
class FooBar(val p: String) {
fun doSmth() {}
}
@@ -0,0 +1,8 @@
KT element: KtPrimaryConstructor
KT element text:
public constructor(p: kotlin.String)
FIR element: FirPrimaryConstructor
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|FooBar|
@@ -0,0 +1,4 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtNamedFunction
object FooBar {
fun doSmth() {}
}
@@ -0,0 +1,8 @@
KT element: KtNamedFunction
KT element text:
public final fun doSmth(): kotlin.Unit { /* compiled code */ }
FIR element: FirSimpleFunctionImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] fun doSmth(): R|kotlin/Unit|
@@ -0,0 +1,10 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtProperty
class FooBar {
val p: String
constructor(p: String) {
this.p = p
}
fun doSmth() {}
}
@@ -0,0 +1,8 @@
KT element: KtProperty
KT element text:
public final val p: kotlin.String /* compiled code */
FIR element: FirPropertyImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] val p: R|kotlin/String|
@@ -0,0 +1,2 @@
// DECLARATION_TYPE: org.jetbrains.kotlin.psi.KtNamedFunction
fun doSmth() {}
@@ -0,0 +1,8 @@
KT element: KtNamedFunction
KT element text:
public fun doSmth(): kotlin.Unit { /* compiled code */ }
FIR element: FirSimpleFunctionImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] fun doSmth(): R|kotlin/Unit|