Skip to content

Commit

Permalink
use ExtensionResourceLoaderService from vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
CompuIves committed Nov 17, 2023
1 parent b9a4f10 commit 5f37155
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
13 changes: 13 additions & 0 deletions scripts/vscode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 3 additions & 22 deletions src/missing-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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<string> {
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
Expand Down

0 comments on commit 5f37155

Please sign in to comment.