FIR IDE: Use single TextRange as selection instead of two ints
This commit is contained in:
+3
-1
@@ -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)
|
||||
}
|
||||
|
||||
+2
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user