mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-188790 Search Everywhere: several scopes are shown as on the popup reopening
- Only a few scopes are predefined and remain the same, the others differ with each call to scopesWithSeparators. GitOrigin-RevId: 730b43c38951ebbde9b49e882949132f829b5453
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1ce9894d63
commit
d7bbc512db
@@ -119,20 +119,24 @@ class SeTargetsProviderDelegate(private val contributorWrapper: SeAsyncWeightedC
|
||||
|
||||
val all = mutableMapOf<String, ScopeDescriptor>()
|
||||
val selectedScope = scopeChooserAction.selectedScope
|
||||
var selectedScopeId: String? = null
|
||||
|
||||
val scopeDataList = readAction {
|
||||
scopeChooserAction.scopesWithSeparators
|
||||
}.mapNotNull { scope ->
|
||||
val key = UUID.randomUUID().toString()
|
||||
if (selectedScope.scopeEquals(scope.scope)) selectedScopeId = key
|
||||
|
||||
val data = SeSearchScopeData.from(scope, key)
|
||||
if (data != null) all[key] = scope
|
||||
data
|
||||
}
|
||||
|
||||
scopeIdToScope.store(all)
|
||||
|
||||
val selectedScopeId = selectedScope.scope?.displayName.let { name ->
|
||||
scopeDataList.firstOrNull {
|
||||
@Suppress("HardCodedStringLiteral")
|
||||
it.name == name
|
||||
}?.scopeId
|
||||
}
|
||||
|
||||
val everywhereScopeId = scopeChooserAction.everywhereScopeName?.let { name ->
|
||||
scopeDataList.firstOrNull {
|
||||
@Suppress("HardCodedStringLiteral")
|
||||
|
||||
Reference in New Issue
Block a user