From 547ccd707cd48959e7e7945b1e6b791a076a9b7e Mon Sep 17 00:00:00 2001 From: Vera Petrenkova Date: Sun, 29 Jun 2025 22:55:09 +0200 Subject: [PATCH] [find in files] IJPL-184307 add the scope changed event to FUS GitOrigin-RevId: fb8596c2157a14de9723b5b7a555eea5972c8401 --- .../lang-impl/src/com/intellij/find/FindUsagesCollector.kt | 6 ++++++ .../src/com/intellij/find/impl/FindPopupPanel.java | 1 + 2 files changed, 7 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/find/FindUsagesCollector.kt b/platform/lang-impl/src/com/intellij/find/FindUsagesCollector.kt index c842635d57ff..a5c1b84db0a2 100644 --- a/platform/lang-impl/src/com/intellij/find/FindUsagesCollector.kt +++ b/platform/lang-impl/src/com/intellij/find/FindUsagesCollector.kt @@ -37,6 +37,7 @@ internal object FindUsagesCollector : CounterUsagesCollector() { CONTEXT, SELECTED_SEARCH_SCOPE ) + private val SEARCH_SCOPE_CHANGED = GROUP.registerEvent("search.scope.changed", SELECTED_SEARCH_SCOPE) private val OPTION_VALUE = EventFields.Boolean("option_value") @@ -75,6 +76,11 @@ internal object FindUsagesCollector : CounterUsagesCollector() { REGEXP_HELP_CLICKED.log(StringUtil.notNullize(type, UNKNOWN)) } + @JvmStatic + fun triggerScopeSelected(scopeType: FindPopupScopeUI.ScopeType?) { + SEARCH_SCOPE_CHANGED.log(SelectedSearchScope.getByScopeType(scopeType)) + } + override fun getGroup(): EventLogGroup = GROUP } diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java b/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java index f431410f351c..ec7137202e5f 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java +++ b/platform/lang-impl/src/com/intellij/find/impl/FindPopupPanel.java @@ -1965,6 +1965,7 @@ public final class FindPopupPanel extends JBPanel implements Fin @Override public void setSelected(@NotNull AnActionEvent e, boolean state) { if (state) { + FindUsagesCollector.triggerScopeSelected(myScope); mySelectedScope = myScope; myScopeSelectionToolbar.updateActionsImmediately(); updateScopeDetailsPanel();