[SLC] drop KtAnalysisSession from SymbolLightFieldForProperty

^KT-54051
This commit is contained in:
Dmitrii Gridin
2022-11-15 17:33:01 +01:00
committed by Space Team
parent 3764fa5454
commit 40bd222b78
4 changed files with 128 additions and 70 deletions
@@ -40,6 +40,30 @@ public inline fun <reified PSI : PsiElement> KtSymbol.psi(): PSI =
public inline fun <reified PSI : PsiElement> KtSymbol.psiSafe(): PSI? =
psi as? PSI
/**
* Get symbol [PsiElement]. **null** if its [KtSymbol.origin] !is [KtSymbolOrigin.SOURCE]. throws **ClassCastException** if its type !is [PSI]
*
* @see KtSymbol.psi
*/
public inline fun <reified PSI : PsiElement> KtSymbol.sourcePsi(): PSI? {
// TODO: support Java sources after KT-53669
if (origin != KtSymbolOrigin.SOURCE) return null
return psi as PSI
}
/**
* Get symbol [PsiElement] if its type is [PSI] and [KtSymbol.origin] is [KtSymbolOrigin.SOURCE], otherwise null
*
* @see KtSymbol.psiSafe
*/
public inline fun <reified PSI : PsiElement> KtSymbol.sourcePsiSafe(): PSI? {
// TODO: support Java sources after KT-53669
if (origin != KtSymbolOrigin.SOURCE) return null
return psi as? PSI
}
/**
* A place where [KtSymbol] came from
*/