Skip to content

collectPossibleReferenceShorteningsInElement

context(session: KaSession)
fun collectPossibleReferenceShorteningsInElement(
    element: KtElement, 
    shortenOptions: ShortenOptions = ShortenOptions.DEFAULT, 
    classShortenStrategy: (KaClassLikeSymbol) -> ShortenStrategy = defaultClassShortenStrategy, 
    callableShortenStrategy: (KaCallableSymbol) -> ShortenStrategy = defaultCallableShortenStrategy
): ShortenCommand

Collects possible references to shorten in elements text range.

See defaultClassShortenStrategy and defaultCallableShortenStrategy for the default shortening logic.

Also see org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferences and functions around it.