@@ -5,11 +5,11 @@ import {
5
5
commands , Event , EventEmitter , ExtensionContext , ProviderResult , Range ,
6
6
Selection , TextEditorRevealType , TreeDataProvider , TreeItem , Uri , window , workspace ,
7
7
} from "vscode" ;
8
+ import { instrumentOperation } from "vscode-extension-telemetry-wrapper" ;
8
9
import { Commands } from "../commands" ;
9
10
import { Jdtls } from "../java/jdtls" ;
10
11
import { INodeData , NodeKind } from "../java/nodeData" ;
11
12
import { Telemetry } from "../telemetry" ;
12
- import { DataNode } from "./dataNode" ;
13
13
import { ExplorerNode } from "./explorerNode" ;
14
14
import { ProjectNode } from "./projectNode" ;
15
15
import { WorkspaceNode } from "./workspaceNode" ;
@@ -24,9 +24,12 @@ export class DependencyDataProvider implements TreeDataProvider<ExplorerNode> {
24
24
private _rootItems : ExplorerNode [ ] = null ;
25
25
26
26
constructor ( public readonly context : ExtensionContext ) {
27
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_REFRESH , this . refresh , this ) ) ;
28
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_OPEN_FILE , this . openFile , this ) ) ;
29
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_OUTLINE , this . goToOutline , this ) ) ;
27
+ context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_REFRESH ,
28
+ instrumentOperation ( Commands . VIEW_PACKAGE_REFRESH , ( ) => this . refresh ( ) ) ) ) ;
29
+ context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_OPEN_FILE ,
30
+ instrumentOperation ( Commands . VIEW_PACKAGE_OPEN_FILE , ( _operationId , uri ) => this . openFile ( uri ) ) ) ) ;
31
+ context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_OUTLINE ,
32
+ instrumentOperation ( Commands . VIEW_PACKAGE_OUTLINE , ( _operationId , uri , range ) => this . goToOutline ( uri , range ) ) ) ) ;
30
33
}
31
34
32
35
public refresh ( ) {
@@ -36,14 +39,12 @@ export class DependencyDataProvider implements TreeDataProvider<ExplorerNode> {
36
39
37
40
public openFile ( uri : string ) {
38
41
return workspace . openTextDocument ( Uri . parse ( uri ) ) . then ( ( res ) => {
39
- Telemetry . sendEvent ( "open source file" ) ;
40
42
return window . showTextDocument ( res ) ;
41
43
} ) ;
42
44
}
43
45
44
46
public goToOutline ( uri : string , range : Range ) : Thenable < { } > {
45
47
return this . openFile ( uri ) . then ( ( editor ) => {
46
- Telemetry . sendEvent ( "view package outline" ) ;
47
48
editor . revealRange ( range , TextEditorRevealType . Default ) ;
48
49
editor . selection = new Selection ( range . start , range . start ) ;
49
50
return commands . executeCommand ( "workbench.action.focusActiveEditorGroup" ) ;
0 commit comments