AA: apply java type enhancement to declaredMemberScope.
* added getDeclaredMemberScope to JavaScopeProvider.
This commit is contained in:
committed by
Ilya Kirillov
parent
f620eb920f
commit
7ce2f64c18
+24
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.impl.base.test.cases.scopes
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.SymbolByFqName
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.AbstractSymbolByFqNameTest
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolsData
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithMembers
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
abstract class AbstractDeclaredMemberScopeTest : AbstractSymbolByFqNameTest() {
|
||||
override fun KtAnalysisSession.collectSymbols(ktFile: KtFile, testServices: TestServices): SymbolsData {
|
||||
val symbolData = SymbolByFqName.getSymbolDataFromFile(testDataPath)
|
||||
val symbols = with(symbolData) { toSymbols() }
|
||||
val classSymbol = symbols.singleOrNull() as? KtSymbolWithMembers
|
||||
?: error("Should be a single class symbol, but $symbols found")
|
||||
return SymbolsData(classSymbol.getDeclaredMemberScope().getAllSymbols().toList())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user