FIR IDE: Use single TextRange as selection instead of two ints

This commit is contained in:
Roman Golyshev
2021-02-05 15:27:43 +03:00
committed by Space
parent 798c4d2485
commit 7478b8d189
4 changed files with 10 additions and 5 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.idea.frontend.api
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.idea.frontend.api.calls.KtCall
import org.jetbrains.kotlin.idea.frontend.api.components.*
@@ -179,5 +180,6 @@ abstract class KtAnalysisSession(final override val token: ValidityToken) : Vali
fun KtReturnExpression.getReturnTargetSymbol(): KtCallableSymbol? =
expressionHandlingComponent.getReturnExpressionTargetSymbol(this)
fun collectPossibleReferenceShortenings(file: KtFile, from: Int, to: Int) = referenceShortener.collectShortenings(file, from, to)
fun collectPossibleReferenceShortenings(file: KtFile, selection: TextRange): ShortenCommand =
referenceShortener.collectShortenings(file, selection)
}
@@ -5,10 +5,11 @@
package org.jetbrains.kotlin.idea.frontend.api.components
import com.intellij.openapi.util.TextRange
import org.jetbrains.kotlin.psi.KtFile
abstract class KtReferenceShortener : KtAnalysisSessionComponent() {
abstract fun collectShortenings(file: KtFile, from: Int, to: Int): ShortenCommand
abstract fun collectShortenings(file: KtFile, selection: TextRange): ShortenCommand
}
interface ShortenCommand {