Skip to content

Commit

Permalink
feat(database): init ModularDesignAction and modify VisualSqlAction f…
Browse files Browse the repository at this point in the history
…or 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.
  • Loading branch information
phodal committed Jan 22, 2024
1 parent 4d849e3 commit 2a11e29
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
@@ -0,0 +1,25 @@
package cc.unitmesh.database.actions

import cc.unitmesh.devti.AutoDevBundle
import cc.unitmesh.devti.intentions.action.base.AbstractChatIntention
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile

class ModularDesignAction : AbstractChatIntention() {
override fun priority(): Int = 899

override fun startInWriteAction(): Boolean = false

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

override fun getText(): String = AutoDevBundle.message("migration.database.plsql.modular.design")

override fun isAvailable(project: Project, editor: Editor?, psiFile: PsiFile?): Boolean {
return false
}

override fun invoke(project: Project, editor: Editor?, psiFile: PsiFile?) {
TODO("Not yet implemented")
}
}
@@ -1,25 +1,25 @@
package cc.unitmesh.database.actions

import cc.unitmesh.devti.AutoDevBundle
import com.intellij.codeInsight.intention.IntentionAction
import cc.unitmesh.devti.intentions.action.base.AbstractChatIntention
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile

class VisualSqlAction : IntentionAction {
class VisualSqlAction : AbstractChatIntention() {
override fun priority(): Int = 1001

override fun startInWriteAction(): Boolean = false

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

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

override fun isAvailable(project: Project, p1: Editor?, p2: PsiFile?): Boolean {
override fun isAvailable(project: Project, editor: Editor?, psiFile: PsiFile?): Boolean {
return false
}

override fun invoke(project: Project, p1: Editor?, p2: PsiFile?) {
override fun invoke(project: Project, editor: Editor?, psiFile: PsiFile?) {
TODO("Not yet implemented")
}


}
5 changes: 5 additions & 0 deletions exts/database/src/main/resources/cc.unitmesh.database.xml
Expand Up @@ -25,6 +25,11 @@
<bundleName>messages.AutoDevBundle</bundleName>
<categoryKey>intention.category.llm</categoryKey>
</autoDevIntention>
<autoDevIntention>
<className>cc.unitmesh.database.actions.ModularDesignAction</className>
<bundleName>messages.AutoDevBundle</bundleName>
<categoryKey>intention.category.llm</categoryKey>
</autoDevIntention>

<livingDocumentation
language="SQL"
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages/AutoDevBundle.properties
Expand Up @@ -114,3 +114,4 @@ migration.database.plsql.generate.function=Generate Function
migration.database.plsql.generate.unittest=Generate Unit Test
migration.database.plsql.generate.entity=Generate Entity
migration.database.plsql.visual=Visualize PL/SQL
migration.database.plsql.modular.design=Modular Code

0 comments on commit 2a11e29

Please sign in to comment.