Shorten Reference: Disable ${...} shortening inside completion insert handler

This commit is contained in:
Alexey Sedunov
2018-03-01 17:32:05 +03:00
parent 68757fff2e
commit 30314d43d9
2 changed files with 16 additions and 11 deletions
@@ -31,6 +31,10 @@ import org.jetbrains.kotlin.renderer.render
import org.jetbrains.kotlin.resolve.DescriptorUtils
abstract class KotlinCallableInsertHandler(val callType: CallType<*>) : BaseDeclarationInsertHandler() {
companion object {
private val shortenReferences = ShortenReferences({ ShortenReferences.Options.DEFAULT.copy(dropBracesInStringTemplates = false)})
}
override fun handleInsert(context: InsertionContext, item: LookupElement) {
super.handleInsert(context, item)
@@ -57,7 +61,7 @@ abstract class KotlinCallableInsertHandler(val callType: CallType<*>) : BaseDecl
psiDocumentManager.commitAllDocuments()
ShortenReferences.DEFAULT.process(file, context.startOffset, context.tailOffset - 1)
shortenReferences.process(file, context.startOffset, context.tailOffset - 1)
psiDocumentManager.doPostponedOperationsAndUnblockDocument(context.document)