Skip to content

Commit c417cbb

Browse files
committed
refactor(devti): enhance AutoDev planner with real-time plan update
- Add functionality to fetch and display the current plan in real-time - Integrate AgentStateService to get the latest plan - Use MarkdownPlanParser to format the plan into markdown - Update the switchToPlanView method to accept the new plan as a parameter
1 parent 6d898ca commit c417cbb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanToolbarFactory.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package cc.unitmesh.devti.sketch.ui.plan
22

33
import cc.unitmesh.devti.gui.AutoDevPlannerToolWindow
44
import cc.unitmesh.devti.gui.AutoDevPlannerToolWindowFactory
5+
import cc.unitmesh.devti.observer.agent.AgentStateService
6+
import cc.unitmesh.devti.observer.plan.MarkdownPlanParser
57
import com.intellij.icons.AllIcons
68
import com.intellij.openapi.actionSystem.ActionManager
79
import com.intellij.openapi.actionSystem.AnAction
@@ -59,7 +61,11 @@ class PlanToolbarFactory(private val project: Project) {
5961
?.firstOrNull()
6062

6163
toolWindow.activate {
62-
codingPanel?.switchToPlanView()
64+
val agentStateService = project.getService(AgentStateService::class.java)
65+
val currentPlan = agentStateService.getPlan()
66+
val planString = MarkdownPlanParser.formatPlanToMarkdown(currentPlan)
67+
68+
codingPanel?.switchToPlanView(planString)
6369
}
6470
}
6571
}

0 commit comments

Comments
 (0)