[Analysis API] introduce KtDestructuringDeclarationSymbol to represent a destructuring declaration
Mainly needed to avoid "Cannot build symbol for KtDestructuringDeclaration" from `KtSymbolProvider.getSymbol` on `KtDestructuringDeclaration`.
This commit is contained in:
committed by
Space Team
parent
1b0034b6e7
commit
8ad5a48b98
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtDestructuringDeclaration
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
|
||||
data class X(val a: Int, val b: Int)
|
||||
|
||||
fun main(x: X) {
|
||||
|
||||
<expr>
|
||||
@AAA("y")
|
||||
val (@BBB("aaa") a, @BBB("bbb") b) = x
|
||||
</expr>
|
||||
}
|
||||
|
||||
annotation class AAA(val value: String)
|
||||
annotation class BBB(val value: String)
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
@AAA(value = "y")
|
||||
(@BBB(value = "aaa") a: kotlin.Int, @BBB(value = "bbb") b: kotlin.Int)
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
KtDestructuringDeclarationSymbol:
|
||||
annotationsList: [
|
||||
AAA(value = "y")
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
entries: [
|
||||
KtLocalVariableSymbol(<local>/a)
|
||||
KtLocalVariableSymbol(<local>/b)
|
||||
]
|
||||
origin: SOURCE
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtDestructuringDeclaration
|
||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
||||
|
||||
data class X(val a: Int, val b: Int)
|
||||
|
||||
fun x(action: (X) -> Unit) {}
|
||||
|
||||
fun main() {
|
||||
x { <expr>(a, b)</expr> ->
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
(a: kotlin.Int, b: kotlin.Int)
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
KtDestructuringDeclarationSymbol:
|
||||
annotationsList: []
|
||||
entries: [
|
||||
KtLocalVariableSymbol(<local>/a)
|
||||
KtLocalVariableSymbol(<local>/b)
|
||||
]
|
||||
origin: SOURCE
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
Reference in New Issue
Block a user