@@ -28,18 +28,17 @@ import com.intellij.util.concurrency.annotations.RequiresEdt
28
28
class LLMInlayManagerImpl : LLMInlayManager {
29
29
companion object {
30
30
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" )
32
32
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 )
35
34
private val KEY_EDITOR_SUPPORTED = Key .create<Boolean >(" llm.editorSupported" )
36
35
}
37
36
38
37
private var currentCompletion: String = " "
39
38
40
39
@RequiresEdt
41
40
override fun isAvailable (editor : Editor ): Boolean {
42
- var isAvailable: Boolean? = KEY_EDITOR_SUPPORTED [editor]
41
+ var isAvailable= KEY_EDITOR_SUPPORTED [editor]
43
42
if (isAvailable == null ) {
44
43
isAvailable = editor !is EditorWindow && editor !is ImaginaryEditor && (
45
44
editor !is EditorEx || ! editor.isEmbeddedIntoDialogWrapper) &&
@@ -62,7 +61,7 @@ class LLMInlayManagerImpl : LLMInlayManager {
62
61
return false
63
62
}
64
63
65
- WriteCommandAction .runWriteCommandAction(project, " Apply Copilot Suggestion" , " AutoDev" , {
64
+ WriteCommandAction .runWriteCommandAction(project, " Apply Code Suggestion" , " AutoDev" , {
66
65
if (project.isDisposed) return @runWriteCommandAction
67
66
val document = editor.document
68
67
try {
@@ -83,9 +82,9 @@ class LLMInlayManagerImpl : LLMInlayManager {
83
82
private fun wrapWithTemporarySaveVetoHandler (runnable : Runnable ) {
84
83
val disposable = Disposer .newDisposable()
85
84
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)
89
88
runnable.run ()
90
89
} finally {
91
90
Disposer .dispose(disposable)
0 commit comments