[FIR IDE] Add base implementation of find usages of overrides
This commit is contained in:
+3
-1
@@ -41,12 +41,14 @@ abstract class KtAnalysisSession(override val token: ValidityToken) : ValidityTo
|
||||
protected abstract val symbolProvider: KtSymbolProvider
|
||||
protected abstract val callResolver: KtCallResolver
|
||||
protected abstract val completionCandidateChecker: KtCompletionCandidateChecker
|
||||
|
||||
protected abstract val symbolDeclarationOverridesProvider: KtSymbolDeclarationOverridesProvider
|
||||
|
||||
/// TODO: get rid of
|
||||
@Deprecated("Used only in completion now, temporary")
|
||||
abstract fun createContextDependentCopy(): KtAnalysisSession
|
||||
|
||||
fun KtCallableSymbol.getOverriddenSymbols(containingDeclaration: KtClassOrObjectSymbol): List<KtCallableSymbol> =
|
||||
symbolDeclarationOverridesProvider.getOverriddenSymbols(this, containingDeclaration)
|
||||
|
||||
fun KtExpression.getSmartCasts(): Collection<KtType> = smartCastProvider.getSmartCastedToTypes(this)
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2020 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.idea.frontend.api.components
|
||||
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtCallableSymbol
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtClassOrObjectSymbol
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtFunctionSymbol
|
||||
import org.jetbrains.kotlin.idea.frontend.api.symbols.KtSymbol
|
||||
|
||||
abstract class KtSymbolDeclarationOverridesProvider : KtAnalysisSessionComponent() {
|
||||
/**
|
||||
* Returns symbols that overridden by requested
|
||||
*/
|
||||
abstract fun <T : KtSymbol> getOverriddenSymbols(
|
||||
callableSymbol: T,
|
||||
containingDeclaration: KtClassOrObjectSymbol
|
||||
): List<KtCallableSymbol>
|
||||
|
||||
//abstract fun getOverriddenSymbols(callableSymbol: KtCallableSymbol, containingDeclaration: KtClassOrObjectSymbol): List<KtCallableSymbol>
|
||||
}
|
||||
Reference in New Issue
Block a user