Skip to content

Commit 0dd17a9

Browse files
committed
refactor(database): move SQLExecutor to version-specific directories #257
- Deleted old SQLExecutor files and created new ones in version-specific directories (223, 233). - Updated build and release workflows to handle multiple platform versions. - Adjusted related configurations and dependencies to support version-specific implementations
1 parent 2b9edea commit 0dd17a9

File tree

15 files changed

+247
-42
lines changed

15 files changed

+247
-42
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
build:
3131
name: Build
3232
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: true
35+
matrix:
36+
platform-version: [ 223, 233, 241 ]
37+
env:
38+
ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }}
3339
outputs:
3440
version: ${{ steps.properties.outputs.version }}
3541
changelog: ${{ steps.properties.outputs.changelog }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: true
1818
matrix:
19-
platform-version: [223, 233, 241 ]
19+
platform-version: [223, 241]
2020
env:
2121
ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }}
2222

core/src/223/main/kotlin/com/intellij/temporary/gui/block/TextBlockView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
22
package com.intellij.temporary.gui.block
33

4-
import cc.unitmesh.devti.gui.chat.ChatRole
4+
import cc.unitmesh.devti.gui.chat.message.ChatRole
55
import cc.unitmesh.devti.util.parser.convertMarkdownToHtml
66
import com.intellij.ide.BrowserUtil
77
import com.intellij.openapi.util.text.StringUtil

core/src/223/main/resources/META-INF/autodev-core.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
serviceInterface="com.intellij.temporary.inlay.codecomplete.LLMInlayManager"
3838
serviceImplementation="com.intellij.temporary.inlay.codecomplete.LLMInlayManagerImpl"/>
3939

40-
<postStartupActivity implementation="cc.unitmesh.devti.update.AutoDevUpdateStartupActivity"/>
40+
<!-- <postStartupActivity implementation="cc.unitmesh.devti.update.AutoDevUpdateStartupActivity"/>-->
4141

4242
<typedHandler order="first, before completionAutoPopup"
4343
implementation="cc.unitmesh.devti.inlay.TypeOverHandler"/>
@@ -229,7 +229,7 @@
229229
<categoryKey>intention.category.llm</categoryKey>
230230
</autoDevIntention>
231231

232-
<langSketchProvider implementation="cc.unitmesh.devti.sketch.patch.DiffLangSketchProvider"/>
232+
<langSketchProvider implementation="cc.unitmesh.devti.sketch.ui.patch.DiffLangSketchProvider"/>
233233
</extensions>
234234

235235
<actions>
@@ -329,7 +329,7 @@
329329
class="cc.unitmesh.devti.gui.snippet.AutoDevInsertCodeAction"/>
330330
<action id="AutoDev.ToolWindow.Snippet.RunDevIns"
331331
icon="AllIcons.Actions.Execute"
332-
class="cc.unitmesh.devti.gui.snippet.AutoDevRunDevInsAction"/>
332+
class="cc.unitmesh.devti.gui.snippet.AutoDevRunAction"/>
333333
</group>
334334

335335
<group id="AutoDev.ToolWindow.Chat.TitleActions">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ class AutoDevUpdateStartupActivity : ProjectActivity {
1313

1414
AutoDevInlineChatProvider.addListener(project)
1515
}
16-
}
16+
}

core/src/main/kotlin/cc/unitmesh/devti/gui/AutoDevToolWindowFactory.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cc.unitmesh.devti.gui
33
import cc.unitmesh.devti.gui.chat.message.ChatActionType
44
import cc.unitmesh.devti.gui.chat.ChatCodingPanel
55
import cc.unitmesh.devti.gui.chat.ChatCodingService
6+
import cc.unitmesh.devti.inline.AutoDevInlineChatProvider
67
import cc.unitmesh.devti.sketch.SketchToolWindow
78
import cc.unitmesh.devti.settings.LanguageChangedCallback.componentStateChanged
89
import com.intellij.openapi.actionSystem.ex.ActionUtil
@@ -30,6 +31,9 @@ class AutoDevToolWindowFactory : ToolWindowFactory, DumbAware {
3031
setInitialDisplayName(this)
3132
}
3233

34+
// for idea 223
35+
AutoDevInlineChatProvider.addListener(project)
36+
3337
ApplicationManager.getApplication().invokeLater {
3438
val contentManager = toolWindow.contentManager
3539
contentManager.addContent(chatPanel)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ package cc.unitmesh.devti.inline
33
import com.intellij.openapi.project.Project
44

55
object AutoDevInlineChatProvider {
6+
var isAdded = false
7+
68
fun addListener(project: Project) {
9+
if (isAdded) return
710
AutoDevGutterHandler.getInstance(project).listen()
811
}
912

core/src/main/kotlin/cc/unitmesh/devti/runner/RunServiceTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ open class RunServiceTask(
187187

188188
settings.isActivateToolWindowBeforeRun = false
189189
settings.isTemporary = true
190-
settings.isFocusToolWindowBeforeRun = false
190+
// settings.isFocusToolWindowBeforeRun = false
191191

192192
val disposable = Disposer.newDisposable()
193193
val connection = ApplicationManager.getApplication().messageBus.connect(disposable)

core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import com.intellij.psi.PsiManager
1414
import java.text.SimpleDateFormat
1515

1616
data class SketchRunContext(
17-
val currentFile: VirtualFile,
17+
val currentFile: VirtualFile?,
1818
val currentElement: PsiElement? = null,
1919
val selectedFile: List<VirtualFile>,
2020
val relatedFiles: List<VirtualFile>,
@@ -28,13 +28,17 @@ data class SketchRunContext(
2828
companion object {
2929
fun create(project: Project, myEditor: Editor?, input: String): SketchRunContext {
3030
val editor = myEditor ?: FileEditorManager.getInstance(project).selectedTextEditor
31-
val currentFile: VirtualFile = if (editor != null) {
31+
val currentFile: VirtualFile? = if (editor != null) {
3232
FileDocumentManager.getInstance().getFile(editor.document)!!
3333
} else {
34-
FileEditorManager.getInstance(project).selectedFiles.first()
34+
FileEditorManager.getInstance(project).selectedFiles.firstOrNull()
3535
}
3636

37-
val psi = PsiManager.getInstance(project).findFile(currentFile)
37+
val psi = if (currentFile != null) {
38+
PsiManager.getInstance(project).findFile(currentFile)
39+
} else {
40+
null
41+
}
3842

3943
val currentElement = if (editor != null) {
4044
psi?.findElementAt(editor.caretModel.offset)

core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ class CustomProgressBar(private val view: SketchToolWindow) : JPanel(BorderLayou
240240
private val cancelLabel = JBLabel(AllIcons.Actions.CloseHovered)
241241

242242
init {
243-
244243
cancelLabel.setBorder(JBUI.Borders.empty(0, 5))
245244
cancelLabel.addMouseListener(object : MouseAdapter() {
246245
override fun mouseClicked(e: MouseEvent?) {

0 commit comments

Comments
 (0)