Skip to content

Commit 6ac77c7

Browse files
committed
refactor(language-provider): add DevInLanguage import and use it for display name
This commit introduces the import of `DevInLanguage` and updates the `name` property to use its display name, enhancing the language provider's functionality.
1 parent 5b2b2a9 commit 6ac77c7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/provider/DevInsCustomAgentResponse.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cc.unitmesh.devti.language.provider
22

33
import cc.unitmesh.devti.AutoDevNotifications
4+
import cc.unitmesh.devti.language.DevInLanguage
45
import cc.unitmesh.devti.language.compiler.DevInsCompiler
56
import cc.unitmesh.devti.language.psi.DevInFile
67
import cc.unitmesh.devti.provider.devins.CustomAgentContext
@@ -13,19 +14,17 @@ import com.intellij.psi.util.PsiUtilBase
1314

1415

1516
class DevInsCustomAgentResponse : LanguagePromptProcessor {
16-
override val name: String = "DevIn"
17+
override val name: String = DevInLanguage.displayName
1718

1819
override fun execute(project: Project, context: CustomAgentContext): String {
1920
val devInsCompiler = createCompiler(project, context.response)
20-
2121
val result = devInsCompiler.compile()
2222
AutoDevNotifications.notify(project, result.output)
2323
return result.output
2424
}
2525

2626
override fun compile(project: Project, text: String): String {
2727
val devInsCompiler = createCompiler(project, text)
28-
2928
val result = devInsCompiler.compile()
3029
return result.output
3130
}
@@ -48,8 +47,7 @@ class DevInsCustomAgentResponse : LanguagePromptProcessor {
4847
getElementAtOffset(psiFile, it)
4948
}
5049

51-
val devInsCompiler = DevInsCompiler(project, devInFile, editor, element)
52-
return devInsCompiler
50+
return DevInsCompiler(project, devInFile, editor, element)
5351
}
5452

5553
private fun getElementAtOffset(psiFile: PsiElement, offset: Int): PsiElement? {

0 commit comments

Comments
 (0)