Skip to content

Commit 1542b0a

Browse files
committed
refactor: improve prompts and refactor LivingDocumentation.kt to use suggestDoc parameter.
1 parent 626a085 commit 1542b0a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/kotlin/cc/unitmesh/devti/provider/LivingDocumentation.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cc.unitmesh.devti.provider
33
import cc.unitmesh.devti.custom.document.LivingDocumentationType
44
import com.intellij.lang.Language
55
import com.intellij.lang.LanguageExtension
6-
import com.intellij.openapi.diagnostic.logger
76
import com.intellij.openapi.editor.Editor
87
import com.intellij.openapi.editor.SelectionModel
98
import com.intellij.psi.PsiElement
@@ -49,13 +48,13 @@ interface LivingDocumentation {
4948
return null
5049
}
5150

52-
fun buildDocFromSuggestion(suggestion: String, commentStart: String, commentEnd: String): String {
53-
val startIndex = suggestion.indexOf(commentStart)
51+
fun buildDocFromSuggestion(suggestDoc: String, commentStart: String, commentEnd: String): String {
52+
val startIndex = suggestDoc.indexOf(commentStart)
5453
if (startIndex < 0) {
5554
return ""
5655
}
5756

58-
val docComment = suggestion.substring(startIndex)
57+
val docComment = suggestDoc.substring(startIndex)
5958
val endIndex = docComment.indexOf(commentEnd, commentStart.length)
6059
if (endIndex < 0) {
6160
return docComment + commentEnd

src/main/resources/messages/AutoDevBundle_en.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,6 @@ prompts.autodev.completeCode= complete {0} code, return rest code, no explaining
195195
prompts.autodev.generateTest= Generate test for {0} code
196196
prompts.autodev.fixProblem= Help me fix problem:
197197
prompts.autodev.generateReleaseNote= generate release note
198-
prompts.autodev.generateTestData= Generate JSON data (with markdown code block) based on given {0} code and request/response info. So that we can use it to test for APIs. \n response format: \n action: // request method, url: // the request url\n body: // the request body \n response: // the response body in json
198+
prompts.autodev.generateTestData=Generate JSON data (with markdown code block) based on given {0} code and request/response info. So that we can use it to test for APIs. \n response format: \n action: // request method, url: // the request url\n body: // the request body \n response: // the response body in json
199199
settings.autodev.coder.enableRenameSuggestion=Enable Rename suggestion
200200
shell.command.suggestion.action.default.text=How to checkout a branch?

0 commit comments

Comments
 (0)