Skip to content

Commit 11cc6df

Browse files
committed
feat(completion): rename ToolHub to ToolHubVariable and update completion provider
The ToolHub enum has been renamed to ToolHubVariable to better reflect its role as a provider of variable names for AI agent commands and configurations. Additionally, the completion provider has been updated to use the new enum and its elements are now displayed with the DevInIcons.DEFAULT icon and type text.
1 parent edc3e8c commit 11cc6df

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/dataprovider/ToolHub.kt renamed to exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/dataprovider/ToolHubVariable.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import cc.unitmesh.devti.agent.model.CustomAgentConfig
1010
* $agent
1111
* ```
1212
*/
13-
enum class ToolHub(val summaryName: String, val type: String, val description: String) {
14-
AGENT("Agent", CustomAgentConfig::class.simpleName.toString(), "DevIns all agent for AI Agent to call"),
15-
COMMAND("Command", BuiltinCommand::class.simpleName.toString(), "DevIns all commands for AI Agent to call"),
13+
enum class ToolHubVariable(val summaryName: String, val type: String, val description: String) {
14+
AGENT("agent", CustomAgentConfig::class.simpleName.toString(), "DevIns all agent for AI Agent to call"),
15+
COMMAND("command", BuiltinCommand::class.simpleName.toString(), "DevIns all commands for AI Agent to call"),
1616

1717
;
1818

1919
companion object {
20-
fun all(): List<ToolHub> {
20+
fun all(): List<ToolHubVariable> {
2121
return values().toList()
2222
}
2323

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

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

33
import cc.unitmesh.devti.language.DevInIcons
4-
import cc.unitmesh.devti.language.completion.dataprovider.ToolHub
4+
import cc.unitmesh.devti.language.completion.dataprovider.ToolHubVariable
55
import com.intellij.codeInsight.completion.CompletionParameters
66
import com.intellij.codeInsight.completion.CompletionProvider
77
import com.intellij.codeInsight.completion.CompletionResultSet
@@ -15,7 +15,7 @@ class AgentToolOverviewCompletion : CompletionProvider<CompletionParameters>() {
1515
context: ProcessingContext,
1616
result: CompletionResultSet
1717
) {
18-
ToolHub.all().forEach { toolHub ->
18+
ToolHubVariable.all().forEach { toolHub ->
1919
val elements = LookupElementBuilder.create(toolHub.summaryName)
2020
.withIcon(DevInIcons.DEFAULT)
2121
.withTypeText(toolHub.type, true)

0 commit comments

Comments
 (0)