Add statistics for remove line action

This commit is contained in:
Konstantin Bulenkov
2016-12-01 11:28:09 +01:00
parent 6212f5f31e
commit f7de7a27f4
4 changed files with 24 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,9 +24,13 @@
*/
package com.intellij.openapi.editor.actions;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.Caret;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.VisualPosition;
import com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import com.intellij.openapi.ide.CopyPasteManager;
@@ -43,6 +47,7 @@ public class DeleteLineAction extends TextComponentEditorAction {
private static class Handler extends EditorWriteActionHandler {
@Override
public void executeWriteAction(final Editor editor, Caret caret, DataContext dataContext) {
FeatureUsageTracker.getInstance().triggerFeatureUsed("editor.delete.line");
CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP);
CopyPasteManager.getInstance().stopKillRings();
final Document document = editor.getDocument();
@@ -60,6 +60,7 @@ editing.completion.cancelByControlArrows=Cancel lookup and move caret up/down in
editing.completion.changeSorting=Changing completion variants sorting
editing.completion.postfix=Postfix completion
editing.select.word=Syntax aware selection
editor.delete.line=Editor delete line
editing.incremental.search=Editor incremental search
editing.add.carets.using.double.ctrl=Multiple carets
move.element.left.right=Move code element left/right
@@ -0,0 +1,10 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/tips.css">
</head>
<body>
<p><span class="shortcut">&shortcut:EditorDeleteLine;</span> in the editor deletes the whole line at the caret. </p>
</body>
</html>
@@ -246,6 +246,12 @@
min-usage-count="10"
first-show="2"
successive-show="4"/>
<feature
id="editor.delete.line"
tip-file="DeleteLine.html"
min-usage-count="1"
first-show="2"
successive-show="1"/>
<feature
id="scratch"
tip-file="Scratch.html"