Skip to content

Commit

Permalink
feat(releasenote): make it works
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 22, 2023
1 parent ebf8f22 commit 86732ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Expand Up @@ -17,7 +17,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiManager

class JvmContextPrompter : ContextPrompter() {
class JvmIdeaContextPrompter : ContextPrompter() {
private var additionContext: String = ""
private val autoDevSettingsState = AutoDevSettingsState.getInstance()
private var promptConfig: PromptConfig? = null
Expand Down
2 changes: 1 addition & 1 deletion idea/src/main/resources/cc.unitmesh.idea.xml
Expand Up @@ -20,7 +20,7 @@

<contextPrompter
language="JAVA"
implementation="cc.unitmesh.idea.provider.JvmContextPrompter"/>
implementation="cc.unitmesh.idea.provider.JvmIdeaContextPrompter"/>
<techStackProvider
language="JAVA"
implementation="cc.unitmesh.idea.provider.JvmTechStackService"/>
Expand Down
2 changes: 1 addition & 1 deletion idea/src/main/resources/cc.unitmesh.kotlin.xml
Expand Up @@ -20,7 +20,7 @@

<contextPrompter
language="Kotlin"
implementation="cc.unitmesh.idea.provider.JvmContextPrompter"/>
implementation="cc.unitmesh.idea.provider.JvmIdeaContextPrompter"/>
<techStackProvider
language="Kotlin"
implementation="cc.unitmesh.idea.provider.JvmTechStackService"/>
Expand Down
Expand Up @@ -40,10 +40,15 @@ class ReleaseNoteSuggestionAction : AnAction() {
val prompter = ContextPrompter.prompter("")
prompter?.initContext(actionType, "", null, project, 0)

val commitMsgs = stringList.joinToString(",")
toolWindowManager?.activate {
val chatContext = ChatContext(null, stringList.joinToString(","), "")
chatCodingService.handlePromptAndResponse(contentPanel, object : ContextPrompter() {
override fun getUIPrompt(): String =
"generate release note based on follow info: $commitMsgs"

chatCodingService.handlePromptAndResponse(contentPanel, prompter!!, chatContext)
override fun getRequestPrompt(): String =
"generate release note based on follow info: $commitMsgs"
}, null)
}
}
}

0 comments on commit 86732ed

Please sign in to comment.