66 commands , Event , EventEmitter , ExtensionContext , ProviderResult , Range ,
77 Selection , TextEditorRevealType , TreeDataProvider , TreeItem , Uri , window , workspace ,
88} from "vscode" ;
9- import { instrumentOperation } from "vscode-extension-telemetry-wrapper" ;
9+ import { instrumentOperation , instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper" ;
1010import { Commands } from "../commands" ;
1111import { Jdtls } from "../java/jdtls" ;
1212import { INodeData , NodeKind } from "../java/nodeData" ;
@@ -28,19 +28,14 @@ export class DependencyDataProvider implements TreeDataProvider<ExplorerNode> {
2828
2929 constructor ( public readonly context : ExtensionContext ) {
3030 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 ) ) ) ;
4439 Settings . registerConfigurationListener ( ( updatedConfig , oldConfig ) => {
4540 if ( updatedConfig . refreshDelay !== oldConfig . refreshDelay ) {
4641 this . setRefreshDelay ( updatedConfig . refreshDelay ) ;
0 commit comments