6
6
import { Delayer } from 'vs/base/common/async' ;
7
7
import * as DOM from 'vs/base/browser/dom' ;
8
8
import * as lifecycle from 'vs/base/common/lifecycle' ;
9
+ import { TPromise } from 'vs/base/common/winjs.base' ;
9
10
import { IAction , Action } from 'vs/base/common/actions' ;
10
11
import { BaseActionItem } from 'vs/base/browser/ui/actionbar/actionbar' ;
11
12
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox' ;
@@ -20,7 +21,9 @@ import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel';
20
21
import { IPartService } from 'vs/workbench/services/part/common/partService' ;
21
22
import { IPanelService } from 'vs/workbench/services/panel/common/panelService' ;
22
23
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
23
- import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
24
+ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
25
+ import { CollapseAllAction as TreeCollapseAction } from 'vs/base/parts/tree/browser/treeDefaults' ;
26
+ import Tree = require( 'vs/base/parts/tree/browser/tree' ) ;
24
27
25
28
export class ToggleProblemsPanelAction extends TogglePanelAction {
26
29
@@ -34,6 +37,28 @@ export class ToggleProblemsPanelAction extends TogglePanelAction {
34
37
) {
35
38
super ( id , label , Constants . MARKERS_PANEL_ID , panelService , editorService ) ;
36
39
}
40
+
41
+ public run ( ) : TPromise < any > {
42
+ let promise = super . run ( ) ;
43
+ if ( this . isPanelFocussed ( ) ) {
44
+ this . telemetryService . publicLog ( 'problems.used' ) ;
45
+ }
46
+ return promise ;
47
+ }
48
+ }
49
+
50
+ export class CollapseAllAction extends TreeCollapseAction {
51
+
52
+ constructor ( viewer : Tree . ITree , enabled : boolean ,
53
+ @ITelemetryService private telemetryService : ITelemetryService ) {
54
+ super ( viewer , enabled ) ;
55
+ }
56
+
57
+ public run ( context ?: any ) : TPromise < any > {
58
+ this . telemetryService . publicLog ( 'problems.collapseAll.used' ) ;
59
+ return super . run ( context ) ;
60
+ }
61
+
37
62
}
38
63
39
64
export class FilterAction extends Action {
@@ -75,8 +100,11 @@ export class FilterInputBoxActionItem extends BaseActionItem {
75
100
}
76
101
77
102
private reportFilteringUsed ( ) : void {
78
- // Report only filtering is used, do not use the input from the user
79
- // this.telemetryService.publicLog('problems.filtered');
103
+ let data = { } ;
104
+ data [ 'errors' ] = this . markersPanel . markersModel . filterOptions . filterErrors ;
105
+ data [ 'warnings' ] = this . markersPanel . markersModel . filterOptions . filterWarnings ;
106
+ data [ 'infos' ] = this . markersPanel . markersModel . filterOptions . filterInfos ;
107
+ this . telemetryService . publicLog ( 'problems.filter' , data ) ;
80
108
}
81
109
82
110
public dispose ( ) : void {
0 commit comments