From e531adb8d68cb8e00f1306170c81266be51240b6 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 22 Jun 2021 21:11:39 +0200 Subject: [PATCH] Log clicks on folding icons in the editor to FUS (FUS-1152) GitOrigin-RevId: b3a58cd495a982864c768f42f93b8cc3a8499876 --- .../src/com/intellij/openapi/editor/impl/EditorImpl.java | 4 +++- .../statistic/service/fus/collectors/UIEventLogger.kt | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 0652be8df661..0ec880f080d0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.editor.impl; import com.intellij.application.options.EditorFontsConstants; @@ -8,6 +8,7 @@ import com.intellij.ide.dnd.DnDManager; import com.intellij.ide.lightEdit.LightEdit; import com.intellij.ide.lightEdit.LightEditCompatible; import com.intellij.ide.ui.UISettings; +import com.intellij.internal.statistic.service.fus.collectors.UIEventLogger; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.ActionManagerEx; @@ -3957,6 +3958,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi final FoldRegion range = myGutterComponent.findFoldingAnchorAt(x, y); if (range != null) { final boolean expansion = !range.isExpanded(); + UIEventLogger.EditorFoldingIconClicked.log(expansion, e.isAltDown()); int scrollShift = expansion ? 0 : visualLineToY(yToVisualLine(y)) - getScrollingModel().getVerticalScrollOffset(); getFoldingModel().runBatchFoldingOperation(() -> { diff --git a/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UIEventLogger.kt b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UIEventLogger.kt index 4ec0598e3860..41487cb4fcd1 100644 --- a/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UIEventLogger.kt +++ b/platform/statistics/src/com/intellij/internal/statistic/service/fus/collectors/UIEventLogger.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.internal.statistic.service.fus.collectors import com.intellij.internal.statistic.eventLog.EventLogGroup @@ -7,7 +7,7 @@ import com.intellij.internal.statistic.eventLog.events.EventFields class UIEventLogger : CounterUsagesCollector() { companion object { - private val group = EventLogGroup("ui.event", 11) + private val group = EventLogGroup("ui.event", 12) @JvmField val NavBarShowPopup = group.registerEvent("NavBarShowPopup") @JvmField val NavBarNavigate = group.registerEvent("NavBarNavigate") @@ -33,6 +33,7 @@ class UIEventLogger : CounterUsagesCollector() { @JvmField val ToolWindowsWidgetPopupClicked = group.registerEvent("ToolWindowsWidgetPopupClicked") @JvmField val ImplementationViewComboBoxSelected = group.registerEvent("ImplementationViewComboBoxSelected") @JvmField val ImplementationViewToolWindowOpened = group.registerEvent("ImplementationViewToolWindowOpened") + @JvmField val EditorFoldingIconClicked = group.registerEvent("EditorFoldingIconClicked", EventFields.Boolean("expand"), EventFields.Boolean("recursive")) } override fun getGroup(): EventLogGroup = Companion.group