Skip to content

Commit a5d5e4d

Browse files
committed
fix(inlay): update key names and message in LLMInlayManagerImpl.kt
#109
1 parent 9dc36e5 commit a5d5e4d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/main/kotlin/com/intellij/temporary/inlay/codecomplete/LLMInlayManagerImpl.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,17 @@ import com.intellij.util.concurrency.annotations.RequiresEdt
2828
class LLMInlayManagerImpl : LLMInlayManager {
2929
companion object {
3030
private val logger = logger<LLMInlayManagerImpl>()
31-
private val KEY_LAST_REQUEST = Key.create<CodeCompletionRequest>("copilot.editorRequest")
31+
private val KEY_LAST_REQUEST = Key.create<CodeCompletionRequest>("llm.editorRequest")
3232
val KEY_DOCUMENT_SAVE_VETO = Key.create<Boolean>("llm.docSaveVeto")
33-
private val KEY_PROCESSING =
34-
KeyWithDefaultValue.create("llm.processing", java.lang.Boolean.valueOf(false)) as Key<Boolean>
33+
private val KEY_PROCESSING = KeyWithDefaultValue.create("llm.processing", false)
3534
private val KEY_EDITOR_SUPPORTED = Key.create<Boolean>("llm.editorSupported")
3635
}
3736

3837
private var currentCompletion: String = ""
3938

4039
@RequiresEdt
4140
override fun isAvailable(editor: Editor): Boolean {
42-
var isAvailable: Boolean? = KEY_EDITOR_SUPPORTED[editor]
41+
var isAvailable= KEY_EDITOR_SUPPORTED[editor]
4342
if (isAvailable == null) {
4443
isAvailable = editor !is EditorWindow && editor !is ImaginaryEditor && (
4544
editor !is EditorEx || !editor.isEmbeddedIntoDialogWrapper) &&
@@ -62,7 +61,7 @@ class LLMInlayManagerImpl : LLMInlayManager {
6261
return false
6362
}
6463

65-
WriteCommandAction.runWriteCommandAction(project, "Apply Copilot Suggestion", "AutoDev", {
64+
WriteCommandAction.runWriteCommandAction(project, "Apply Code Suggestion", "AutoDev", {
6665
if (project.isDisposed) return@runWriteCommandAction
6766
val document = editor.document
6867
try {
@@ -83,9 +82,9 @@ class LLMInlayManagerImpl : LLMInlayManager {
8382
private fun wrapWithTemporarySaveVetoHandler(runnable: Runnable) {
8483
val disposable = Disposer.newDisposable()
8584
try {
86-
val extensionPoint =
87-
ApplicationManager.getApplication().extensionArea.getExtensionPoint(FileDocumentSynchronizationVetoer.EP_NAME)
88-
extensionPoint.registerExtension(LLMEditorSaveVetoer(), disposable)
85+
val extensionArea = ApplicationManager.getApplication().extensionArea
86+
val ep = extensionArea.getExtensionPoint(FileDocumentSynchronizationVetoer.EP_NAME)
87+
ep.registerExtension(LLMEditorSaveVetoer(), disposable)
8988
runnable.run()
9089
} finally {
9190
Disposer.dispose(disposable)

0 commit comments

Comments
 (0)