[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|
@@ -0,0 +1,8 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// WITH_STDLIB
val d = empty<caret>Array<String>()
@@ -0,0 +1,6 @@
KT element: KtNamedFunction
FIR element: FirSimpleFunctionImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final inline [ResolvedTo(BODY_RESOLVE)] fun <@R|kotlin/internal/PureReifiable|() reified [ResolvedTo(BODY_RESOLVE)] T> emptyArray(): R|kotlin/Array<T>|
@@ -0,0 +1,8 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// WITH_STDLIB
val d = arrayOf(arrayOf("1", "2")).fla<caret>tten()
@@ -0,0 +1,6 @@
KT element: KtNamedFunction
FIR element: FirSimpleFunctionImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T> R|kotlin/Array<out kotlin/Array<out T>>|.flatten(): R|kotlin/collections/List<T>|
@@ -0,0 +1,8 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// WITH_STDLIB
val d = Double.from<caret>Bits(0x400921fb54442d18L)
@@ -0,0 +1,6 @@
KT element: KtNamedFunction
FIR element: FirSimpleFunctionImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
@R|kotlin/SinceKotlin|(version = String(1.2)) @R|kotlin/internal/InlineOnly|() public final inline [ResolvedTo(BODY_RESOLVE)] fun @RECEIVER:R|kotlin/SinceKotlin|(version = String(1.2)) @RECEIVER:R|kotlin/internal/InlineOnly|() R|kotlin/Double.Companion|.fromBits([ResolvedTo(BODY_RESOLVE)] bits: R|kotlin/Long|): R|kotlin/Double|