Skip to content

Commit ab57b64

Browse files
committed
GH-576 Usability improvements for macOS
1 parent 4c5f45a commit ab57b64

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

integrations/vscode/src/download.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async function selectFolder(): Promise<string | undefined> {
134134
canSelectFolders: true,
135135
canSelectMany: false,
136136
defaultUri: vscode.Uri.file(os.homedir()),
137-
openLabel: 'Select'
137+
openLabel: process.platform === 'darwin' ? 'Select Target Folder' : 'Select'
138138
});
139139
return selectedFolder?.length === 1 ? selectedFolder[0].fsPath : undefined;
140140
}

integrations/vscode/src/jdk.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,16 @@ async function select(): Promise<string | undefined> {
100100
canSelectFolders: true,
101101
canSelectMany: false,
102102
defaultUri: vscode.Uri.file(os.homedir()),
103-
openLabel: 'Select'
103+
openLabel: process.platform !== 'darwin' ? 'Select JDK Installation' : 'Select'
104104
});
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;
106113
}
107114

108115
export function isSupportedJDK(jdkPath: string): boolean {

integrations/vscode/src/visualvm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function select(visualVMPath?: string) {
8181
canSelectFolders: macOS ? false : true,
8282
canSelectMany: false,
8383
defaultUri: macOS ? vscode.Uri.file('/Applications') : savedVisualVMUri || vscode.Uri.file(os.homedir()),
84-
openLabel: 'Select'
84+
openLabel: process.platform === 'darwin' ? 'Select VisualVM Installation' : 'Select'
8585
});
8686
if (selectedVisualVMUri?.length === 1) {
8787
visualVMPath = selectedVisualVMUri[0].fsPath;

0 commit comments

Comments
 (0)