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:
Tatiana Elfimova
2025-06-11 17:02:38 +00:00
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")