@@ -2,17 +2,15 @@ package cc.unitmesh.devti.gui.chat.ui
2
2
3
3
import cc.unitmesh.devti.AutoDevBundle
4
4
import cc.unitmesh.devti.AutoDevIcons
5
- import cc.unitmesh.devti.settings.customize.customizeSetting
6
5
import cc.unitmesh.devti.agent.custom.model.CustomAgentConfig
7
6
import cc.unitmesh.devti.agent.custom.model.CustomAgentState
8
7
import cc.unitmesh.devti.gui.chat.ui.viewmodel.FileListViewModel
9
8
import cc.unitmesh.devti.llms.tokenizer.Tokenizer
10
9
import cc.unitmesh.devti.llms.tokenizer.TokenizerFactory
11
10
import cc.unitmesh.devti.provider.RelatedClassesProvider
12
11
import cc.unitmesh.devti.settings.AutoDevSettingsState
13
- import cc.unitmesh.devti.util.isInProject
12
+ import cc.unitmesh.devti.settings.customize.customizeSetting
14
13
import com.intellij.codeInsight.lookup.LookupManagerListener
15
- import com.intellij.diff.editor.DiffVirtualFileBase
16
14
import com.intellij.icons.AllIcons
17
15
import com.intellij.ide.IdeTooltip
18
16
import com.intellij.ide.IdeTooltipManager
@@ -60,8 +58,6 @@ import javax.swing.*
60
58
import kotlin.math.max
61
59
import kotlin.math.min
62
60
63
- data class FilePresentationWrapper (val virtualFile : VirtualFile , var panel : JPanel ? = null , var namePanel : JPanel ? = null )
64
-
65
61
class AutoDevInputSection (private val project : Project , val disposable : Disposable ? , showAgent : Boolean = true ) :
66
62
BorderLayoutPanel () {
67
63
private val input: AutoDevInput
@@ -72,6 +68,7 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
72
68
private val stopButton: ActionButton
73
69
private val buttonPanel = JPanel (CardLayout ())
74
70
private val inputPanel = BorderLayoutPanel ()
71
+ val focusableComponent: JComponent get() = input
75
72
76
73
private val fileListViewModel = FileListViewModel (project)
77
74
private val elementsList = JBList (fileListViewModel.getListModel())
@@ -397,23 +394,6 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
397
394
val contentManager = decorator?.contentManager ? : return JBUI .scale(200 )
398
395
return contentManager.component.height / 2
399
396
}
400
-
401
- val focusableComponent: JComponent get() = input
402
-
403
- fun DefaultListModel<FilePresentation>.addIfAbsent (vfile : VirtualFile , first : Boolean = false) {
404
- if (! vfile.isValid || vfile.fileType.isBinary) return
405
- if (! isInProject(vfile, project)) return
406
- if (vfile is DiffVirtualFileBase ) return
407
-
408
- if (elements().asSequence().none { it.virtualFile == vfile }) {
409
- val filePresentation = FilePresentation (vfile)
410
- if (first) {
411
- insertElementAt(filePresentation, 0 )
412
- } else {
413
- addElement(filePresentation)
414
- }
415
- }
416
- }
417
397
}
418
398
419
399
private const val FONT_KEY = " FontFunction"
0 commit comments