Skip to content

Commit 7e381f0

Browse files
committed
refactor(variable-resolver): refactor variable type to CustomResolvedVariableType
This commit refactors the variable type from CustomVariableType to CustomResolvedVariableType across all variable resolvers to better reflect the resolved nature of the variables.
1 parent ae6665e commit 7e381f0

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/main/kotlin/cc/unitmesh/devti/custom/variable/CustomVariableType.kt renamed to src/main/kotlin/cc/unitmesh/devti/custom/variable/CustomResolvedVariableType.kt

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

3-
enum class CustomVariableType(@JvmField val description: String) {
3+
enum class CustomResolvedVariableType(@JvmField val description: String) {
44
SELECTION("Currently selected code fragment with language name"),
55
METHOD_INPUT_OUTPUT("Method input parameter's class as code snippets"),
66
SPEC_VARIABLE("Load from spec config, and config to items"),

src/main/kotlin/cc/unitmesh/devti/custom/variable/MethodInputOutputVariableResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import cc.unitmesh.devti.context.MethodContextProvider
44
import com.intellij.psi.PsiElement
55

66
class MethodInputOutputVariableResolver(val element: PsiElement) : VariableResolver {
7-
override val type: CustomVariableType = CustomVariableType.METHOD_INPUT_OUTPUT
7+
override val type: CustomResolvedVariableType = CustomResolvedVariableType.METHOD_INPUT_OUTPUT
88

99
override fun resolve(): String {
1010
val methodContext = MethodContextProvider(false, false).from(element)

src/main/kotlin/cc/unitmesh/devti/custom/variable/SelectionVariableResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class SelectionVariableResolver(
44
val languageName: String,
55
val code: String,
66
) : VariableResolver {
7-
override val type: CustomVariableType = CustomVariableType.SELECTION
7+
override val type: CustomResolvedVariableType = CustomResolvedVariableType.SELECTION
88

99
override fun resolve(): String {
1010
return """

src/main/kotlin/cc/unitmesh/devti/custom/variable/SimilarChunkVariableResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.intellij.psi.PsiElement
55
import com.intellij.temporary.similar.chunks.SimilarChunksWithPaths
66

77
class SimilarChunkVariableResolver(val element: PsiElement) : VariableResolver {
8-
override val type: CustomVariableType get() = CustomVariableType.SIMILAR_CHUNK
8+
override val type: CustomResolvedVariableType get() = CustomResolvedVariableType.SIMILAR_CHUNK
99

1010
override fun resolve(): String {
1111
return try {

src/main/kotlin/cc/unitmesh/devti/custom/variable/SpecVariableResolver.kt

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

33
class SpecVariableResolver(val key: String, val value: String) : VariableResolver {
4-
override val type: CustomVariableType get() = CustomVariableType.SPEC_VARIABLE
4+
override val type: CustomResolvedVariableType get() = CustomResolvedVariableType.SPEC_VARIABLE
55

66
override fun resolve(): String = value
77

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

33
interface VariableResolver {
4-
val type: CustomVariableType
4+
val type: CustomResolvedVariableType
55
fun resolve(): String
66
fun variableName() = type.name
77
}

0 commit comments

Comments
 (0)