[SLC] drop KtAnalysisSession from SymbolLightFieldForProperty
^KT-54051
This commit is contained in:
committed by
Space Team
parent
3764fa5454
commit
40bd222b78
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user