first cut of option-less open, #13807

This commit is contained in:
Johannes Rieken
2017-08-21 10:35:11 +02:00
parent d51605bed8
commit 891e6843e8
6 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { MainContext, MainThreadDiaglogsShape, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import URI from "vs/base/common/uri";
export class ExtHostDialogs {
private readonly _proxy: MainThreadDiaglogsShape;
constructor(mainContext: IMainContext) {
this._proxy = mainContext.get(MainContext.MainThreadDialogs);
}
showOpenDialog(): Thenable<URI[]> {
return this._proxy.$showOpenDialog().then(filepaths => {
if (!filepaths) {
return undefined;
}
return filepaths.map(URI.file);
});
}
}