Skip to content

Commit

Permalink
fix: fix ddl drop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 1, 2023
1 parent d9da034 commit 37809f3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -4,7 +4,7 @@ pluginGroup = com.phodal.autodev
pluginName = AutoDev
pluginRepositoryUrl = https://github.com/unit-mesh/auto-dev
# SemVer format -> https://semver.org
pluginVersion = 1.0.0-alpha.2
pluginVersion = 1.0.0-alpha.3

# Supported IDEs: idea, pycharm
baseIDE=idea
Expand Down
Expand Up @@ -165,7 +165,6 @@ open class JvmIdeaContextPrompter : ContextPrompter() {
if (!spec.isNullOrEmpty()) {
additionContext = "requirements: \n$spec"
}
prompt = "create ddl based on the follow info"
}

ChatActionType.CREATE_CHANGELOG -> {
Expand Down
Expand Up @@ -8,13 +8,4 @@ class CreateDdlAction : ChatBaseAction() {
override fun getActionType(): ChatActionType {
return ChatActionType.CREATE_DDL
}

override fun actionPerformed(event: AnActionEvent) {
val fileType = event.getData(PSI_FILE)?.fileType?.name
if (fileType != "SQL") {
return
}

super.actionPerformed(event)
}
}
8 changes: 4 additions & 4 deletions src/main/kotlin/cc/unitmesh/devti/gui/chat/ChatActionType.kt
Expand Up @@ -19,10 +19,10 @@ enum class ChatActionType {
fun instruction(lang: String = ""): String {
return when (this) {
EXPLAIN -> "Explain selected $lang code"
REVIEW -> "Code Review for following $lang code"
REFACTOR -> "Refactor the following $lang code"
REVIEW -> "Code Review given following $lang code"
REFACTOR -> "Refactor the given $lang code"
CODE_COMPLETE -> "Complete $lang code, return rest code, no explaining"
WRITE_TEST -> "Write unit test for following $lang code"
WRITE_TEST -> "Write unit test for given $lang code"
FIX_ISSUE -> "Help me fix this issue"
GEN_COMMIT_MESSAGE -> """suggest 10 commit messages based on the following diff:
commit messages should:
Expand All @@ -35,7 +35,7 @@ examples:
{{diff}}
"""
CREATE_DDL -> "create ddl"
CREATE_DDL -> "create ddl based on the given information"
CREATE_CHANGELOG -> "generate release note"
CHAT -> ""
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/cc/unitmesh/devti/gui/chat/MessageView.kt
Expand Up @@ -82,9 +82,9 @@ class MessageView(private val message: String, role: ChatRole, val displayText:

fun doneContent() {
val displayText = component.text
centerPanel.remove(component)

ApplicationManager.getApplication().invokeLater() {
centerPanel.remove(component)

val message = SimpleMessage(displayText, displayText, ChatRole.Assistant)
renderInPartView(message)

Expand Down

0 comments on commit 37809f3

Please sign in to comment.