mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Validator for gutter_icon (FUS-421)
GitOrigin-RevId: ced994e2fc1c2ccaa6f6503e1fe3ece1b6e0637d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
47f0520440
commit
a117e7858e
+3
-2
@@ -5,8 +5,9 @@ import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomWhiteListRule
|
||||
|
||||
class ProjectTypeWhiteListRule : CustomWhiteListRule() {
|
||||
override fun acceptRuleId(ruleId: String?) = ruleId == "project_type" || ruleId == "framework"
|
||||
class PluginInfoWhiteListRule : CustomWhiteListRule() {
|
||||
override fun acceptRuleId(ruleId: String?) =
|
||||
ruleId == "project_type" || ruleId == "framework" || ruleId == "gutter_icon"
|
||||
|
||||
override fun doValidate(data: String, context: EventContext): ValidationResultType {
|
||||
return acceptWhenReportedByPluginFromPluginRepository(context)
|
||||
+12
-11
@@ -14,6 +14,7 @@ import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.ui.customization.CustomActionsSchema;
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData;
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUCounterUsageLogger;
|
||||
import com.intellij.internal.statistic.utils.PluginInfo;
|
||||
import com.intellij.internal.statistic.utils.PluginInfoDetectorKt;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil;
|
||||
@@ -1774,20 +1775,20 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
: renderer.getClickAction();
|
||||
}
|
||||
if (clickAction != null) {
|
||||
if (PluginInfoDetectorKt.getPluginInfo(renderer.getClass()).isSafeToReport()) {
|
||||
FeatureUsageData usageData = new FeatureUsageData();
|
||||
Project project = myEditor.getProject();
|
||||
if (project != null) {
|
||||
usageData.addProject(project);
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(myEditor.getDocument());
|
||||
if (file != null) {
|
||||
usageData.addCurrentFile(file.getLanguage());
|
||||
}
|
||||
PluginInfo pluginInfo = PluginInfoDetectorKt.getPluginInfo(renderer.getClass());
|
||||
FeatureUsageData usageData = new FeatureUsageData();
|
||||
usageData.addPluginInfo(pluginInfo);
|
||||
Project project = myEditor.getProject();
|
||||
if (project != null) {
|
||||
usageData.addProject(project);
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(myEditor.getDocument());
|
||||
if (file != null) {
|
||||
usageData.addCurrentFile(file.getLanguage());
|
||||
}
|
||||
|
||||
FUCounterUsageLogger.getInstance().logEvent("gutter.icon.click", renderer.getFeatureId(), usageData);
|
||||
}
|
||||
|
||||
FUCounterUsageLogger.getInstance().logEvent("gutter.icon.click", renderer.getFeatureId(), usageData);
|
||||
|
||||
performAction(clickAction, e, ActionPlaces.EDITOR_GUTTER, myEditor.getDataContext());
|
||||
repaint();
|
||||
e.consume();
|
||||
|
||||
@@ -936,7 +936,6 @@
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.codeInsight.template.impl.SurroundWithLogger$SurroundWithIdValidator"/>
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.codeInsight.template.postfix.templates.PostfixTemplateLogger$PostfixTemplateValidator"/>
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.internal.statistic.tools.InspectionsUsagesCollector$InspectionToolValidator"/>
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.internal.statistic.collectors.fus.ProjectTypeWhiteListRule"/>
|
||||
|
||||
<postStartupActivity implementation="com.intellij.internal.statistic.collectors.fus.fileTypes.FileTypeExtensionUsagesCollectorStartupActivity"/>
|
||||
|
||||
|
||||
@@ -428,6 +428,7 @@
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.execution.dashboard.RunDashboardUsagesCollector$RunConfigurationTypeValidator" />
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.featureStatistics.FeatureUsageTrackerImpl$ProductivityUtilValidator" />
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.internal.statistic.collectors.fus.RegistryApplicationUsagesCollector$RegistryUtilValidator" />
|
||||
<statistics.validation.customWhiteListRule implementation="com.intellij.internal.statistic.collectors.fus.PluginInfoWhiteListRule"/>
|
||||
|
||||
<statistics.projectUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.fileTypes.ProjectStructureUsageCollector"/>
|
||||
<statistics.projectUsagesCollector implementation="com.intellij.internal.statistic.collectors.fus.FacetTypeUsageCollector"/>
|
||||
|
||||
Reference in New Issue
Block a user