File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ async function selectFolder(): Promise<string | undefined> {
134
134
canSelectFolders : true ,
135
135
canSelectMany : false ,
136
136
defaultUri : vscode . Uri . file ( os . homedir ( ) ) ,
137
- openLabel : 'Select'
137
+ openLabel : process . platform === 'darwin' ? 'Select Target Folder' : 'Select'
138
138
} ) ;
139
139
return selectedFolder ?. length === 1 ? selectedFolder [ 0 ] . fsPath : undefined ;
140
140
}
Original file line number Diff line number Diff line change @@ -100,9 +100,16 @@ async function select(): Promise<string | undefined> {
100
100
canSelectFolders : true ,
101
101
canSelectMany : false ,
102
102
defaultUri : vscode . Uri . file ( os . homedir ( ) ) ,
103
- openLabel : 'Select'
103
+ openLabel : process . platform !== 'darwin' ? 'Select JDK Installation' : 'Select'
104
104
} ) ;
105
- return selectedJDKUri ?. length === 1 ? selectedJDKUri [ 0 ] . fsPath : undefined ;
105
+ const jdkPath = selectedJDKUri ?. length === 1 ? selectedJDKUri [ 0 ] . fsPath : undefined ;
106
+ if ( jdkPath && process . platform === 'darwin' ) {
107
+ const jdkHomePath = path . join ( jdkPath , 'Contents' , 'Home' ) ;
108
+ if ( fs . existsSync ( jdkHomePath ) ) {
109
+ return jdkHomePath ;
110
+ }
111
+ }
112
+ return jdkPath ;
106
113
}
107
114
108
115
export function isSupportedJDK ( jdkPath : string ) : boolean {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export async function select(visualVMPath?: string) {
81
81
canSelectFolders : macOS ? false : true ,
82
82
canSelectMany : false ,
83
83
defaultUri : macOS ? vscode . Uri . file ( '/Applications' ) : savedVisualVMUri || vscode . Uri . file ( os . homedir ( ) ) ,
84
- openLabel : 'Select'
84
+ openLabel : process . platform === 'darwin' ? 'Select VisualVM Installation' : 'Select'
85
85
} ) ;
86
86
if ( selectedVisualVMUri ?. length === 1 ) {
87
87
visualVMPath = selectedVisualVMUri [ 0 ] . fsPath ;
You can’t perform that action at this time.
0 commit comments