Skip to content

Commit 0a95f3c

Browse files
committed
feat(gui): clear file list and workspace on input submit
- Clear relatedFileListViewModel and workspaceFilePanel when input is submitted - Implement onSubmit function in AutoDevInputListener
1 parent 179fddc commit 0a95f3c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import cc.unitmesh.devti.AutoDevIcons
55
import cc.unitmesh.devti.agent.custom.model.CustomAgentConfig
66
import cc.unitmesh.devti.agent.custom.model.CustomAgentState
77
import cc.unitmesh.devti.completion.AutoDevInputLookupManagerListener
8-
import cc.unitmesh.devti.gui.chat.ui.file.WorkspaceFileToolbar
98
import cc.unitmesh.devti.gui.chat.ui.file.RelatedFileListCellRenderer
10-
import cc.unitmesh.devti.gui.chat.ui.file.WorkspaceFilePanel
119
import cc.unitmesh.devti.gui.chat.ui.file.RelatedFileListViewModel
10+
import cc.unitmesh.devti.gui.chat.ui.file.WorkspaceFilePanel
11+
import cc.unitmesh.devti.gui.chat.ui.file.WorkspaceFileToolbar
1212
import cc.unitmesh.devti.llms.tokenizer.Tokenizer
1313
import cc.unitmesh.devti.llms.tokenizer.TokenizerFactory
1414
import cc.unitmesh.devti.provider.RelatedClassesProvider
@@ -21,6 +21,7 @@ import com.intellij.openapi.Disposable
2121
import com.intellij.openapi.actionSystem.Presentation
2222
import com.intellij.openapi.actionSystem.impl.ActionButton
2323
import com.intellij.openapi.application.ApplicationManager
24+
import com.intellij.openapi.application.invokeLater
2425
import com.intellij.openapi.application.runInEdt
2526
import com.intellij.openapi.diagnostic.logger
2627
import com.intellij.openapi.editor.event.DocumentEvent
@@ -90,9 +91,12 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
9091
null
9192
}
9293

94+
// TODO: refactor
9395
var text: String
9496
get() {
9597
val files = workspaceFilePanel.getAllFilesFormat()
98+
relatedFileListViewModel.clearAllFiles()
99+
workspaceFilePanel.clear()
96100
return input.text + "\n" + files
97101
}
98102
set(text) {

0 commit comments

Comments
 (0)