Skip to content

Commit 58614f0

Browse files
committed
refactor(code): remove redundant null assignment in CodeHighlightSketch #259
- Remove `editorFragment = null` as it is redundant after releasing the editor. - Add logging in AgentStateService to track used tools.
1 parent 9b0a3c9 commit 58614f0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/main/kotlin/cc/unitmesh/devti/observer/agent/AgentState.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import cc.unitmesh.devti.agent.tool.AgentTool
44
import cc.unitmesh.devti.devin.dataprovider.BuiltinCommand
55
import cc.unitmesh.devti.llms.custom.Message
66
import com.intellij.openapi.components.Service
7+
import com.intellij.openapi.diagnostic.logger
78
import com.intellij.util.diff.Diff.Change
89
import java.util.UUID
910

@@ -26,6 +27,8 @@ class AgentStateService {
2627
state.usedTools = tools.map {
2728
AgentTool(it.commandName, it.description, "")
2829
}
30+
31+
logger<AgentStateService>().info("Called agent tools:\n ${state.usedTools.joinToString("\n")}")
2932
}
3033

3134
fun addChanges(fileName: String) {

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/CodeHighlightSketch.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ open class CodeHighlightSketch(
312312
editorFragment?.editor?.let {
313313
EditorFactory.getInstance().releaseEditor(it)
314314
}
315-
316-
editorFragment = null
317315
}
318316
}
319317

0 commit comments

Comments
 (0)