Skip to content

Commit 268f309

Browse files
author
Jia Liu
committed
feat: add inlay code complete custom ai engine toggle in dev coder config
1 parent a9e8b06 commit 268f309

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ class AutoDevCoderConfigurable(project: Project) : BoundConfigurable(AutoDevBund
2222
private val refactorCodeField = JTextField()
2323
private val fixIssueCodeField = JTextField()
2424
private val generateTestField = JTextField()
25-
25+
private val useCustomAIEngineWhenInlayCodeComplete = JCheckBox()
26+
.apply {
27+
toolTipText = "You can use custom LLM to inlay complete code."
28+
}
2629
val settings = project.service<AutoDevCoderSettingService>()
2730
val state = settings.state.copy()
2831

@@ -95,6 +98,15 @@ class AutoDevCoderConfigurable(project: Project) : BoundConfigurable(AutoDevBund
9598
)
9699
}
97100

101+
row(AutoDevBundle.message("settings.autodev.coder.useCustomerAgentWhenInlayCodeComplete")) {
102+
fullWidthCell(useCustomAIEngineWhenInlayCodeComplete)
103+
.bind(
104+
componentGet = { it.isSelected },
105+
componentSet = { component, value -> component.isSelected = value },
106+
prop = state::useCustomAIEngineWhenInlayCodeComplete.toMutableProperty()
107+
)
108+
}
109+
98110
onApply {
99111
settings.modify {
100112
it.recordingInLocal = state.recordingInLocal
@@ -104,6 +116,7 @@ class AutoDevCoderConfigurable(project: Project) : BoundConfigurable(AutoDevBund
104116
it.refactorCode = state.refactorCode
105117
it.fixIssueCode = state.fixIssueCode
106118
it.generateTest = state.generateTest
119+
it.useCustomAIEngineWhenInlayCodeComplete = state.useCustomAIEngineWhenInlayCodeComplete
107120
it.noChatHistory = state.noChatHistory
108121
}
109122
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class AutoDevCoderSettingService(
3030
var fixIssueCode: String by property("Help me fix this issue") { it.isEmpty() }
3131
var generateTest: String by property("Generate test for \$lang code") { it.isEmpty() }
3232

33+
var useCustomAIEngineWhenInlayCodeComplete by property(false)
3334
override fun copy(): AutoDevCoderSettings {
3435
val state = AutoDevCoderSettings()
3536
state.copyFrom(this)

src/main/resources/messages/AutoDevBundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ settings.autodev.coder.explainCode=Explain code
9696
settings.autodev.coder.refactorCode=Refactor code
9797
settings.autodev.coder.fixIssueCode=Fix issue
9898
settings.autodev.coder.generateTest=Generate test
99+
settings.autodev.coder.useCustomerAgentWhenInlayCodeComplete= Use Custormer Agent
99100

100101
settings.welcome.message=Welcome to use AutoDev
101102
settings.welcome.feature.context=Precise context-aware code generate and chat

0 commit comments

Comments
 (0)