6
6
commands , Event , EventEmitter , ExtensionContext , ProviderResult , Range ,
7
7
Selection , TextEditorRevealType , TreeDataProvider , TreeItem , Uri , window , workspace ,
8
8
} from "vscode" ;
9
- import { instrumentOperation } from "vscode-extension-telemetry-wrapper" ;
9
+ import { instrumentOperation , instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper" ;
10
10
import { Commands } from "../commands" ;
11
11
import { Jdtls } from "../java/jdtls" ;
12
12
import { INodeData , NodeKind } from "../java/nodeData" ;
@@ -28,19 +28,14 @@ export class DependencyDataProvider implements TreeDataProvider<ExplorerNode> {
28
28
29
29
constructor ( public readonly context : ExtensionContext ) {
30
30
context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_REFRESH , ( debounce ?: boolean ) => this . refreshWithLog ( debounce ) ) ) ;
31
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_REVEAL_FILE_OS ,
32
- instrumentOperation ( Commands . VIEW_PACKAGE_REVEAL_FILE_OS , ( _operationId , node : INodeData ) =>
33
- commands . executeCommand ( "revealFileInOS" , Uri . parse ( node . uri ) ) ) ) ) ;
34
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_COPY_FILE_PATH ,
35
- instrumentOperation ( Commands . VIEW_PACKAGE_COPY_FILE_PATH , ( _operationId , node : INodeData ) =>
36
- commands . executeCommand ( "copyFilePath" , Uri . parse ( node . uri ) ) ) ) ) ;
37
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_COPY_RELATIVE_FILE_PATH ,
38
- instrumentOperation ( Commands . VIEW_PACKAGE_COPY_RELATIVE_FILE_PATH , ( _operationId , node : INodeData ) =>
39
- commands . executeCommand ( "copyRelativeFilePath" , Uri . parse ( node . uri ) ) ) ) ) ;
40
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_OPEN_FILE ,
41
- instrumentOperation ( Commands . VIEW_PACKAGE_OPEN_FILE , ( _operationId , uri ) => this . openFile ( uri ) ) ) ) ;
42
- context . subscriptions . push ( commands . registerCommand ( Commands . VIEW_PACKAGE_OUTLINE ,
43
- instrumentOperation ( Commands . VIEW_PACKAGE_OUTLINE , ( _operationId , uri , range ) => this . goToOutline ( uri , range ) ) ) ) ;
31
+ context . subscriptions . push ( instrumentOperationAsVsCodeCommand ( Commands . VIEW_PACKAGE_REVEAL_FILE_OS , ( node : INodeData ) =>
32
+ commands . executeCommand ( "revealFileInOS" , Uri . parse ( node . uri ) ) ) ) ;
33
+ context . subscriptions . push ( instrumentOperationAsVsCodeCommand ( Commands . VIEW_PACKAGE_COPY_FILE_PATH , ( node : INodeData ) =>
34
+ commands . executeCommand ( "copyFilePath" , Uri . parse ( node . uri ) ) ) ) ;
35
+ context . subscriptions . push ( instrumentOperationAsVsCodeCommand ( Commands . VIEW_PACKAGE_COPY_RELATIVE_FILE_PATH , ( node : INodeData ) =>
36
+ commands . executeCommand ( "copyRelativeFilePath" , Uri . parse ( node . uri ) ) ) ) ;
37
+ context . subscriptions . push ( instrumentOperationAsVsCodeCommand ( Commands . VIEW_PACKAGE_OPEN_FILE , ( uri ) => this . openFile ( uri ) ) ) ;
38
+ context . subscriptions . push ( instrumentOperationAsVsCodeCommand ( Commands . VIEW_PACKAGE_OUTLINE , ( uri , range ) => this . goToOutline ( uri , range ) ) ) ;
44
39
Settings . registerConfigurationListener ( ( updatedConfig , oldConfig ) => {
45
40
if ( updatedConfig . refreshDelay !== oldConfig . refreshDelay ) {
46
41
this . setRefreshDelay ( updatedConfig . refreshDelay ) ;
0 commit comments