KT-62676 [AA] Introduce ShortenOptions class

This class should contain 'global' settings for reference shortening;
ATM it only contains the `removeThis` flag

In the future this setting might be merged together with
`ShortenStrategy` to be computed on per-element basis
This commit is contained in:
Roman Golyshev
2023-10-26 20:27:12 +02:00
committed by teamcity
parent adf7ee4535
commit 4ca1f9d492
5 changed files with 36 additions and 2 deletions
@@ -10,6 +10,7 @@ import com.intellij.psi.SmartPointerManager
import com.intellij.psi.SmartPsiElementPointer
import org.jetbrains.kotlin.analysis.api.components.KtReferenceShortener
import org.jetbrains.kotlin.analysis.api.components.ShortenCommand
import org.jetbrains.kotlin.analysis.api.components.ShortenOptions
import org.jetbrains.kotlin.analysis.api.components.ShortenStrategy
import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession
import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent
@@ -31,6 +32,7 @@ internal class KtFe10ReferenceShortener(
override fun collectShortenings(
file: KtFile,
selection: TextRange,
shortenOptions: ShortenOptions,
classShortenStrategy: (KtClassLikeSymbol) -> ShortenStrategy,
callableShortenStrategy: (KtCallableSymbol) -> ShortenStrategy,
): ShortenCommand {