mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
FUS: revert filtering for toolwindows from third-party plugins
Dynamically registered toolwindows are reported as coming from third-party plugins.
It's unexpected because some core toolbars use this dynamic approach.
Revert 93595f2 till we come up with a better solution.
This commit is contained in:
+1
-19
@@ -1,15 +1,10 @@
|
||||
// Copyright 2000-2018 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.
|
||||
package com.intellij.internal.statistic.collectors.fus.actions.persistence;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.internal.statistic.beans.ConvertUsagesUtil;
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageLogger;
|
||||
import com.intellij.internal.statistic.persistence.UsageStatisticsPersistenceComponent;
|
||||
import com.intellij.internal.statistic.utils.StatisticsUtilKt;
|
||||
import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.extensions.PluginId;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.ToolWindowEP;
|
||||
import com.intellij.util.xmlb.annotations.MapAnnotation;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -28,8 +23,6 @@ import java.util.Map;
|
||||
}
|
||||
)
|
||||
public class ToolWindowCollector implements PersistentStateComponent<ToolWindowCollector.State> {
|
||||
private static final String DEFAULT_ID = "third.party.plugin.toolwindow";
|
||||
|
||||
public static ToolWindowCollector getInstance() {
|
||||
return ServiceManager.getService(ToolWindowCollector.class);
|
||||
}
|
||||
@@ -48,24 +41,13 @@ public class ToolWindowCollector implements PersistentStateComponent<ToolWindowC
|
||||
State state = getState();
|
||||
if (state == null) return;
|
||||
|
||||
boolean isJB = isDevelopedByJetBrains(toolWindowId);
|
||||
final String key = ConvertUsagesUtil.escapeDescriptorName((isJB ? toolWindowId : DEFAULT_ID) + "_by_" + source);
|
||||
final String key = ConvertUsagesUtil.escapeDescriptorName(toolWindowId + "_by_" + source);
|
||||
FeatureUsageLogger.INSTANCE.log("toolwindow", key);
|
||||
final Integer count = state.myValues.get(key);
|
||||
int value = count == null ? 1 : count + 1;
|
||||
state.myValues.put(key, value);
|
||||
}
|
||||
|
||||
public static boolean isDevelopedByJetBrains(@NotNull String toolWindowId) {
|
||||
for (ToolWindowEP ep : ToolWindowEP.EP_NAME.getExtensions()) {
|
||||
if (StringUtil.equals(toolWindowId, ep.id)) {
|
||||
final PluginId id = StringUtil.isNotEmpty(ep.factoryClass) ? PluginManagerCore.getPluginByClassName(ep.factoryClass) : null;
|
||||
return StatisticsUtilKt.isDevelopedByJetBrains(id);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private State myState = new State();
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user