@@ -7,7 +7,7 @@ import cc.unitmesh.devti.agent.custom.model.CustomAgentState
7
7
import cc.unitmesh.devti.gui.chat.ui.file.WorkspaceFileToolbar
8
8
import cc.unitmesh.devti.gui.chat.ui.file.RelatedFileListCellRenderer
9
9
import cc.unitmesh.devti.gui.chat.ui.file.WorkspaceFilePanel
10
- import cc.unitmesh.devti.gui.chat.ui.viewmodel.FileListViewModel
10
+ import cc.unitmesh.devti.gui.chat.ui.file.RelatedFileListViewModel
11
11
import cc.unitmesh.devti.llms.tokenizer.Tokenizer
12
12
import cc.unitmesh.devti.llms.tokenizer.TokenizerFactory
13
13
import cc.unitmesh.devti.provider.RelatedClassesProvider
@@ -71,8 +71,8 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
71
71
private val inputPanel = BorderLayoutPanel ()
72
72
val focusableComponent: JComponent get() = input
73
73
74
- private val fileListViewModel = FileListViewModel (project)
75
- private val elementsList = JBList (fileListViewModel .getListModel())
74
+ private val relatedFileListViewModel = RelatedFileListViewModel (project)
75
+ private val elementsList = JBList (relatedFileListViewModel .getListModel())
76
76
77
77
private val workspaceFilePanel: WorkspaceFilePanel
78
78
@@ -178,7 +178,7 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
178
178
scrollPane.verticalScrollBarPolicy = JScrollPane .VERTICAL_SCROLLBAR_AS_NEEDED
179
179
scrollPane.horizontalScrollBarPolicy = JScrollPane .HORIZONTAL_SCROLLBAR_AS_NEEDED
180
180
181
- val toolbar = WorkspaceFileToolbar .createToolbar(project, fileListViewModel , input)
181
+ val toolbar = WorkspaceFileToolbar .createToolbar(project, relatedFileListViewModel , input)
182
182
183
183
val headerPanel = JPanel (BorderLayout ())
184
184
headerPanel.add(toolbar, BorderLayout .NORTH )
@@ -204,7 +204,7 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
204
204
205
205
val currentFile = FileEditorManager .getInstance(project).selectedFiles.firstOrNull()
206
206
currentFile?.let {
207
- fileListViewModel .addFileIfAbsent(currentFile, first = true )
207
+ relatedFileListViewModel .addFileIfAbsent(currentFile, first = true )
208
208
}
209
209
}
210
210
@@ -215,7 +215,7 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
215
215
override fun selectionChanged (event : FileEditorManagerEvent ) {
216
216
val file = event.newFile ? : return
217
217
ApplicationManager .getApplication().invokeLater {
218
- fileListViewModel .addFileIfAbsent(file, true )
218
+ relatedFileListViewModel .addFileIfAbsent(file, true )
219
219
}
220
220
}
221
221
}
@@ -251,11 +251,11 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
251
251
val index = list.locationToIndex(e.point)
252
252
if (index == - 1 ) return
253
253
254
- val wrapper = fileListViewModel .getListModel().getElementAt(index)
254
+ val wrapper = relatedFileListViewModel .getListModel().getElementAt(index)
255
255
val cellBounds = list.getCellBounds(index, index)
256
256
257
- val actionType = fileListViewModel .determineFileAction(wrapper, e.point, cellBounds)
258
- val actionPerformed = fileListViewModel .handleFileAction(wrapper, actionType) { vfile, relativePath ->
257
+ val actionType = relatedFileListViewModel .determineFileAction(wrapper, e.point, cellBounds)
258
+ val actionPerformed = relatedFileListViewModel .handleFileAction(wrapper, actionType) { vfile, relativePath ->
259
259
if (relativePath != null ) {
260
260
workspaceFilePanel.addFileToWorkspace(vfile)
261
261
ApplicationManager .getApplication().invokeLater {
@@ -273,7 +273,7 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
273
273
}
274
274
275
275
private fun updateElements (elements : List <PsiElement >? ) {
276
- elements?.forEach { fileListViewModel .addFileIfAbsent(it.containingFile.virtualFile) }
276
+ elements?.forEach { relatedFileListViewModel .addFileIfAbsent(it.containingFile.virtualFile) }
277
277
}
278
278
279
279
fun showStopButton () {
0 commit comments