Skip to content

Commit 643bb41

Browse files
committed
feat(settings): add trim code option before sending #317
Adds a new setting to trim code before sending in AutoDev Coder configuration. Updates messages and UI components for both English and Chinese locales.
1 parent a77e72d commit 643bb41

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

core/src/main/kotlin/cc/unitmesh/devti/settings/coder/AutoDevCoderConfigurable.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class AutoDevCoderConfigurable(private val project: Project) : BoundConfigurable
2929
}
3030
private val inEditorCompletionCheckBox = JCheckBox()
3131
private val noChatHistoryCheckBox = JCheckBox()
32+
private val trimCodeBeforeSend = JCheckBox()
3233

3334
private val useCustomAIEngineWhenInlayCodeComplete = JCheckBox()
3435
.apply {
@@ -75,6 +76,15 @@ class AutoDevCoderConfigurable(private val project: Project) : BoundConfigurable
7576
)
7677
}
7778

79+
row(jLabel("settings.autodev.coder.trimCodeBeforeSend")) {
80+
fullWidthCell(trimCodeBeforeSend)
81+
.bind(
82+
componentGet = { it.isSelected },
83+
componentSet = { component, value -> component.isSelected = value },
84+
prop = state::trimCodeBeforeSend.toMutableProperty()
85+
)
86+
}
87+
7888
row(jLabel("settings.autodev.coder.inEditorCompletion")) {
7989
fullWidthCell(inEditorCompletionCheckBox)
8090
.bind(

core/src/main/kotlin/cc/unitmesh/devti/settings/coder/AutoDevCoderSettingService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class AutoDevCoderSettingService(
2626
var disableAdvanceContext by property(false)
2727
var inEditorCompletion by property(false)
2828
var noChatHistory by property(false)
29+
var trimCodeBeforeSend by property(false)
2930
var enableRenameSuggestion by property(false)
3031

3132
var useCustomAIEngineWhenInlayCodeComplete by property(false)

core/src/main/resources/messages/AutoDevBundle_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ settings.external.team.prompts.path=Team Prompts Path
8888
settings.external.team.prompts.name=Team Prompts
8989

9090
settings.autodev.coder=AutoDev Coder
91+
settings.autodev.coder.trimCodeBeforeSend=Trim Code Before Sending
9192
settings.autodev.coder.recordingInLocal=Recording Instruction In Local
9293
settings.autodev.coder.disableAdvanceContext=Disable Advance Context
9394
settings.autodev.coder.disableAdvanceContext.tips=like framework context, language context, etc.

core/src/main/resources/messages/AutoDevBundle_zh.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ settings.external.team.prompts.name=团队 AI
8989

9090
settings.autodev.coder=AutoDev 编码器
9191
settings.autodev.coder.recordingInLocal=本地记录 AI 请求和响应(Instruction)
92+
settings.autodev.coder.trimCodeBeforeSend=在发送代码之前修剪代码
9293
settings.autodev.coder.disableAdvanceContext=禁用高级上下文
9394
settings.autodev.coder.disableAdvanceContext.tips=如框架上下文、语言上下文等
9495
settings.autodev.coder.inEditorCompletion=编辑器中的实时补全

0 commit comments

Comments
 (0)