From c7e641280949d3ae0071d1283ec2e375d1cf8f3f Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 25 Sep 2014 15:39:44 +0400 Subject: [PATCH] add feature statistics trigger for scratches --- .../com/intellij/ide/scratch/NewScratchFileAction.java | 2 ++ .../src/messages/FeatureStatisticsBundle.properties | 2 ++ platform/platform-resources-en/src/tips/Scratch.html | 10 ++++++++++ resources/src/ProductivityFeaturesRegistry.xml | 6 ++++++ 4 files changed, 20 insertions(+) create mode 100644 platform/platform-resources-en/src/tips/Scratch.html diff --git a/platform/lang-impl/src/com/intellij/ide/scratch/NewScratchFileAction.java b/platform/lang-impl/src/com/intellij/ide/scratch/NewScratchFileAction.java index 96f8f987de63..11c7ff2efe14 100644 --- a/platform/lang-impl/src/com/intellij/ide/scratch/NewScratchFileAction.java +++ b/platform/lang-impl/src/com/intellij/ide/scratch/NewScratchFileAction.java @@ -15,6 +15,7 @@ */ package com.intellij.ide.scratch; +import com.intellij.featureStatistics.FeatureUsageTracker; import com.intellij.lang.DependentLanguage; import com.intellij.lang.InjectableLanguage; import com.intellij.lang.Language; @@ -71,6 +72,7 @@ public class NewScratchFileAction extends AnAction implements DumbAware { ListPopup popup = buildLanguagePopup(previous, new Consumer() { @Override public void consume(Language language) { + FeatureUsageTracker.getInstance().triggerFeatureUsed("scratch"); VirtualFile file = ScratchpadManager.getInstance(project).createScratchFile(language); FileEditorManager.getInstance(project).openFile(file, true); } diff --git a/platform/platform-resources-en/src/messages/FeatureStatisticsBundle.properties b/platform/platform-resources-en/src/messages/FeatureStatisticsBundle.properties index 346399cfe60e..71b4935cf4aa 100644 --- a/platform/platform-resources-en/src/messages/FeatureStatisticsBundle.properties +++ b/platform/platform-resources-en/src/messages/FeatureStatisticsBundle.properties @@ -122,3 +122,5 @@ find.completion=Completion in Find Bar switcher=Switcher dir.diff=Directory Diff jar.diff=JAR Files Diff + +scratch=New scratch file \ No newline at end of file diff --git a/platform/platform-resources-en/src/tips/Scratch.html b/platform/platform-resources-en/src/tips/Scratch.html new file mode 100644 index 000000000000..a3edd63e7c7f --- /dev/null +++ b/platform/platform-resources-en/src/tips/Scratch.html @@ -0,0 +1,10 @@ + + + + + +

+ Scratch files allows you experiment and prototype right in the editor, + without creating any project files.

+ + \ No newline at end of file diff --git a/resources/src/ProductivityFeaturesRegistry.xml b/resources/src/ProductivityFeaturesRegistry.xml index a1f533a04e63..ecb81234f562 100644 --- a/resources/src/ProductivityFeaturesRegistry.xml +++ b/resources/src/ProductivityFeaturesRegistry.xml @@ -246,6 +246,12 @@ min-usage-count="10" first-show="2" successive-show="4"/> +