mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java, completion] IJPL-207762 RefStartInsertHandler is serializable
GitOrigin-RevId: 105abeb88ad3719cc985a7a2b92d2b94c75acdc1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
30ff1508fd
commit
cc9127c001
@@ -80,6 +80,7 @@
|
||||
description="Format chained calls as in versions prior to 2021.2"/>
|
||||
|
||||
<completion.frontendFriendlyInsertHandler implementationClass="com.intellij.codeInsight.completion.method.DiamondInsertHandler"/>
|
||||
<completion.frontendFriendlyInsertHandler implementationClass="com.intellij.codeInsight.completion.method.RefStartInsertHandler"/>
|
||||
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ object JavaMethodCallInsertHandlerHelper {
|
||||
return element.getUserData(callKey)
|
||||
}
|
||||
|
||||
fun installRefStartKey(context: InsertionContext, item: LookupElement) {
|
||||
internal fun installRefStartKey(context: InsertionContext, item: LookupElement) {
|
||||
val refStart = OffsetKey.create("refStart", true)
|
||||
context.offsetMap.addOffset(refStart, context.startOffset)
|
||||
item.putUserData(refStartKey, refStart)
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInsight.completion.method
|
||||
|
||||
import com.intellij.codeInsight.completion.FrontendFriendlyInsertHandler
|
||||
import com.intellij.codeInsight.completion.InsertHandler
|
||||
import com.intellij.codeInsight.completion.InsertionContext
|
||||
import com.intellij.codeInsight.lookup.LookupElement
|
||||
import kotlinx.serialization.Serializable
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
@ApiStatus.Internal
|
||||
@Serializable
|
||||
class RefStartInsertHandler : InsertHandler<LookupElement>, FrontendFriendlyInsertHandler {
|
||||
override fun handleInsert(context: InsertionContext, item: LookupElement) {
|
||||
JavaMethodCallInsertHandlerHelper.installRefStartKey(context, item)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user