use FileDialogService with vscode APIs

This commit is contained in:
Martin Aeschlimann
2018-10-03 16:54:02 +02:00
parent 7d7c27cf3e
commit 683a76f295
6 changed files with 62 additions and 92 deletions

View File

@@ -127,8 +127,8 @@ export interface MainThreadDialogSaveOptions {
}
export interface MainThreadDiaglogsShape extends IDisposable {
$showOpenDialog(options: MainThreadDialogOpenOptions): Thenable<string[]>;
$showSaveDialog(options: MainThreadDialogSaveOptions): Thenable<string>;
$showOpenDialog(options: MainThreadDialogOpenOptions): Thenable<UriComponents[]>;
$showSaveDialog(options: MainThreadDialogSaveOptions): Thenable<UriComponents>;
}
export interface MainThreadDecorationsShape extends IDisposable {

View File

@@ -17,13 +17,13 @@ export class ExtHostDialogs {
showOpenDialog(options: vscode.OpenDialogOptions): Thenable<URI[]> {
return this._proxy.$showOpenDialog(options).then(filepaths => {
return filepaths && filepaths.map(URI.file);
return filepaths && filepaths.map(URI.revive);
});
}
showSaveDialog(options: vscode.SaveDialogOptions): Thenable<URI> {
return this._proxy.$showSaveDialog(options).then(filepath => {
return filepath && URI.file(filepath);
return filepath && URI.revive(filepath);
});
}
}