diff --git a/src/main/java/com/maddyhome/idea/vim/statistic/VimStatistic.kt b/src/main/java/com/maddyhome/idea/vim/statistic/VimStatistic.kt new file mode 100644 index 000000000..970990994 --- /dev/null +++ b/src/main/java/com/maddyhome/idea/vim/statistic/VimStatistic.kt @@ -0,0 +1,22 @@ +package com.maddyhome.idea.vim.statistic + +import com.intellij.internal.statistic.beans.MetricEvent +import com.intellij.internal.statistic.eventLog.EventLogGroup +import com.intellij.internal.statistic.eventLog.events.BooleanEventField +import com.intellij.internal.statistic.eventLog.events.EventId1 +import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector +import com.maddyhome.idea.vim.option.OptionsManager + +class VimStatistic : ApplicationUsagesCollector() { + + override fun getGroup(): EventLogGroup = GROUP + + override fun getMetrics(): Set<MetricEvent> { + return setOf(OPTIONS.metric(OptionsManager.ideajoin.isSet)) + } + + companion object { + private val GROUP = EventLogGroup("vim.options", 1) + private val OPTIONS: EventId1<Boolean> = GROUP.registerEvent("ideajoin", BooleanEventField("ideajoin")) + } +} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index f85c4bc23..45e22984f 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -109,6 +109,8 @@ <spellchecker.bundledDictionaryProvider implementation="com.maddyhome.idea.vim.VimBundledDictionaryProvider"/> <notificationGroup displayType="STICKY_BALLOON" id="ideavim-sticky"/> + + <statistics.applicationUsagesCollector implementation="com.maddyhome.idea.vim.statistic.VimStatistic"/> </extensions> <xi:include href="/META-INF/includes/ApplicationServices.xml" xpointer="xpointer(/idea-plugin/*)"/>