mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
first cut of option-less open, #13807
This commit is contained in:
26
src/vs/workbench/api/node/extHostDialogs.ts
Normal file
26
src/vs/workbench/api/node/extHostDialogs.ts
Normal 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user