Strict null work on mainThread and extHost

This commit is contained in:
Matt Bierner
2019-02-07 09:54:21 -08:00
parent ecad367bef
commit 5076c35a53
18 changed files with 111 additions and 90 deletions

View File

@@ -15,15 +15,15 @@ export class ExtHostDialogs {
this._proxy = mainContext.getProxy(MainContext.MainThreadDialogs);
}
showOpenDialog(options: vscode.OpenDialogOptions): Promise<URI[]> {
showOpenDialog(options: vscode.OpenDialogOptions): Promise<URI[] | undefined> {
return this._proxy.$showOpenDialog(options).then(filepaths => {
return filepaths && filepaths.map(URI.revive);
return filepaths ? filepaths.map(URI.revive) : undefined;
});
}
showSaveDialog(options: vscode.SaveDialogOptions): Promise<URI> {
showSaveDialog(options: vscode.SaveDialogOptions): Promise<URI | undefined> {
return this._proxy.$showSaveDialog(options).then(filepath => {
return filepath && URI.revive(filepath);
return filepath ? URI.revive(filepath) : undefined;
});
}
}