[Analysis API] add API to get KtScope for resolve extensions
^KT-58262
This commit is contained in:
+1
@@ -65,6 +65,7 @@ class KtFe10AnalysisSession(
|
||||
override val scopeSubstitutionImpl: KtScopeSubstitution = KtFe10ScopeSubstitution(this)
|
||||
override val substitutorFactoryImpl: KtSubstitutorFactory = KtFe10SubstitutorFactory(this)
|
||||
override val symbolProviderByJavaPsiImpl: KtSymbolProviderByJavaPsi = KtFe10SymbolProviderByJavaPsi(this)
|
||||
override val resolveExtensionProviderImpl: KtSymbolFromResolveExtensionProvider = KtFe10SymbolFromResolveExtensionProvider(this)
|
||||
|
||||
override fun createContextDependentCopy(originalKtFile: KtFile, elementToReanalyze: KtElement): KtAnalysisSession =
|
||||
withValidityAssertion {
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.descriptors.components
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.components.KtSymbolFromResolveExtensionProvider
|
||||
import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent
|
||||
import org.jetbrains.kotlin.analysis.api.impl.base.scopes.KtEmptyScope
|
||||
import org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeToken
|
||||
import org.jetbrains.kotlin.analysis.api.scopes.KtScope
|
||||
|
||||
internal class KtFe10SymbolFromResolveExtensionProvider(
|
||||
override val analysisSession: KtFe10AnalysisSession,
|
||||
) : KtSymbolFromResolveExtensionProvider(), Fe10KtAnalysisSessionComponent {
|
||||
override val token: KtLifetimeToken
|
||||
get() = analysisSession.token
|
||||
|
||||
override fun getResolveExtensionScopeWithTopLevelDeclarations(): KtScope {
|
||||
// Not supported for FE1.0
|
||||
return KtEmptyScope(token)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user