From 5f371552b6989429c91f9f769d31a7bcf47e18da Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Fri, 17 Nov 2023 16:04:44 +0100 Subject: [PATCH] use ExtensionResourceLoaderService from vscode --- scripts/vscode.patch | 13 +++++++++++++ src/missing-services.ts | 25 +++---------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/scripts/vscode.patch b/scripts/vscode.patch index 84e84def..e1e2fc4c 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -542,6 +542,19 @@ index d8cefb6df67..a94fca911ea 100644 import { IProcessEnvironment } from 'vs/base/common/platform'; import { localize } from 'vs/nls'; import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; +diff --git a/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts b/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts +index c766318f30f..58c3000cbd3 100644 +--- a/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts ++++ b/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts +@@ -14,7 +14,7 @@ import { ILogService } from 'vs/platform/log/common/log'; + import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; + import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader'; + +-class ExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { ++export class ExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { + + declare readonly _serviceBrand: undefined; + diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index e22cfe1b45e..b48c1babf86 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts diff --git a/src/missing-services.ts b/src/missing-services.ts index 750e2625..ee432838 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -79,9 +79,8 @@ import { AbstractLifecycleService } from 'vs/workbench/services/lifecycle/common import { IOutputService } from 'vs/workbench/services/output/common/output' import { OutputService } from 'vs/workbench/contrib/output/browser/outputServices' import { IOutputChannelModelService, OutputChannelModelService } from 'vs/workbench/contrib/output/common/outputChannelModelService' -import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader' -import { IStorageService } from 'vs/platform/storage/common/storage' -import { IConfigurationService } from 'vs/platform/configuration/common/configuration' +import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader' +import { ExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService' import { IHoverService } from 'vs/workbench/services/hover/browser/hover' import { IExplorerService } from 'vs/workbench/contrib/files/browser/files' import { ExtensionStorageService, IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage' @@ -1153,25 +1152,7 @@ registerSingleton(IEditorResolverService, class EditorResolverService implements registerSingleton(IOutputService, OutputService, InstantiationType.Delayed) registerSingleton(IOutputChannelModelService, OutputChannelModelService, InstantiationType.Delayed) -class SimpleExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { - // required for injection - // eslint-disable-next-line @typescript-eslint/no-useless-constructor - constructor ( - @IFileService fileService: IFileService, - @IStorageService storageService: IStorageService, - @IProductService productService: IProductService, - @IEnvironmentService environmentService: IEnvironmentService, - @IConfigurationService configurationService: IConfigurationService - ) { - super(fileService, storageService, productService, environmentService, configurationService) - } - - async readExtensionResource (uri: URI): Promise { - const result = await this._fileService.readFile(uri) - return result.value.toString() - } -} -registerSingleton(IExtensionResourceLoaderService, SimpleExtensionResourceLoaderService, InstantiationType.Eager) +registerSingleton(IExtensionResourceLoaderService, ExtensionResourceLoaderService, InstantiationType.Eager) registerSingleton(IBuiltinExtensionsScannerService, class BuiltinExtensionsScannerService implements IBuiltinExtensionsScannerService { _serviceBrand: undefined