Skip to content

Commit 2a11e29

Browse files
committed
feat(database): init ModularDesignAction and modify VisualSqlAction for design #80
Add a new file `ModularDesignAction.kt` in the `cc.unitmesh.database.actions` package. This class extends `AbstractChatIntention` and provides implementation for various methods. It is not yet implemented. Modify the `cc.unitmesh.database.xml` file to include the `ModularDesignAction` class in the `autoDevIntention` section. Modify the `AutoDevBundle.properties` file to include a new message key `migration.database.plsql.modular.design` with the value "Modular Code". Modify the `VisualSqlAction.kt` file to extend `AbstractChatIntention` instead of `IntentionAction`. The `priority` method is overridden to return 1001. The `isAvailable` and `invoke` methods are not yet implemented.
1 parent 4d849e3 commit 2a11e29

File tree

4 files changed

+37
-6
lines changed

4 files changed

+37
-6
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cc.unitmesh.database.actions
2+
3+
import cc.unitmesh.devti.AutoDevBundle
4+
import cc.unitmesh.devti.intentions.action.base.AbstractChatIntention
5+
import com.intellij.openapi.editor.Editor
6+
import com.intellij.openapi.project.Project
7+
import com.intellij.psi.PsiFile
8+
9+
class ModularDesignAction : AbstractChatIntention() {
10+
override fun priority(): Int = 899
11+
12+
override fun startInWriteAction(): Boolean = false
13+
14+
override fun getFamilyName(): String = AutoDevBundle.message("migration.database.plsql")
15+
16+
override fun getText(): String = AutoDevBundle.message("migration.database.plsql.modular.design")
17+
18+
override fun isAvailable(project: Project, editor: Editor?, psiFile: PsiFile?): Boolean {
19+
return false
20+
}
21+
22+
override fun invoke(project: Project, editor: Editor?, psiFile: PsiFile?) {
23+
TODO("Not yet implemented")
24+
}
25+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
package cc.unitmesh.database.actions
22

33
import cc.unitmesh.devti.AutoDevBundle
4-
import com.intellij.codeInsight.intention.IntentionAction
4+
import cc.unitmesh.devti.intentions.action.base.AbstractChatIntention
55
import com.intellij.openapi.editor.Editor
66
import com.intellij.openapi.project.Project
77
import com.intellij.psi.PsiFile
88

9-
class VisualSqlAction : IntentionAction {
9+
class VisualSqlAction : AbstractChatIntention() {
10+
override fun priority(): Int = 1001
11+
1012
override fun startInWriteAction(): Boolean = false
1113

1214
override fun getFamilyName(): String = AutoDevBundle.message("migration.database.plsql")
1315

1416
override fun getText(): String = AutoDevBundle.message("migration.database.plsql.visual")
1517

16-
override fun isAvailable(project: Project, p1: Editor?, p2: PsiFile?): Boolean {
18+
override fun isAvailable(project: Project, editor: Editor?, psiFile: PsiFile?): Boolean {
1719
return false
1820
}
1921

20-
override fun invoke(project: Project, p1: Editor?, p2: PsiFile?) {
22+
override fun invoke(project: Project, editor: Editor?, psiFile: PsiFile?) {
2123
TODO("Not yet implemented")
2224
}
23-
24-
2525
}

exts/database/src/main/resources/cc.unitmesh.database.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
<bundleName>messages.AutoDevBundle</bundleName>
2626
<categoryKey>intention.category.llm</categoryKey>
2727
</autoDevIntention>
28+
<autoDevIntention>
29+
<className>cc.unitmesh.database.actions.ModularDesignAction</className>
30+
<bundleName>messages.AutoDevBundle</bundleName>
31+
<categoryKey>intention.category.llm</categoryKey>
32+
</autoDevIntention>
2833

2934
<livingDocumentation
3035
language="SQL"

src/main/resources/messages/AutoDevBundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,4 @@ migration.database.plsql.generate.function=Generate Function
114114
migration.database.plsql.generate.unittest=Generate Unit Test
115115
migration.database.plsql.generate.entity=Generate Entity
116116
migration.database.plsql.visual=Visualize PL/SQL
117+
migration.database.plsql.modular.design=Modular Code

0 commit comments

Comments
 (0)