Skip to content

Commit ddd14d9

Browse files
committed
refactor(chat): rename Shire components to AutoDev #257
- Renamed ShireInlineChatInputPanel to AutoDevInlineChatInput. - Renamed ShireInlineChatProvider to AutoDevInlineChatProvider. - Renamed ShireInputLookupManagerListener to AutoDevInputLookupManagerListener. - Updated references and imports accordingly.
1 parent e9ece8e commit ddd14d9

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ShireInputLookupManagerListener.kt renamed to core/src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevInputLookupManagerListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import com.intellij.openapi.project.Project
1010
import com.intellij.psi.PsiFile
1111
import com.intellij.psi.PsiManager
1212

13-
class ShireInputLookupManagerListener(
13+
class AutoDevInputLookupManagerListener(
1414
private val project: Project,
1515
private val callback: ((PsiFile) -> Unit)? = null,
1616
) : LookupManagerListener {

core/src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevInputSection.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import com.intellij.ui.MutableCollectionComboBoxModel
4343
import com.intellij.ui.SimpleListCellRenderer
4444
import com.intellij.ui.components.JBLabel
4545
import com.intellij.ui.components.JBList
46-
import com.intellij.ui.components.JBScrollPane
4746
import com.intellij.util.EventDispatcher
4847
import com.intellij.util.ui.JBEmptyBorder
4948
import com.intellij.util.ui.JBUI
@@ -212,7 +211,7 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
212211

213212
private fun setupRelatedListener() {
214213
project.messageBus.connect(disposable!!)
215-
.subscribe(LookupManagerListener.TOPIC, ShireInputLookupManagerListener(project) {
214+
.subscribe(LookupManagerListener.TOPIC, AutoDevInputLookupManagerListener(project) {
216215
ApplicationManager.getApplication().invokeLater {
217216
val relatedElements = RelatedClassesProvider.provide(it.language)?.lookup(it)
218217
updateElements(relatedElements)

core/src/main/kotlin/cc/unitmesh/devti/inline/AutoDevInlineChatPanel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import javax.swing.*
3434
class AutoDevInlineChatPanel(val editor: Editor) : JPanel(GridBagLayout()), EditorCustomElementRenderer,
3535
Disposable {
3636
var inlay: Inlay<*>? = null
37-
val inputPanel = ShireInlineChatInputPanel(this, onSubmit = { input ->
37+
val inputPanel = AutoDevInlineChatInput(this, onSubmit = { input ->
3838
this.centerPanel.isVisible = true
3939
val project = editor.project!!
4040

@@ -169,7 +169,7 @@ class AutoDevInlineChatPanel(val editor: Editor) : JPanel(GridBagLayout()), Edit
169169
}
170170
}
171171

172-
class ShireInlineChatInputPanel(
172+
class AutoDevInlineChatInput(
173173
val autoDevInlineChatPanel: AutoDevInlineChatPanel,
174174
val onSubmit: (String) -> Unit,
175175
) : JPanel(GridBagLayout()), Disposable {

core/src/main/kotlin/cc/unitmesh/devti/inline/ShireInlineChatProvider.kt renamed to core/src/main/kotlin/cc/unitmesh/devti/inline/AutoDevInlineChatProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cc.unitmesh.devti.inline
22

33
import com.intellij.openapi.project.Project
44

5-
object ShireInlineChatProvider {
5+
object AutoDevInlineChatProvider {
66
fun addListener(project: Project) {
77
AutoDevGutterHandler.getInstance(project).listen()
88
}

core/src/main/kotlin/cc/unitmesh/devti/provider/RunService.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import java.util.concurrent.CompletableFuture
2323

2424
interface RunService {
2525
private val logger: Logger get() = logger<RunService>()
26-
26+
2727
fun isApplicable(project: Project, file: VirtualFile): Boolean
2828

2929
/**
@@ -176,8 +176,7 @@ interface RunService {
176176
val EP_NAME: ExtensionPointName<RunService> = ExtensionPointName("cc.unitmesh.runService")
177177

178178
fun provider(project: Project, file: VirtualFile): RunService? {
179-
val fileRunServices = EP_NAME.extensionList
180-
return fileRunServices.firstOrNull {
179+
return EP_NAME.extensionList.firstOrNull {
181180
runReadAction { it.isApplicable(project, file) }
182181
}
183182
}

core/src/main/kotlin/cc/unitmesh/devti/update/AutoDevUpdateStartupActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cc.unitmesh.devti.update
22

3-
import cc.unitmesh.devti.inline.ShireInlineChatProvider
3+
import cc.unitmesh.devti.inline.AutoDevInlineChatProvider
44
import com.intellij.openapi.application.ApplicationManager
55
import com.intellij.openapi.project.Project
66
import com.intellij.openapi.startup.ProjectActivity
@@ -11,6 +11,6 @@ class AutoDevUpdateStartupActivity : ProjectActivity {
1111
override suspend fun execute(project: Project) {
1212
if (ApplicationManager.getApplication().isUnitTestMode) return
1313

14-
ShireInlineChatProvider.addListener(project)
14+
AutoDevInlineChatProvider.addListener(project)
1515
}
1616
}

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/service/ShellRunService.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ class ShellRunService : RunService {
2525
val shRunner = ApplicationManager.getApplication().getService(ShRunner::class.java)
2626
?: return "Shell runner not found"
2727

28-
2928
/// lookup virtual file if not exist use scratch file
3029

31-
3230
if (shRunner.isAvailable(project)) {
33-
shRunner.run(project, virtualFile.path, workingDirectory, "RunShireShell", true)
31+
shRunner.run(project, virtualFile.path, workingDirectory, "Shell Run Service", true)
3432
}
3533

3634
return "Running shell command: ${virtualFile.path}"

0 commit comments

Comments
 (0)