Skip to content

collectPossibleReferenceShortenings

context(session: KaSession)
fun collectPossibleReferenceShortenings(
    file: KtFile, 
    selection: TextRange = file.textRange, 
    shortenOptions: ShortenOptions = ShortenOptions.DEFAULT, 
    classShortenStrategy: (KaClassLikeSymbol) -> ShortenStrategy = defaultClassShortenStrategy, 
    callableShortenStrategy: (KaCallableSymbol) -> ShortenStrategy = defaultCallableShortenStrategy
): ShortenCommand

Collects possible references to shorten.

See defaultClassShortenStrategy and defaultCallableShortenStrategy for the default shortening logic.

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