FIR IDE: Search for the first non-local declaration in EnclosingDeclarationContext::detect

Local declarations do not have a stable `ClassId`, which is used in
`declarationUtils.collectDesignation`. Local classes will always have
`outerClassId.isLocal = true`, even when it is not true (see
`org.jetbrains.kotlin.fir.builder.Context.currentClassId` for why this
happens)
This commit is contained in:
Roman Golyshev
2021-03-26 18:51:25 +03:00
committed by Space
parent 0d2158325a
commit 28d8d2d903
7 changed files with 79 additions and 2 deletions
@@ -0,0 +1,20 @@
package test
class T
fun topLevelFun(param: T) {
val firstVariable = T()
class LocalClass(constructorParam: T) {
val localClassField = constructorParam
init {
<caret>
}
}
val secondVariable = T()
}
// EXIST: firstVariable, param, constructorParam, localClassField
// ABSENT: secondVariable