mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-12 05:51:28 +00:00
refactor: improve folder suggestions update strategy
This commit is contained in:
parent
e0dd612a70
commit
96ac29640d
2 changed files with 6 additions and 16 deletions
|
|
@ -107,7 +107,10 @@ class FolderSuggestionActionStrategy : SuggestionUpdateStrategy {
|
|||
.filter { path ->
|
||||
val file = virtualFileManager.findFileByNioPath(path)
|
||||
val isProjectFile =
|
||||
file != null && runReadAction { projectFileIndex.isInContent(file) }
|
||||
file != null && runReadAction {
|
||||
projectFileIndex.isInSourceContent(file)
|
||||
|| projectFileIndex.isInTestSourceContent(file)
|
||||
}
|
||||
path.isDirectory() && !path.startsWith(".") && isProjectFile
|
||||
}
|
||||
.forEach { folder ->
|
||||
|
|
@ -147,21 +150,6 @@ class PersonaSuggestionActionStrategy : SuggestionUpdateStrategy {
|
|||
}
|
||||
}
|
||||
|
||||
class CreatePersonaActionStrategy : SuggestionUpdateStrategy {
|
||||
override fun populateSuggestions(
|
||||
project: Project,
|
||||
listModel: DefaultListModel<SuggestionItem>,
|
||||
) {
|
||||
}
|
||||
|
||||
override fun updateSuggestions(
|
||||
project: Project,
|
||||
listModel: DefaultListModel<SuggestionItem>,
|
||||
searchText: String,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultSuggestionActionStrategy : SuggestionUpdateStrategy {
|
||||
override fun populateSuggestions(
|
||||
project: Project,
|
||||
|
|
|
|||
|
|
@ -114,6 +114,8 @@ class SuggestionsPopupManager(
|
|||
|
||||
fun updateSuggestions(searchText: String) {
|
||||
currentActionStrategy.updateSuggestions(project, listModel, searchText)
|
||||
list.revalidate()
|
||||
list.repaint()
|
||||
}
|
||||
|
||||
fun reset(clearPrevious: Boolean = true) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue