33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import { tmpdir } from 'os' ;
76import { Disposable } from 'vs/base/common/lifecycle' ;
87import { IFileService , IFileStatWithMetadata } from 'vs/platform/files/common/files' ;
98import { IExtensionGalleryService , IGalleryExtension , InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement' ;
@@ -20,9 +19,9 @@ const ExtensionIdVersionRegex = /^([^.]+\..+)-(\d+\.\d+\.\d+)$/;
2019
2120export class ExtensionsDownloader extends Disposable {
2221
23- private readonly extensionsDownloadDir : URI = URI . file ( tmpdir ( ) ) ;
24- private readonly cache : number = 0 ;
25- private readonly cleanUpPromise : Promise < void > = Promise . resolve ( ) ;
22+ private readonly extensionsDownloadDir : URI ;
23+ private readonly cache : number ;
24+ private readonly cleanUpPromise : Promise < void > ;
2625
2726 constructor (
2827 @IEnvironmentService environmentService : INativeEnvironmentService ,
@@ -31,11 +30,9 @@ export class ExtensionsDownloader extends Disposable {
3130 @ILogService private readonly logService : ILogService ,
3231 ) {
3332 super ( ) ;
34- if ( environmentService . extensionsDownloadPath ) {
35- this . extensionsDownloadDir = URI . file ( environmentService . extensionsDownloadPath ) ;
36- this . cache = 20 ; // Cache 20 downloads
37- this . cleanUpPromise = this . cleanUp ( ) ;
38- }
33+ this . extensionsDownloadDir = URI . file ( environmentService . extensionsDownloadPath ) ;
34+ this . cache = 20 ; // Cache 20 downloads
35+ this . cleanUpPromise = this . cleanUp ( ) ;
3936 }
4037
4138 async downloadExtension ( extension : IGalleryExtension , operation : InstallOperation ) : Promise < URI > {
@@ -46,10 +43,7 @@ export class ExtensionsDownloader extends Disposable {
4643 }
4744
4845 async delete ( location : URI ) : Promise < void > {
49- // Delete immediately if caching is disabled
50- if ( ! this . cache ) {
51- await this . fileService . del ( location ) ;
52- }
46+ // noop as caching is enabled always
5347 }
5448
5549 private async download ( extension : IGalleryExtension , location : URI , operation : InstallOperation ) : Promise < void > {
0 commit comments