debt - make target location optional and let service decide

This commit is contained in:
Johannes Rieken
2019-03-04 11:46:34 +01:00
parent 265644d08a
commit ca0b1b38b0
4 changed files with 18 additions and 18 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { tmpdir } from 'os';
import { join } from 'vs/base/common/path';
import * as vscode from 'vscode';
import { URI } from 'vs/base/common/uri';
import { isMalformedFileUri } from 'vs/base/common/resources';
@@ -17,7 +15,6 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
import { IWindowsService } from 'vs/platform/windows/common/windows';
import { IDownloadService } from 'vs/platform/download/common/download';
import { generateUuid } from 'vs/base/common/uuid';
// -----------------------------------------------------------------
// The following commands are registered on both sides separately.
@@ -158,7 +155,5 @@ CommandsRegistry.registerCommand({
CommandsRegistry.registerCommand('_workbench.downloadResource', function (accessor: ServicesAccessor, resource: URI) {
const downloadService = accessor.get(IDownloadService);
const location = join(tmpdir(), generateUuid());
return downloadService.download(resource, location).then(() => URI.file(location));
});
return downloadService.download(resource).then(location => URI.file(location));
});