Skip to content

Commit 71cf4f2

Browse files
committed
refactor(compile): move file paths
1 parent 1692f0a commit 71cf4f2

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

src/main/kotlin/cc/unitmesh/devti/custom/TeamPromptBaseIntention.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cc.unitmesh.devti.custom
22

33
import cc.unitmesh.devti.custom.team.TeamPromptAction
44
import cc.unitmesh.devti.custom.team.TeamPromptExecTask
5-
import cc.unitmesh.devti.custom.variable.VariableTemplateCompiler
5+
import cc.unitmesh.devti.custom.compile.VariableTemplateCompiler
66
import cc.unitmesh.devti.gui.chat.ChatActionType
77
import cc.unitmesh.devti.intentions.action.base.ChatBaseIntention
88
import com.intellij.openapi.editor.Editor

src/main/kotlin/cc/unitmesh/devti/custom/variable/CustomVariable.kt renamed to src/main/kotlin/cc/unitmesh/devti/custom/compile/CustomVariable.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.custom.variable
1+
package cc.unitmesh.devti.custom.compile
22

33
enum class CustomVariable(val variable: String, val description: String) {
44
SELECTION("selection", "The selected text"),
@@ -19,5 +19,9 @@ enum class CustomVariable(val variable: String, val description: String) {
1919
fun hasVariable(content: String): Boolean {
2020
return all().any { content.contains("\${${it.variable}}") }
2121
}
22+
23+
fun compile(content: String, compiler: VariableTemplateCompiler): String {
24+
return compiler.compile(content)
25+
}
2226
}
2327
}

src/main/kotlin/cc/unitmesh/devti/custom/variable/VariableTemplateCompiler.kt renamed to src/main/kotlin/cc/unitmesh/devti/custom/compile/VariableTemplateCompiler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.custom.variable
1+
package cc.unitmesh.devti.custom.compile
22

33
import cc.unitmesh.devti.custom.team.DefaultTeamContextProvider
44
import cc.unitmesh.devti.gui.chat.ChatActionType

src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevInputSection.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import cc.unitmesh.devti.AutoDevIcons
55
import cc.unitmesh.devti.counit.configurable.customAgentSetting
66
import cc.unitmesh.devti.counit.model.CustomAgentConfig
77
import cc.unitmesh.devti.counit.model.CustomAgentState
8-
import cc.unitmesh.devti.custom.variable.CustomVariable
8+
import cc.unitmesh.devti.custom.compile.CustomVariable
99
import cc.unitmesh.devti.llms.tokenizer.Tokenizer
1010
import cc.unitmesh.devti.llms.tokenizer.TokenizerImpl
1111
import cc.unitmesh.devti.settings.AutoDevSettingsState
@@ -40,7 +40,6 @@ import com.intellij.util.ui.JBEmptyBorder
4040
import com.intellij.util.ui.JBUI
4141
import com.intellij.util.ui.UIUtil
4242
import com.intellij.util.ui.components.BorderLayoutPanel
43-
import kotlinx.serialization.decodeFromString
4443
import kotlinx.serialization.json.Json
4544
import java.awt.Color
4645
import java.awt.Component

src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevVariableList.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cc.unitmesh.devti.gui.chat
22

3-
import cc.unitmesh.devti.custom.variable.CustomVariable
3+
import cc.unitmesh.devti.custom.compile.CustomVariable
44
import com.intellij.ui.Gray
55
import com.intellij.ui.JBColor
66
import com.intellij.ui.components.JBList

src/test/kotlin/cc/unitmesh/devti/custom/variable/CustomVariableTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cc.unitmesh.devti.custom.variable
22

3+
import cc.unitmesh.devti.custom.compile.CustomVariable
34
import io.kotest.matchers.shouldBe
45
import org.junit.Test
56

0 commit comments

Comments
 (0)