11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33import { commands } from "vscode" ;
4+ import * as vscode from 'vscode' ;
5+
46/**
57 * Commonly used commands
68 */
@@ -30,8 +32,6 @@ export namespace Commands {
3032
3133 export const VIEW_PACKAGE_OUTLINE = "java.view.package.outline" ;
3234
33- export const VIEW_PACKAGE_REVEAL_FILE_OS = "java.view.package.revealFileInOS" ;
34-
3535 export const VIEW_PACKAGE_COPY_FILE_PATH = "java.view.package.copyFilePath" ;
3636
3737 export const VIEW_PACKAGE_COPY_RELATIVE_FILE_PATH = "java.view.package.copyRelativeFilePath" ;
@@ -67,6 +67,8 @@ export namespace Commands {
6767 export const VIEW_PACKAGE_DELETE_FILE_PERMANENTLY = "java.view.package.deleteFilePermanently" ;
6868
6969 export const VIEW_PACKAGE_REVEAL_IN_PROJECT_EXPLORER = "java.view.package.revealInProjectExplorer" ;
70+
71+ export const VIEW_PACKAGE_REVEAL_FILE_VSCODE = 'java.view.package.revealFileInVSCode' ;
7072
7173 export const VIEW_PACKAGE_NEW_FILE = "java.view.package.newFile" ;
7274
@@ -185,5 +187,14 @@ export function executeJavaLanguageServerCommand(...rest: any[]) {
185187
186188export async function executeJavaExtensionCommand ( commandName : string , ...rest : any [ ] ) {
187189 // TODO: need to handle error and trace telemetry
188- return commands . executeCommand ( commandName , ...rest ) ;
190+ return commands . executeCommand ( commandName , ...rest ) ;
189191}
192+
193+
194+
195+ vscode . commands . registerCommand ( 'java.view.package.revealFileInVSCode' , ( uri : vscode . Uri ) => {
196+ if ( uri ) {
197+ vscode . commands . executeCommand ( 'workbench.view.explorer' ) ;
198+ vscode . commands . executeCommand ( 'revealInExplorer' , uri ) ;
199+ }
200+ } ) ;
0 commit comments