Skip to content

Commit

Permalink
feat: init llm inlay manager
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 19, 2023
1 parent 04707c8 commit 5434b42
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/kotlin/cc/unitmesh/devti/editor/LLMInlayManager.kt
@@ -0,0 +1,26 @@
package cc.unitmesh.devti.editor

import com.intellij.openapi.Disposable
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.util.concurrency.annotations.RequiresEdt

interface LLMInlayManager : Disposable {
override fun dispose() {}

@RequiresEdt
fun isAvailable(editor: Editor): Boolean

@RequiresEdt
fun applyCompletion(project: Project, editor: Editor)

@RequiresEdt
fun disposeInlays(editor: Editor)

companion object {
fun getInstance(): LLMInlayManager {
return ApplicationManager.getApplication().getService(LLMInlayManager::class.java)
}
}
}
19 changes: 19 additions & 0 deletions src/main/kotlin/cc/unitmesh/devti/editor/LLMInlayManagerImpl.kt
@@ -0,0 +1,19 @@
package cc.unitmesh.devti.editor

import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project

class LLMInlayManagerImpl : LLMInlayManager {
override fun isAvailable(editor: Editor): Boolean {
return false
}

override fun applyCompletion(project: Project, editor: Editor) {
return
}

override fun disposeInlays(editor: Editor) {
return
}

}
3 changes: 3 additions & 0 deletions src/main/resources/META-INF/autodev-core.xml
Expand Up @@ -9,6 +9,9 @@
id="cc.unitmesh.devti.settings.AutoDevSettingsConfigurable"
displayName="AutoDev"/>

<applicationService
serviceInterface="cc.unitmesh.devti.editor.LLMInlayManager"
serviceImplementation="cc.unitmesh.devti.editor.LLMInlayManagerImpl" />
<applicationService serviceImplementation="cc.unitmesh.devti.settings.AutoDevSettingsState"/>

<runConfigurationProducer
Expand Down

0 comments on commit 5434b42

Please sign in to comment.