mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
FUS: delete FeatureUsageDataBuilder
GitOrigin-RevId: ba54397b4a8f0ee632925fee06f5ee11c47fbad1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5ee5c13915
commit
92b796100b
@@ -87,7 +87,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["version:regexp#version"])
|
||||
fun addVersionByString(@NonNls version: String?): FeatureUsageData {
|
||||
if (version == null) {
|
||||
data["version"] = "unknown"
|
||||
@@ -98,7 +97,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["version:regexp#version"])
|
||||
fun addVersion(@NonNls version: Version?): FeatureUsageData {
|
||||
data["version"] = if (version != null) "${version.major}.${version.minor}" else "unknown.format"
|
||||
return this
|
||||
@@ -108,7 +106,6 @@ class FeatureUsageData {
|
||||
* Group by OS will be available without adding OS explicitly to event data.
|
||||
*/
|
||||
@Deprecated("Don't add OS to event data")
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["os:enum#os"])
|
||||
fun addOS(): FeatureUsageData {
|
||||
data["os"] = getOS()
|
||||
return this
|
||||
@@ -120,8 +117,6 @@ class FeatureUsageData {
|
||||
return if (SystemInfo.isLinux) "Linux" else "Other"
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["plugin:util#plugin", "plugin_type:util#plugin_type",
|
||||
"plugin_version:util#plugin_version"])
|
||||
fun addPluginInfo(info: PluginInfo?): FeatureUsageData {
|
||||
info?.let {
|
||||
addPluginInfoTo(info, data)
|
||||
@@ -129,7 +124,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["lang:util#lang"])
|
||||
fun addLanguage(@NonNls id: String?): FeatureUsageData {
|
||||
id?.let {
|
||||
addLanguage(Language.findLanguageByID(id))
|
||||
@@ -137,12 +131,10 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["lang:util#lang"])
|
||||
fun addLanguage(language: Language?): FeatureUsageData {
|
||||
return addLanguageInternal("lang", language)
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["current_file:util#current_file"])
|
||||
fun addCurrentFile(language: Language?): FeatureUsageData {
|
||||
return addLanguageInternal("current_file", language)
|
||||
}
|
||||
@@ -160,7 +152,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["input_event:util#shortcut"])
|
||||
fun addInputEvent(event: InputEvent?, @NonNls place: String?): FeatureUsageData {
|
||||
val inputEvent = ShortcutDataProvider.getInputEventText(event, place)
|
||||
if (inputEvent != null && StringUtil.isNotEmpty(inputEvent)) {
|
||||
@@ -169,7 +160,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["input_event:util#shortcut"])
|
||||
fun addInputEvent(event: AnActionEvent?): FeatureUsageData {
|
||||
val inputEvent = ShortcutDataProvider.getActionEventText(event)
|
||||
if (inputEvent != null && StringUtil.isNotEmpty(inputEvent)) {
|
||||
@@ -178,7 +168,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["input_event:util#shortcut"])
|
||||
fun addInputEvent(event: KeyEvent): FeatureUsageData {
|
||||
val inputEvent = ShortcutDataProvider.getKeyEventText(event)
|
||||
if (inputEvent != null && StringUtil.isNotEmpty(inputEvent)) {
|
||||
@@ -187,7 +176,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["input_event:util#shortcut"])
|
||||
fun addInputEvent(event: MouseEvent): FeatureUsageData {
|
||||
val inputEvent = ShortcutDataProvider.getMouseEventText(event)
|
||||
if (inputEvent != null && StringUtil.isNotEmpty(inputEvent)) {
|
||||
@@ -196,7 +184,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["place:util#place"])
|
||||
fun addPlace(@NonNls place: String?): FeatureUsageData {
|
||||
if (place == null) return this
|
||||
|
||||
@@ -215,13 +202,11 @@ class FeatureUsageData {
|
||||
return ActionPlaces.isCommonPlace(place) || ActionPlaces.TOOLWINDOW_POPUP == place
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["file_path:util#hash"])
|
||||
fun addAnonymizedPath(@NonNls path: String?): FeatureUsageData {
|
||||
data["file_path"] = path?.let { EventLogConfiguration.anonymize(path) } ?: "undefined"
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["anonymous_id:util#hash"])
|
||||
fun addAnonymizedId(@NonNls id: String): FeatureUsageData {
|
||||
data["anonymous_id"] = EventLogConfiguration.anonymize(id)
|
||||
return this
|
||||
@@ -232,7 +217,6 @@ class FeatureUsageData {
|
||||
return this
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["value::0"])
|
||||
fun addValue(value: Any): FeatureUsageData {
|
||||
if (value is String || value is Boolean || value is Int || value is Long || value is Float || value is Double) {
|
||||
return addDataInternal("value", value)
|
||||
@@ -240,12 +224,10 @@ class FeatureUsageData {
|
||||
return addData("value", value.toString())
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["enabled:enum#boolean"])
|
||||
fun addEnabled(enabled: Boolean): FeatureUsageData {
|
||||
return addData("enabled", enabled)
|
||||
}
|
||||
|
||||
@FeatureUsageDataBuilder(additionalDataFields = ["count:regexp#integer"])
|
||||
fun addCount(count: Int): FeatureUsageData {
|
||||
return addData("count", count)
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2000-2019 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.eventLog
|
||||
|
||||
/**
|
||||
* Mark the methods of FeatureUsageData that add new fields. Annotation is used to facilitate analysis.
|
||||
* @param additionalDataFields - an array of event data fields, that the method adds to FeatureUsageData.
|
||||
* You can describe validation rules for each field as "<fieldName>:<validationRule>". For example, "count:regexp#integer".
|
||||
* If you can't describe validation rule, you can pass value index in the signature of factory method,
|
||||
* starts at 0 ("<fieldName>::<valueIndex>"). For example, "count::4"
|
||||
*
|
||||
* @see com.intellij.internal.statistic.eventLog.FeatureUsageData.addCount
|
||||
* @see com.intellij.internal.statistic.eventLog.FeatureUsageData.addValue
|
||||
*/
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
|
||||
annotation class FeatureUsageDataBuilder(val additionalDataFields: Array<String> = [])
|
||||
Reference in New Issue
Block a user