@codingame/monaco-vscode-api 21.0.1 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/extensions.d.ts CHANGED
@@ -34,7 +34,7 @@ export interface RegisterLocalProcessExtensionResult extends RegisterLocalExtens
34
34
  setAsDefaultApi(): Promise<void>;
35
35
  }
36
36
  export declare function registerRemoteExtension(directory: string): Promise<RegisterRemoteExtensionResult>;
37
- export declare function getExtensionManifests(): IExtension[];
37
+ export declare function getBuiltinExtensions(): IExtension[];
38
38
  export declare function getForcedExtensionHostKind(id: string): ExtensionHostKind | undefined;
39
39
  export declare function registerExtension(manifest: IExtensionManifest, extHostKind: ExtensionHostKind.LocalProcess, params?: RegisterExtensionParams): RegisterLocalProcessExtensionResult;
40
40
  export declare function registerExtension(manifest: IExtensionManifest, extHostKind: ExtensionHostKind.LocalWebWorker, params?: RegisterExtensionParams): RegisterLocalExtensionResult;
package/extensions.js CHANGED
@@ -17,9 +17,10 @@ import { ExtensionManifestTranslator } from './vscode/src/vs/platform/extensionM
17
17
  import { language } from './vscode/src/vs/base/common/platform.js';
18
18
  import '@codingame/monaco-vscode-extensions-service-override';
19
19
  import { registerExtensionFile, RegisteredUriFile, CustomSchemas } from '@codingame/monaco-vscode-files-service-override';
20
- import { waitServicesReady } from './lifecycle.js';
20
+ import { waitServicesReady, servicesInitialized } from './lifecycle.js';
21
21
  import { throttle } from './tools.js';
22
22
  import { getBuiltInExtensionTranslationsUris, getLocalizationManifest } from './l10n.js';
23
+ import { toExtensionDescription } from './vscode/src/vs/workbench/services/extensions/common/extensions.js';
23
24
 
24
25
  let apiFactory;
25
26
  function registerLocalApiFactory(_apiFactory) {
@@ -50,9 +51,9 @@ async function registerRemoteExtension(directory) {
50
51
  return registerExtension(manifest, ExtensionHostKind.Remote, { path: directory });
51
52
  }
52
53
  const forcedExtensionHostKinds = new Map();
53
- const extensions = [];
54
- function getExtensionManifests() {
55
- return extensions;
54
+ const builtinExtensions = [];
55
+ function getBuiltinExtensions() {
56
+ return builtinExtensions;
56
57
  }
57
58
  function getForcedExtensionHostKind(id) {
58
59
  return forcedExtensionHostKinds.get(id);
@@ -60,48 +61,57 @@ function getForcedExtensionHostKind(id) {
60
61
  function registerExtension(manifest, extHostKind, { path = '/extension', system = false, readmePath, changelogPath } = {}) {
61
62
  const id = getExtensionId(manifest.publisher, manifest.name);
62
63
  const location = URI.from({ scheme: CustomSchemas.extensionFile, authority: id, path });
63
- const addExtensionPromise = (async () => {
64
- await waitServicesReady();
65
- const remoteAuthority = StandaloneServices.get(IWorkbenchEnvironmentService).remoteAuthority;
66
- let realLocation = location;
67
- if (extHostKind === ExtensionHostKind.Remote) {
68
- realLocation = URI.from({ scheme: Schemas.vscodeRemote, authority: remoteAuthority, path });
69
- }
70
- const instantiationService = StandaloneServices.get(IInstantiationService);
71
- const translator = instantiationService.createInstance(ExtensionManifestTranslator);
72
- const nlsConfiguration = {
73
- devMode: false,
74
- language: language,
75
- pseudo: language === 'pseudo',
76
- translations: getBuiltInExtensionTranslationsUris(language) ?? {}
77
- };
78
- const localizedManifest = await translator.translateManifest(realLocation, manifest, nlsConfiguration);
79
- const extension = {
80
- manifest: localizedManifest,
81
- type: system ? ExtensionType.System : ExtensionType.User,
82
- isBuiltin: true,
83
- identifier: { id },
84
- location: realLocation,
85
- targetPlatform: TargetPlatform.WEB,
86
- isValid: true,
87
- validations: [],
88
- extHostKind,
89
- readmeUrl: readmePath != null ? URI.joinPath(realLocation, readmePath) : undefined,
90
- changelogUrl: changelogPath != null ? URI.joinPath(realLocation, changelogPath) : undefined,
91
- preRelease: false
92
- };
93
- if (extHostKind != null) {
94
- forcedExtensionHostKinds.set(id, extHostKind);
95
- }
96
- if (extHostKind !== ExtensionHostKind.Remote) {
97
- extensions.push(extension);
98
- }
99
- const extensionEnablementService = StandaloneServices.get(IWorkbenchExtensionEnablementService);
100
- if (extensionEnablementService.isEnabled(extension)) {
101
- await deltaExtensions({ toAdd: [extension], toRemove: [] });
102
- }
103
- return extension;
104
- })();
64
+ let addExtensionPromise = waitServicesReady();
65
+ const extension = {
66
+ manifest,
67
+ type: system ? ExtensionType.System : ExtensionType.User,
68
+ isBuiltin: true,
69
+ identifier: { id },
70
+ location,
71
+ targetPlatform: TargetPlatform.WEB,
72
+ isValid: true,
73
+ validations: [],
74
+ readmeUrl: readmePath != null ? URI.joinPath(location, readmePath) : undefined,
75
+ changelogUrl: changelogPath != null ? URI.joinPath(location, changelogPath) : undefined,
76
+ preRelease: false
77
+ };
78
+ if (extHostKind != null) {
79
+ forcedExtensionHostKinds.set(id, extHostKind);
80
+ }
81
+ if (!servicesInitialized && extHostKind !== ExtensionHostKind.Remote) {
82
+ builtinExtensions.push(extension);
83
+ }
84
+ else {
85
+ addExtensionPromise = addExtensionPromise.then(async () => {
86
+ const instantiationService = StandaloneServices.get(IInstantiationService);
87
+ const extensionEnablementService = StandaloneServices.get(IWorkbenchExtensionEnablementService);
88
+ const extensionService = StandaloneServices.get(IExtensionService);
89
+ if (extensionEnablementService.isEnabled(extension) &&
90
+ extensionService.canAddExtension(toExtensionDescription(extension, false))) {
91
+ const remoteAuthority = StandaloneServices.get(IWorkbenchEnvironmentService).remoteAuthority;
92
+ let realLocation = location;
93
+ if (extHostKind === ExtensionHostKind.Remote) {
94
+ realLocation = URI.from({
95
+ scheme: Schemas.vscodeRemote,
96
+ authority: remoteAuthority,
97
+ path
98
+ });
99
+ }
100
+ const translator = instantiationService.createInstance(ExtensionManifestTranslator);
101
+ const nlsConfiguration = {
102
+ devMode: false,
103
+ language: language,
104
+ pseudo: language === 'pseudo',
105
+ translations: getBuiltInExtensionTranslationsUris(language) ?? {}
106
+ };
107
+ const localizedExtension = {
108
+ ...extension,
109
+ manifest: await translator.translateManifest(realLocation, manifest, nlsConfiguration)
110
+ };
111
+ await deltaExtensions({ toAdd: [localizedExtension], toRemove: [] });
112
+ }
113
+ });
114
+ }
105
115
  let api = {
106
116
  id,
107
117
  async whenReady() {
@@ -110,14 +120,14 @@ function registerExtension(manifest, extHostKind, { path = '/extension', system
110
120
  async isEnabled() {
111
121
  await waitServicesReady();
112
122
  const extensionEnablementService = StandaloneServices.get(IWorkbenchExtensionEnablementService);
113
- const extension = await addExtensionPromise;
123
+ await addExtensionPromise;
114
124
  return extensionEnablementService.isEnabled(extension);
115
125
  },
116
126
  async dispose() {
117
- const extension = await addExtensionPromise;
118
- const index = extensions.indexOf(extension);
127
+ await addExtensionPromise;
128
+ const index = builtinExtensions.indexOf(extension);
119
129
  if (index >= 0) {
120
- extensions.splice(extensions.indexOf(extension), 1);
130
+ builtinExtensions.splice(builtinExtensions.indexOf(extension), 1);
121
131
  }
122
132
  forcedExtensionHostKinds.delete(id);
123
133
  await deltaExtensions({ toAdd: [], toRemove: [extension] });
@@ -155,4 +165,4 @@ if (localizationManifest != null) {
155
165
  registerExtension(localizationManifest, ExtensionHostKind.LocalWebWorker, { system: true });
156
166
  }
157
167
 
158
- export { ExtensionHostKind, getExtensionManifests, getForcedExtensionHostKind, registerDefaultApiHandler, registerExtension, registerLocalApiFactory, registerRemoteExtension };
168
+ export { ExtensionHostKind, getBuiltinExtensions, getForcedExtensionHostKind, registerDefaultApiHandler, registerExtension, registerLocalApiFactory, registerRemoteExtension };
package/lifecycle.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare function registerServiceInitializePreParticipant(participant: Ser
12
12
  export declare function registerServiceInitializeParticipant(participant: ServiceInitializeParticipant): void;
13
13
  export declare function registerServiceInitializePostParticipant(participant: ServiceInitializeParticipant): void;
14
14
  export declare function startup(instantiationService: IInstantiationService): Promise<void>;
15
+ export declare let servicesInitialized: boolean;
15
16
  export declare function waitServicesReady(): Promise<void>;
16
17
  export declare function checkServicesReady(): void;
17
18
  export declare function checkServicesNotInitialized(): void;
package/lifecycle.js CHANGED
@@ -90,4 +90,4 @@ function checkServicesNotInitialized() {
90
90
  }
91
91
  }
92
92
 
93
- export { checkServicesNotInitialized, checkServicesReady, onLayout, onRenderWorkbench, registerServiceInitializeParticipant, registerServiceInitializePostParticipant, registerServiceInitializePreParticipant, serviceInitializedBarrier, serviceInitializedEmitter, startup, waitServicesReady };
93
+ export { checkServicesNotInitialized, checkServicesReady, onLayout, onRenderWorkbench, registerServiceInitializeParticipant, registerServiceInitializePostParticipant, registerServiceInitializePreParticipant, serviceInitializedBarrier, serviceInitializedEmitter, servicesInitialized, startup, waitServicesReady };
@@ -2421,9 +2421,9 @@ registerSingleton(IWebExtensionsScannerService, WebExtensionsScannerService, Ins
2421
2421
  class ExtensionsScannerService {
2422
2422
  constructor() {
2423
2423
  this.onDidChangeCache = Event.None;
2424
- this.scanAllExtensions = unsupported;
2425
- this.scanSystemExtensions = unsupported;
2426
- this.scanUserExtensions = unsupported;
2424
+ this.scanAllExtensions = async () => [];
2425
+ this.scanSystemExtensions = async () => [];
2426
+ this.scanUserExtensions = async () => [];
2427
2427
  this.scanExtensionsUnderDevelopment = unsupported;
2428
2428
  this.scanExistingExtension = unsupported;
2429
2429
  this.scanOneOrMultipleExtensions = unsupported;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "21.0.1",
3
+ "version": "21.1.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor",
6
6
  "keywords": [],
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-base-service-override": "21.0.1",
19
- "@codingame/monaco-vscode-environment-service-override": "21.0.1",
20
- "@codingame/monaco-vscode-extensions-service-override": "21.0.1",
21
- "@codingame/monaco-vscode-files-service-override": "21.0.1",
22
- "@codingame/monaco-vscode-host-service-override": "21.0.1",
23
- "@codingame/monaco-vscode-layout-service-override": "21.0.1",
24
- "@codingame/monaco-vscode-quickaccess-service-override": "21.0.1",
18
+ "@codingame/monaco-vscode-base-service-override": "21.1.0",
19
+ "@codingame/monaco-vscode-environment-service-override": "21.1.0",
20
+ "@codingame/monaco-vscode-extensions-service-override": "21.1.0",
21
+ "@codingame/monaco-vscode-files-service-override": "21.1.0",
22
+ "@codingame/monaco-vscode-host-service-override": "21.1.0",
23
+ "@codingame/monaco-vscode-layout-service-override": "21.1.0",
24
+ "@codingame/monaco-vscode-quickaccess-service-override": "21.1.0",
25
25
  "@vscode/iconv-lite-umd": "0.7.0",
26
26
  "dompurify": "3.2.6",
27
27
  "jschardet": "3.1.4",
package/services.d.ts CHANGED
@@ -5,7 +5,7 @@ import { type IEditorOverrideServices } from "./vscode/src/vs/editor/standalone/
5
5
  import { type GetLeadingNonServiceArgs, type ServiceIdentifier, type ServicesAccessor } from "./vscode/src/vs/platform/instantiation/common/instantiation.js";
6
6
  import type { IAction } from "./vscode/src/vs/base/common/actions.js";
7
7
  import { type IDisposable } from "./vscode/src/vs/base/common/lifecycle.js";
8
- import type { IWorkbenchConstructionOptions, IWorkspaceProvider } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/browser/web.api";
8
+ import type { IWorkbenchConstructionOptions, IWorkspaceProvider } from "./vscode/src/vs/workbench/browser/web.api.js";
9
9
  import { type ILazyWorkbenchContributionInstantiation, type IOnEditorWorkbenchContributionInstantiation, type WorkbenchContributionInstantiation, WorkbenchPhase } from "./vscode/src/vs/workbench/common/contributions.js";
10
10
  import { IProductService } from "./vscode/src/vs/platform/product/common/productService.service.js";
11
11
  import type { IConfigurationChangeEvent } from "./vscode/src/vs/platform/configuration/common/configuration.js";
package/services.js CHANGED
@@ -110,6 +110,10 @@ import getServiceOverride from '@codingame/monaco-vscode-base-service-override';
110
110
  import { injectCss } from './css.js';
111
111
  import product from './vscode/src/vs/platform/product/common/product.js';
112
112
  import { mixin } from './vscode/src/vs/base/common/objects.js';
113
+ import { CommandsRegistry } from './vscode/src/vs/platform/commands/common/commands.js';
114
+ import { asArray } from './vscode/src/vs/base/common/arrays.js';
115
+ import { MenuId, MenuRegistry } from './vscode/src/vs/platform/actions/common/actions.js';
116
+ import { Menu } from './vscode/src/vs/workbench/browser/web.api.js';
113
117
  export { SyncDescriptor } from './vscode/src/vs/platform/instantiation/common/descriptors.js';
114
118
  export { ICommandService } from './vscode/src/vs/platform/commands/common/commands.service.js';
115
119
  export { INotificationService } from './vscode/src/vs/platform/notification/common/notification.service.js';
@@ -396,13 +400,38 @@ export { IInlineCompletionsUnificationService } from './vscode/src/vs/workbench/
396
400
  export { IMcpGalleryManifestService } from './vscode/src/vs/platform/mcp/common/mcpGalleryManifest.service.js';
397
401
  export { IDataChannelService } from './vscode/src/vs/platform/dataChannel/common/dataChannel.service.js';
398
402
 
399
- if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.104.0-eda71d57-3503-4259-a8db-a8d5c3ea0616") {
400
- throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.104.0-eda71d57-3503-4259-a8db-a8d5c3ea0616"}, ${window.monacoVscodeApiBuildId} is already loaded`);
403
+ if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.104.1-4041d22a-c761-43a4-b9ac-d9828e3218da") {
404
+ throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.104.1-4041d22a-c761-43a4-b9ac-d9828e3218da"}, ${window.monacoVscodeApiBuildId} is already loaded`);
405
+ }
406
+ window.monacoVscodeApiBuildId = "1.104.1-4041d22a-c761-43a4-b9ac-d9828e3218da";
407
+ function registerCommands(options) {
408
+ function asMenuId(menu) {
409
+ switch (menu) {
410
+ case Menu.CommandPalette:
411
+ return MenuId.CommandPalette;
412
+ case Menu.StatusBarWindowIndicatorMenu:
413
+ return MenuId.StatusBarWindowIndicatorMenu;
414
+ }
415
+ }
416
+ if (Array.isArray(options.commands)) {
417
+ for (const command of options.commands) {
418
+ CommandsRegistry.registerCommand(command.id, (accessor, ...args) => {
419
+ return command.handler(...args);
420
+ });
421
+ if (command.label) {
422
+ for (const menu of asArray(command.menu ?? Menu.CommandPalette)) {
423
+ MenuRegistry.appendMenuItem(asMenuId(menu), {
424
+ command: { id: command.id, title: command.label }
425
+ });
426
+ }
427
+ }
428
+ }
429
+ }
401
430
  }
402
- window.monacoVscodeApiBuildId = "1.104.0-eda71d57-3503-4259-a8db-a8d5c3ea0616";
403
431
  async function initialize(overrides, container = document.body, configuration = {}, env) {
404
432
  checkServicesNotInitialized();
405
433
  injectCss(container);
434
+ registerCommands(configuration);
406
435
  initialize$1(container, configuration, env);
407
436
  const productService = mixin({ _serviceBrand: undefined, ...product }, configuration.productConfiguration);
408
437
  const instantiationService = StandaloneServices.initialize({
@@ -13,6 +13,7 @@ import { IExtensionsProfileScannerService } from "./extensionsProfileScannerServ
13
13
  import { IUserDataProfile } from "../../userDataProfile/common/userDataProfile.js";
14
14
  import { IUserDataProfilesService } from "../../userDataProfile/common/userDataProfile.service.js";
15
15
  import { IUriIdentityService } from "../../uriIdentity/common/uriIdentity.service.js";
16
+ import { IExtensionResourceLoaderService } from "../../extensionResourceLoader/common/extensionResourceLoader.service.js";
16
17
  import { IExtensionsScannerService } from "./extensionsScannerService.service.js";
17
18
  export type ManifestMetadata = Partial<{
18
19
  targetPlatform: TargetPlatform;
@@ -68,6 +69,7 @@ export declare abstract class AbstractExtensionsScannerService extends Disposabl
68
69
  private readonly extensionsControlLocation;
69
70
  private readonly userDataProfilesService;
70
71
  protected readonly extensionsProfileScannerService: IExtensionsProfileScannerService;
72
+ protected readonly extensionResourceLoaderService: IExtensionResourceLoaderService;
71
73
  protected readonly fileService: IFileService;
72
74
  protected readonly logService: ILogService;
73
75
  private readonly environmentService;
@@ -81,7 +83,7 @@ export declare abstract class AbstractExtensionsScannerService extends Disposabl
81
83
  private readonly systemExtensionsCachedScanner;
82
84
  private readonly userExtensionsCachedScanner;
83
85
  private readonly extensionsScanner;
84
- constructor(systemExtensionsLocation: URI, userExtensionsLocation: URI, extensionsControlLocation: URI, currentProfile: IUserDataProfile, userDataProfilesService: IUserDataProfilesService, extensionsProfileScannerService: IExtensionsProfileScannerService, fileService: IFileService, logService: ILogService, environmentService: IEnvironmentService, productService: IProductService, uriIdentityService: IUriIdentityService, instantiationService: IInstantiationService);
86
+ constructor(systemExtensionsLocation: URI, userExtensionsLocation: URI, extensionsControlLocation: URI, currentProfile: IUserDataProfile, userDataProfilesService: IUserDataProfilesService, extensionsProfileScannerService: IExtensionsProfileScannerService, extensionResourceLoaderService: IExtensionResourceLoaderService, fileService: IFileService, logService: ILogService, environmentService: IEnvironmentService, productService: IProductService, uriIdentityService: IUriIdentityService, instantiationService: IInstantiationService);
85
87
  private _targetPlatformPromise;
86
88
  private getTargetPlatform;
87
89
  scanAllExtensions(systemScanOptions: SystemExtensionsScanOptions, userScanOptions: UserExtensionsScanOptions): Promise<IScannedExtension[]>;
@@ -134,9 +136,10 @@ export type NlsConfiguration = {
134
136
  translations: Translations;
135
137
  };
136
138
  export declare class ExtensionManifestTranslator extends Disposable {
139
+ protected readonly extensionResourceLoaderService: IExtensionResourceLoaderService;
137
140
  protected readonly fileService: IFileService;
138
141
  protected readonly logService: ILogService;
139
- constructor(fileService: IFileService, logService: ILogService);
142
+ constructor(extensionResourceLoaderService: IExtensionResourceLoaderService, fileService: IFileService, logService: ILogService);
140
143
  private getLocalizedMessages;
141
144
  translateManifest(extensionLocation: URI, extensionManifest: IExtensionManifest, nlsConfiguration: NlsConfiguration): Promise<IExtensionManifest>;
142
145
  /**
@@ -153,7 +156,7 @@ export declare class ExtensionManifestTranslator extends Disposable {
153
156
  export declare function toExtensionDescription(extension: IScannedExtension, isUnderDevelopment: boolean): IExtensionDescription;
154
157
  export declare class NativeExtensionsScannerService extends AbstractExtensionsScannerService implements IExtensionsScannerService {
155
158
  private readonly translationsPromise;
156
- constructor(systemExtensionsLocation: URI, userExtensionsLocation: URI, userHome: URI, currentProfile: IUserDataProfile, userDataProfilesService: IUserDataProfilesService, extensionsProfileScannerService: IExtensionsProfileScannerService, fileService: IFileService, logService: ILogService, environmentService: IEnvironmentService, productService: IProductService, uriIdentityService: IUriIdentityService, instantiationService: IInstantiationService);
159
+ constructor(systemExtensionsLocation: URI, userExtensionsLocation: URI, userHome: URI, currentProfile: IUserDataProfile, userDataProfilesService: IUserDataProfilesService, extensionsProfileScannerService: IExtensionsProfileScannerService, extensionResourceLoaderService: IExtensionResourceLoaderService, fileService: IFileService, logService: ILogService, environmentService: IEnvironmentService, productService: IProductService, uriIdentityService: IUriIdentityService, instantiationService: IInstantiationService);
157
160
  protected getTranslations(language: string): Promise<Translations>;
158
161
  }
159
162
  export {};
@@ -32,6 +32,7 @@ import { IExtensionsProfileScannerService } from './extensionsProfileScannerServ
32
32
  import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.service.js';
33
33
  import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.service.js';
34
34
  import { localizeManifest } from './extensionNls.js';
35
+ import { IExtensionResourceLoaderService } from '../../extensionResourceLoader/common/extensionResourceLoader.service.js';
35
36
 
36
37
  var Translations;
37
38
  (function (Translations) {
@@ -58,13 +59,14 @@ var Translations;
58
59
  Translations.equals = equals;
59
60
  })(Translations || (Translations = {}));
60
61
  let AbstractExtensionsScannerService = class AbstractExtensionsScannerService extends Disposable {
61
- constructor(systemExtensionsLocation, userExtensionsLocation, extensionsControlLocation, currentProfile, userDataProfilesService, extensionsProfileScannerService, fileService, logService, environmentService, productService, uriIdentityService, instantiationService) {
62
+ constructor(systemExtensionsLocation, userExtensionsLocation, extensionsControlLocation, currentProfile, userDataProfilesService, extensionsProfileScannerService, extensionResourceLoaderService, fileService, logService, environmentService, productService, uriIdentityService, instantiationService) {
62
63
  super();
63
64
  this.systemExtensionsLocation = systemExtensionsLocation;
64
65
  this.userExtensionsLocation = userExtensionsLocation;
65
66
  this.extensionsControlLocation = extensionsControlLocation;
66
67
  this.userDataProfilesService = userDataProfilesService;
67
68
  this.extensionsProfileScannerService = extensionsProfileScannerService;
69
+ this.extensionResourceLoaderService = extensionResourceLoaderService;
68
70
  this.fileService = fileService;
69
71
  this.logService = logService;
70
72
  this.environmentService = environmentService;
@@ -169,7 +171,7 @@ let AbstractExtensionsScannerService = class AbstractExtensionsScannerService ex
169
171
  }
170
172
  async updateManifestMetadata(extensionLocation, metaData) {
171
173
  const manifestLocation = joinPath(extensionLocation, 'package.json');
172
- const content = ( (await this.fileService.readFile(manifestLocation)).value.toString());
174
+ const content = await this.extensionResourceLoaderService.readExtensionResource(manifestLocation);
173
175
  const manifest = JSON.parse(content);
174
176
  manifest.__metadata = { ...manifest.__metadata, ...metaData };
175
177
  await this.fileService.writeFile(joinPath(extensionLocation, 'package.json'), VSBuffer.fromString(JSON.stringify(manifest, null, '\t')));
@@ -388,12 +390,13 @@ let AbstractExtensionsScannerService = class AbstractExtensionsScannerService ex
388
390
  AbstractExtensionsScannerService = ( __decorate([
389
391
  ( __param(4, IUserDataProfilesService)),
390
392
  ( __param(5, IExtensionsProfileScannerService)),
391
- ( __param(6, IFileService)),
392
- ( __param(7, ILogService)),
393
- ( __param(8, IEnvironmentService)),
394
- ( __param(9, IProductService)),
395
- ( __param(10, IUriIdentityService)),
396
- ( __param(11, IInstantiationService))
393
+ ( __param(6, IExtensionResourceLoaderService)),
394
+ ( __param(7, IFileService)),
395
+ ( __param(8, ILogService)),
396
+ ( __param(9, IEnvironmentService)),
397
+ ( __param(10, IProductService)),
398
+ ( __param(11, IUriIdentityService)),
399
+ ( __param(12, IInstantiationService))
397
400
  ], AbstractExtensionsScannerService));
398
401
  class ExtensionScannerInput {
399
402
  constructor(location, mtime, applicationExtensionslocation, applicationExtensionslocationMtime, profile, profileScanOptions, type, validate, productVersion, productDate, productCommit, devMode, language, translations) {
@@ -438,8 +441,9 @@ class ExtensionScannerInput {
438
441
  }
439
442
  }
440
443
  let ExtensionManifestTranslator = class ExtensionManifestTranslator extends Disposable {
441
- constructor(fileService, logService) {
444
+ constructor(extensionResourceLoaderService, fileService, logService) {
442
445
  super();
446
+ this.extensionResourceLoaderService = extensionResourceLoaderService;
443
447
  this.fileService = fileService;
444
448
  this.logService = logService;
445
449
  }
@@ -463,7 +467,7 @@ let ExtensionManifestTranslator = class ExtensionManifestTranslator extends Disp
463
467
  if (translationPath) {
464
468
  try {
465
469
  const translationResource = ( URI.parse(translationPath));
466
- const content = ( (await this.fileService.readFile(translationResource)).value.toString());
470
+ const content = await this.extensionResourceLoaderService.readExtensionResource(translationResource);
467
471
  const errors = [];
468
472
  const translationBundle = parse(content, errors);
469
473
  if (errors.length > 0) {
@@ -499,7 +503,7 @@ let ExtensionManifestTranslator = class ExtensionManifestTranslator extends Disp
499
503
  return { values: undefined, default: messageBundle.original };
500
504
  }
501
505
  try {
502
- const messageBundleContent = ( (await this.fileService.readFile(messageBundle.localized)).value.toString());
506
+ const messageBundleContent = (await this.extensionResourceLoaderService.readExtensionResource(messageBundle.localized));
503
507
  const errors = [];
504
508
  const messages = parse(messageBundleContent, errors);
505
509
  if (errors.length > 0) {
@@ -553,7 +557,7 @@ let ExtensionManifestTranslator = class ExtensionManifestTranslator extends Disp
553
557
  async resolveOriginalMessageBundle(originalMessageBundle, errors) {
554
558
  if (originalMessageBundle) {
555
559
  try {
556
- const originalBundleContent = ( (await this.fileService.readFile(originalMessageBundle)).value.toString());
560
+ const originalBundleContent = await this.extensionResourceLoaderService.readExtensionResource(originalMessageBundle);
557
561
  return parse(originalBundleContent, errors);
558
562
  }
559
563
  catch (error) {
@@ -590,12 +594,13 @@ let ExtensionManifestTranslator = class ExtensionManifestTranslator extends Disp
590
594
  }
591
595
  };
592
596
  ExtensionManifestTranslator = ( __decorate([
593
- ( __param(0, IFileService)),
594
- ( __param(1, ILogService))
597
+ ( __param(0, IExtensionResourceLoaderService)),
598
+ ( __param(1, IFileService)),
599
+ ( __param(2, ILogService))
595
600
  ], ExtensionManifestTranslator));
596
601
  let ExtensionsScanner = class ExtensionsScanner extends ExtensionManifestTranslator {
597
- constructor(extensionsProfileScannerService, uriIdentityService, fileService, productService, environmentService, logService) {
598
- super(fileService, logService);
602
+ constructor(extensionsProfileScannerService, uriIdentityService, extensionResourceLoaderService, fileService, productService, environmentService, logService) {
603
+ super(extensionResourceLoaderService, fileService, logService);
599
604
  this.extensionsProfileScannerService = extensionsProfileScannerService;
600
605
  this.uriIdentityService = uriIdentityService;
601
606
  this.environmentService = environmentService;
@@ -786,7 +791,7 @@ let ExtensionsScanner = class ExtensionsScanner extends ExtensionManifestTransla
786
791
  const manifestLocation = joinPath(extensionLocation, 'package.json');
787
792
  let content;
788
793
  try {
789
- content = ( (await this.fileService.readFile(manifestLocation)).value.toString());
794
+ content = await this.extensionResourceLoaderService.readExtensionResource(manifestLocation);
790
795
  }
791
796
  catch (error) {
792
797
  if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
@@ -828,14 +833,15 @@ let ExtensionsScanner = class ExtensionsScanner extends ExtensionManifestTransla
828
833
  ExtensionsScanner = ( __decorate([
829
834
  ( __param(0, IExtensionsProfileScannerService)),
830
835
  ( __param(1, IUriIdentityService)),
831
- ( __param(2, IFileService)),
832
- ( __param(3, IProductService)),
833
- ( __param(4, IEnvironmentService)),
834
- ( __param(5, ILogService))
836
+ ( __param(2, IExtensionResourceLoaderService)),
837
+ ( __param(3, IFileService)),
838
+ ( __param(4, IProductService)),
839
+ ( __param(5, IEnvironmentService)),
840
+ ( __param(6, ILogService))
835
841
  ], ExtensionsScanner));
836
842
  let CachedExtensionsScanner = class CachedExtensionsScanner extends ExtensionsScanner {
837
- constructor(currentProfile, userDataProfilesService, extensionsProfileScannerService, uriIdentityService, fileService, productService, environmentService, logService) {
838
- super(extensionsProfileScannerService, uriIdentityService, fileService, productService, environmentService, logService);
843
+ constructor(currentProfile, userDataProfilesService, extensionsProfileScannerService, uriIdentityService, extensionResourceLoaderService, fileService, productService, environmentService, logService) {
844
+ super(extensionsProfileScannerService, uriIdentityService, extensionResourceLoaderService, fileService, productService, environmentService, logService);
839
845
  this.currentProfile = currentProfile;
840
846
  this.userDataProfilesService = userDataProfilesService;
841
847
  this.cacheValidatorThrottler = this._register(( new ThrottledDelayer(3000)));
@@ -921,10 +927,11 @@ CachedExtensionsScanner = ( __decorate([
921
927
  ( __param(1, IUserDataProfilesService)),
922
928
  ( __param(2, IExtensionsProfileScannerService)),
923
929
  ( __param(3, IUriIdentityService)),
924
- ( __param(4, IFileService)),
925
- ( __param(5, IProductService)),
926
- ( __param(6, IEnvironmentService)),
927
- ( __param(7, ILogService))
930
+ ( __param(4, IExtensionResourceLoaderService)),
931
+ ( __param(5, IFileService)),
932
+ ( __param(6, IProductService)),
933
+ ( __param(7, IEnvironmentService)),
934
+ ( __param(8, ILogService))
928
935
  ], CachedExtensionsScanner));
929
936
 
930
937
  export { AbstractExtensionsScannerService, ExtensionManifestTranslator, ExtensionScannerInput, Translations };
@@ -4,9 +4,9 @@ import productJson from '../../../../../product.json.js';
4
4
  var product = {
5
5
  ...productJson,
6
6
  quality: 'stable',
7
- version: '1.104.0',
8
- commit: 'f220831ea2d946c0dcb0f3eaa480eb435a2c1260',
9
- date: '2025-09-15T13:51:06.751Z',
7
+ version: '1.104.1',
8
+ commit: '0f0d87fa9e96c856c5212fc86db137ac0d783365',
9
+ date: '2025-09-18T12:47:17.796Z',
10
10
  ...(globalThis._VSCODE_PRODUCT_JSON ?? {})
11
11
  };
12
12
 
@@ -188,6 +188,7 @@ export interface AuthenticationConstraint {
188
188
  export interface MainThreadAuthenticationShape extends IDisposable {
189
189
  $registerAuthenticationProvider(id: string, label: string, supportsMultipleAccounts: boolean, supportedAuthorizationServers?: UriComponents[], supportsChallenges?: boolean): Promise<void>;
190
190
  $unregisterAuthenticationProvider(id: string): Promise<void>;
191
+ $ensureProvider(id: string): Promise<void>;
191
192
  $sendDidChangeSessions(providerId: string, event: AuthenticationSessionsChangeEvent): Promise<void>;
192
193
  $getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | AuthenticationWWWAuthenticateRequest, extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise<AuthenticationSession | undefined>;
193
194
  $getAccounts(providerId: string): Promise<ReadonlyArray<AuthenticationSessionAccount>>;
@@ -73,11 +73,13 @@ let ExtHostAuthentication = class ExtHostAuthentication {
73
73
  singlerKey = `${extensionId} ${providerId} ${sortedScopes} ${optionsStr}`;
74
74
  }
75
75
  return await this._getSessionTaskSingler.getOrCreate(singlerKey, async () => {
76
+ await this._proxy.$ensureProvider(providerId);
76
77
  const extensionName = requestingExtension.displayName || requestingExtension.name;
77
78
  return this._proxy.$getSession(providerId, scopesOrRequest, extensionId, extensionName, options);
78
79
  });
79
80
  }
80
81
  async getAccounts(providerId) {
82
+ await this._proxy.$ensureProvider(providerId);
81
83
  return await this._proxy.$getAccounts(providerId);
82
84
  }
83
85
  registerAuthenticationProvider(id, label, provider, options) {
@@ -0,0 +1,674 @@
1
+ import type { PerformanceMark } from "../../base/common/performance.js";
2
+ import type { UriComponents, URI } from "../../base/common/uri.js";
3
+ import type { IWebSocketFactory } from "@codingame/monaco-vscode-remote-agent-service-override/vscode/vs/platform/remote/browser/browserSocketFactory";
4
+ import type { IURLCallbackProvider } from "@codingame/monaco-vscode-base-service-override/vscode/vs/workbench/services/url/browser/urlService";
5
+ import type { LogLevel } from "../../platform/log/common/log.js";
6
+ import type { IUpdateProvider } from "@codingame/monaco-vscode-update-service-override/vscode/vs/workbench/services/update/browser/updateService";
7
+ import type { Event } from "../../base/common/event.js";
8
+ import type { IProductConfiguration } from "../../base/common/product.js";
9
+ import type { ISecretStorageProvider } from "@codingame/monaco-vscode-secret-storage-service-override/vscode/vs/platform/secrets/common/secrets";
10
+ import type { TunnelProviderFeatures } from "../../platform/tunnel/common/tunnel.js";
11
+ import type { IProgress, IProgressCompositeOptions, IProgressDialogOptions, IProgressNotificationOptions, IProgressOptions, IProgressStep, IProgressWindowOptions } from "../../platform/progress/common/progress.js";
12
+ import type { ITextEditorOptions } from "../../platform/editor/common/editor.js";
13
+ import type { IFolderToOpen, IWorkspaceToOpen } from "../../platform/window/common/window.js";
14
+ import type { EditorGroupLayout } from "../services/editor/common/editorGroupsService.js";
15
+ import type { IEmbedderTerminalOptions } from "@codingame/monaco-vscode-terminal-service-override/vscode/vs/workbench/services/terminal/common/embedderTerminalService";
16
+ import type { IAuthenticationProvider } from "../services/authentication/common/authentication.js";
17
+ /**
18
+ * The `IWorkbench` interface is the API facade for web embedders
19
+ * to call into the workbench.
20
+ *
21
+ * Note: Changes to this interface need to be announced and adopted.
22
+ */
23
+ export interface IWorkbench {
24
+ commands: {
25
+ /**
26
+ * Allows to execute any command if known with the provided arguments.
27
+ *
28
+ * @param command Identifier of the command to execute.
29
+ * @param rest Parameters passed to the command function.
30
+ * @return A promise that resolves to the returned value of the given command.
31
+ */
32
+ executeCommand(command: string, ...args: any[]): Promise<unknown>;
33
+ };
34
+ logger: {
35
+ /**
36
+ * Logging for embedder.
37
+ *
38
+ * @param level The log level of the message to be printed.
39
+ * @param message Message to be printed.
40
+ */
41
+ log(level: LogLevel, message: string): void;
42
+ };
43
+ env: {
44
+ /**
45
+ * @returns the scheme to use for opening the associated desktop
46
+ * experience via protocol handler.
47
+ */
48
+ getUriScheme(): Promise<string>;
49
+ /**
50
+ * Retrieve performance marks that have been collected during startup. This function
51
+ * returns tuples of source and marks. A source is a dedicated context, like
52
+ * the renderer or an extension host.
53
+ *
54
+ * *Note* that marks can be collected on different machines and in different processes
55
+ * and that therefore "different clocks" are used. So, comparing `startTime`-properties
56
+ * across contexts should be taken with a grain of salt.
57
+ *
58
+ * @returns A promise that resolves to tuples of source and marks.
59
+ */
60
+ retrievePerformanceMarks(): Promise<[
61
+ string,
62
+ readonly PerformanceMark[]
63
+ ][]>;
64
+ /**
65
+ * Allows to open a target Uri with the standard opener service of the
66
+ * workbench.
67
+ */
68
+ openUri(target: URI | UriComponents): Promise<boolean>;
69
+ };
70
+ window: {
71
+ /**
72
+ * Show progress in the editor. Progress is shown while running the given callback
73
+ * and while the promise it returned isn't resolved nor rejected.
74
+ *
75
+ * @param task A callback returning a promise.
76
+ * @return A promise that resolves to the returned value of the given task result.
77
+ */
78
+ withProgress<R>(options: IProgressOptions | IProgressDialogOptions | IProgressNotificationOptions | IProgressWindowOptions | IProgressCompositeOptions, task: (progress: IProgress<IProgressStep>) => Promise<R>): Promise<R>;
79
+ /**
80
+ * Creates a terminal with limited capabilities that is intended for
81
+ * writing output from the embedder before the workbench has finished
82
+ * loading. When an embedder terminal is created it will automatically
83
+ * show to the user.
84
+ *
85
+ * @param options The definition of the terminal, this is similar to
86
+ * `ExtensionTerminalOptions` in the extension API.
87
+ */
88
+ createTerminal(options: IEmbedderTerminalOptions): Promise<void>;
89
+ /**
90
+ * Show an information message to users. Optionally provide an array of items which will be presented as
91
+ * clickable buttons.
92
+ *
93
+ * @param message The message to show.
94
+ * @param items A set of items that will be rendered as actions in the message.
95
+ * @returns A thenable that resolves to the selected item or `undefined` when being dismissed.
96
+ */
97
+ showInformationMessage<T extends string>(message: string, ...items: T[]): Promise<T | undefined>;
98
+ };
99
+ workspace: {
100
+ /**
101
+ * Resolves once the remote authority has been resolved.
102
+ */
103
+ didResolveRemoteAuthority(): Promise<void>;
104
+ /**
105
+ * Forwards a port. If the current embedder implements a tunnelFactory then that will be used to make the tunnel.
106
+ * By default, openTunnel only support localhost; however, a tunnelFactory can be used to support other ips.
107
+ *
108
+ * @throws When run in an environment without a remote.
109
+ *
110
+ * @param tunnelOptions The `localPort` is a suggestion only. If that port is not available another will be chosen.
111
+ */
112
+ openTunnel(tunnelOptions: ITunnelOptions): Promise<ITunnel>;
113
+ };
114
+ /**
115
+ * Triggers shutdown of the workbench programmatically. After this method is
116
+ * called, the workbench is not usable anymore and the page needs to reload
117
+ * or closed.
118
+ *
119
+ * This will also remove any `beforeUnload` handlers that would bring up a
120
+ * confirmation dialog.
121
+ *
122
+ * The returned promise should be awaited on to ensure any data to persist
123
+ * has been persisted.
124
+ */
125
+ shutdown: () => Promise<void>;
126
+ }
127
+ export interface IWorkbenchConstructionOptions {
128
+ /**
129
+ * The remote authority is the IP:PORT from where the workbench is served
130
+ * from. It is for example being used for the websocket connections as address.
131
+ */
132
+ readonly remoteAuthority?: string;
133
+ /**
134
+ * The server base path is the path where the workbench is served from.
135
+ * The path must be absolute (start with a slash).
136
+ * Corresponds to option `server-base-path` on the server side.
137
+ */
138
+ readonly serverBasePath?: string;
139
+ /**
140
+ * The connection token to send to the server.
141
+ */
142
+ readonly connectionToken?: string | Promise<string>;
143
+ /**
144
+ * An endpoint to serve iframe content ("webview") from. This is required
145
+ * to provide full security isolation from the workbench host.
146
+ */
147
+ readonly webviewEndpoint?: string;
148
+ /**
149
+ * A factory for web sockets.
150
+ */
151
+ readonly webSocketFactory?: IWebSocketFactory;
152
+ /**
153
+ * A provider for resource URIs.
154
+ *
155
+ * *Note*: This will only be invoked after the `connectionToken` is resolved.
156
+ */
157
+ readonly resourceUriProvider?: IResourceUriProvider;
158
+ /**
159
+ * Resolves an external uri before it is opened.
160
+ */
161
+ readonly resolveExternalUri?: IExternalUriResolver;
162
+ /**
163
+ * A provider for supplying tunneling functionality,
164
+ * such as creating tunnels and showing candidate ports to forward.
165
+ */
166
+ readonly tunnelProvider?: ITunnelProvider;
167
+ /**
168
+ * Endpoints to be used for proxying authentication code exchange calls in the browser.
169
+ */
170
+ readonly codeExchangeProxyEndpoints?: {
171
+ [providerId: string]: string;
172
+ };
173
+ /**
174
+ * The identifier of an edit session associated with the current workspace.
175
+ */
176
+ readonly editSessionId?: string;
177
+ /**
178
+ * Resource delegation handler that allows for loading of resources when
179
+ * using remote resolvers.
180
+ *
181
+ * This is exclusive with {@link resourceUriProvider}. `resourceUriProvider`
182
+ * should be used if a {@link webSocketFactory} is used, and will be preferred.
183
+ */
184
+ readonly remoteResourceProvider?: IRemoteResourceProvider;
185
+ /**
186
+ * A handler for opening workspaces and providing the initial workspace.
187
+ */
188
+ readonly workspaceProvider?: IWorkspaceProvider;
189
+ /**
190
+ * Settings sync options
191
+ */
192
+ readonly settingsSyncOptions?: ISettingsSyncOptions;
193
+ /**
194
+ * The secret storage provider to store and retrieve secrets.
195
+ */
196
+ readonly secretStorageProvider?: ISecretStorageProvider;
197
+ /**
198
+ * Additional builtin extensions those cannot be uninstalled but only be disabled.
199
+ * It can be one of the following:
200
+ * - an extension in the Marketplace
201
+ * - location of the extension where it is hosted.
202
+ */
203
+ readonly additionalBuiltinExtensions?: readonly (MarketplaceExtension | UriComponents)[];
204
+ /**
205
+ * List of extensions to be enabled if they are installed.
206
+ * Note: This will not install extensions if not installed.
207
+ */
208
+ readonly enabledExtensions?: readonly ExtensionId[];
209
+ /**
210
+ * Additional domains allowed to open from the workbench without the
211
+ * link protection popup.
212
+ */
213
+ readonly additionalTrustedDomains?: string[];
214
+ /**
215
+ * Enable workspace trust feature for the current window
216
+ */
217
+ readonly enableWorkspaceTrust?: boolean;
218
+ /**
219
+ * Urls that will be opened externally that are allowed access
220
+ * to the opener window. This is primarily used to allow
221
+ * `window.close()` to be called from the newly opened window.
222
+ */
223
+ readonly openerAllowedExternalUrlPrefixes?: string[];
224
+ /**
225
+ * Support for URL callbacks.
226
+ */
227
+ readonly urlCallbackProvider?: IURLCallbackProvider;
228
+ /**
229
+ * Support adding additional properties to telemetry.
230
+ */
231
+ readonly resolveCommonTelemetryProperties?: ICommonTelemetryPropertiesResolver;
232
+ /**
233
+ * A set of optional commands that should be registered with the commands
234
+ * registry.
235
+ *
236
+ * Note: commands can be called from extensions if the identifier is known!
237
+ */
238
+ readonly commands?: readonly ICommand[];
239
+ /**
240
+ * Optional default layout to apply on first time the workspace is opened
241
+ * (unless `force` is specified). This includes visibility of views and
242
+ * editors including editor grid layout.
243
+ */
244
+ readonly defaultLayout?: IDefaultLayout;
245
+ /**
246
+ * Optional configuration default overrides contributed to the workbench.
247
+ */
248
+ readonly configurationDefaults?: Record<string, any>;
249
+ /**
250
+ * Profile to use for the workbench.
251
+ */
252
+ readonly profile?: {
253
+ readonly name: string;
254
+ readonly contents?: string | UriComponents;
255
+ };
256
+ /**
257
+ * URI of the profile to preview.
258
+ */
259
+ readonly profileToPreview?: UriComponents;
260
+ /**
261
+ * Support for update reporting
262
+ */
263
+ readonly updateProvider?: IUpdateProvider;
264
+ /**
265
+ * Support for product quality switching
266
+ */
267
+ readonly productQualityChangeHandler?: IProductQualityChangeHandler;
268
+ /**
269
+ * Optional welcome banner to appear above the workbench. Can be dismissed by the
270
+ * user.
271
+ */
272
+ readonly welcomeBanner?: IWelcomeBanner;
273
+ /**
274
+ * Optional override for the product configuration properties.
275
+ */
276
+ readonly productConfiguration?: Partial<IProductConfiguration>;
277
+ /**
278
+ * Optional override for properties of the window indicator in the status bar.
279
+ */
280
+ readonly windowIndicator?: IWindowIndicator;
281
+ /**
282
+ * Specifies the default theme type (LIGHT, DARK..) and allows to provide initial colors that are shown
283
+ * until the color theme that is specified in the settings (`editor.colorTheme`) is loaded and applied.
284
+ * Once there are persisted colors from a last run these will be used.
285
+ *
286
+ * The idea is that the colors match the main colors from the theme defined in the `configurationDefaults`.
287
+ */
288
+ readonly initialColorTheme?: IInitialColorTheme;
289
+ readonly messagePorts?: ReadonlyMap<ExtensionId, MessagePort>;
290
+ /**
291
+ * Optional authentication provider contributions. These take precedence over
292
+ * any authentication providers contributed via extensions.
293
+ */
294
+ readonly authenticationProviders?: readonly IAuthenticationProvider[];
295
+ readonly developmentOptions?: IDevelopmentOptions;
296
+ }
297
+ /**
298
+ * A workspace to open in the workbench can either be:
299
+ * - a workspace file with 0-N folders (via `workspaceUri`)
300
+ * - a single folder (via `folderUri`)
301
+ * - empty (via `undefined`)
302
+ */
303
+ export type IWorkspace = IWorkspaceToOpen | IFolderToOpen | undefined;
304
+ export interface IWorkspaceProvider {
305
+ /**
306
+ * The initial workspace to open.
307
+ */
308
+ readonly workspace: IWorkspace;
309
+ /**
310
+ * Arbitrary payload from the `IWorkspaceProvider.open` call.
311
+ */
312
+ readonly payload?: object;
313
+ /**
314
+ * Return `true` if the provided [workspace](#IWorkspaceProvider.workspace) is trusted, `false` if not trusted, `undefined` if unknown.
315
+ */
316
+ readonly trusted: boolean | undefined;
317
+ /**
318
+ * Asks to open a workspace in the current or a new window.
319
+ *
320
+ * @param workspace the workspace to open.
321
+ * @param options optional options for the workspace to open.
322
+ * - `reuse`: whether to open inside the current window or a new window
323
+ * - `payload`: arbitrary payload that should be made available
324
+ * to the opening window via the `IWorkspaceProvider.payload` property.
325
+ * @param payload optional payload to send to the workspace to open.
326
+ *
327
+ * @returns true if successfully opened, false otherwise.
328
+ */
329
+ open(workspace: IWorkspace, options?: {
330
+ reuse?: boolean;
331
+ payload?: object;
332
+ }): Promise<boolean>;
333
+ }
334
+ export interface IResourceUriProvider {
335
+ (uri: URI): URI;
336
+ }
337
+ /**
338
+ * The identifier of an extension in the format: `PUBLISHER.NAME`. For example: `vscode.csharp`
339
+ */
340
+ export type ExtensionId = string;
341
+ export type MarketplaceExtension = ExtensionId | {
342
+ readonly id: ExtensionId;
343
+ preRelease?: boolean;
344
+ migrateStorageFrom?: ExtensionId;
345
+ };
346
+ export interface ICommonTelemetryPropertiesResolver {
347
+ (): {
348
+ [key: string]: any;
349
+ };
350
+ }
351
+ export interface IExternalUriResolver {
352
+ (uri: URI): Promise<URI>;
353
+ }
354
+ export interface IExternalURLOpener {
355
+ /**
356
+ * Overrides the behavior when an external URL is about to be opened.
357
+ * Returning false means that the URL wasn't handled, and the default
358
+ * handling behavior should be used: `window.open(href, '_blank', 'noopener');`
359
+ *
360
+ * @returns true if URL was handled, false otherwise.
361
+ */
362
+ openExternal(href: string): boolean | Promise<boolean>;
363
+ }
364
+ export interface ITunnelProvider {
365
+ /**
366
+ * Support for creating tunnels.
367
+ */
368
+ tunnelFactory?: ITunnelFactory;
369
+ /**
370
+ * Support for filtering candidate ports.
371
+ */
372
+ showPortCandidate?: IShowPortCandidate;
373
+ /**
374
+ * The features that the tunnel provider supports.
375
+ */
376
+ features?: TunnelProviderFeatures;
377
+ }
378
+ export interface ITunnelFactory {
379
+ (tunnelOptions: ITunnelOptions, tunnelCreationOptions: TunnelCreationOptions): Promise<ITunnel> | undefined;
380
+ }
381
+ export interface ITunnelOptions {
382
+ remoteAddress: {
383
+ port: number;
384
+ host: string;
385
+ };
386
+ /**
387
+ * The desired local port. If this port can't be used, then another will be chosen.
388
+ */
389
+ localAddressPort?: number;
390
+ label?: string;
391
+ privacy?: string;
392
+ protocol?: string;
393
+ }
394
+ export interface TunnelCreationOptions {
395
+ /**
396
+ * True when the local operating system will require elevation to use the requested local port.
397
+ */
398
+ elevationRequired?: boolean;
399
+ }
400
+ export interface ITunnel {
401
+ remoteAddress: {
402
+ port: number;
403
+ host: string;
404
+ };
405
+ /**
406
+ * The complete local address(ex. localhost:1234)
407
+ */
408
+ localAddress: string;
409
+ privacy?: string;
410
+ /**
411
+ * If protocol is not provided, it is assumed to be http, regardless of the localAddress
412
+ */
413
+ protocol?: string;
414
+ /**
415
+ * Implementers of Tunnel should fire onDidDispose when dispose is called.
416
+ */
417
+ onDidDispose: Event<void>;
418
+ dispose(): Promise<void> | void;
419
+ }
420
+ export interface IShowPortCandidate {
421
+ (host: string, port: number, detail: string): Promise<boolean>;
422
+ }
423
+ export declare enum Menu {
424
+ CommandPalette = 0,
425
+ StatusBarWindowIndicatorMenu = 1
426
+ }
427
+ export interface ICommand {
428
+ /**
429
+ * An identifier for the command. Commands can be executed from extensions
430
+ * using the `vscode.commands.executeCommand` API using that command ID.
431
+ */
432
+ id: string;
433
+ /**
434
+ * The optional label of the command. If provided, the command will appear
435
+ * in the command palette.
436
+ */
437
+ label?: string;
438
+ /**
439
+ * The optional menus to append this command to. Only valid if `label` is
440
+ * provided as well.
441
+ * @default Menu.CommandPalette
442
+ */
443
+ menu?: Menu | Menu[];
444
+ /**
445
+ * A function that is being executed with any arguments passed over. The
446
+ * return type will be send back to the caller.
447
+ *
448
+ * Note: arguments and return type should be serializable so that they can
449
+ * be exchanged across processes boundaries.
450
+ */
451
+ handler: (...args: any[]) => unknown;
452
+ }
453
+ export interface IWelcomeBanner {
454
+ /**
455
+ * Welcome banner message to appear as text.
456
+ */
457
+ message: string;
458
+ /**
459
+ * Optional icon for the banner. This is either the URL to an icon to use
460
+ * or the name of one of the existing icons from our Codicon icon set.
461
+ *
462
+ * If not provided a default icon will be used.
463
+ */
464
+ icon?: string | UriComponents;
465
+ /**
466
+ * Optional actions to appear as links after the welcome banner message.
467
+ */
468
+ actions?: IWelcomeLinkAction[];
469
+ }
470
+ export interface IWelcomeLinkAction {
471
+ /**
472
+ * The link to open when clicking. Supports command invocation when
473
+ * using the `command:<commandId>` value.
474
+ */
475
+ href: string;
476
+ /**
477
+ * The label to show for the action link.
478
+ */
479
+ label: string;
480
+ /**
481
+ * A tooltip that will appear while hovering over the action link.
482
+ */
483
+ title?: string;
484
+ }
485
+ export interface IWindowIndicator {
486
+ /**
487
+ * Triggering this event will cause the window indicator to update.
488
+ */
489
+ readonly onDidChange?: Event<void>;
490
+ /**
491
+ * Label of the window indicator may include octicons
492
+ * e.g. `$(remote) label`
493
+ */
494
+ label: string;
495
+ /**
496
+ * Tooltip of the window indicator should not include
497
+ * octicons and be descriptive.
498
+ */
499
+ tooltip: string;
500
+ /**
501
+ * If provided, overrides the default command that
502
+ * is executed when clicking on the window indicator.
503
+ */
504
+ command?: string;
505
+ }
506
+ export declare enum ColorScheme {
507
+ DARK = "dark",
508
+ LIGHT = "light",
509
+ HIGH_CONTRAST_LIGHT = "hcLight",
510
+ HIGH_CONTRAST_DARK = "hcDark"
511
+ }
512
+ export interface IInitialColorTheme {
513
+ /**
514
+ * Initial color theme type.
515
+ */
516
+ readonly themeType: ColorScheme;
517
+ /**
518
+ * A list of workbench colors to apply initially.
519
+ */
520
+ readonly colors?: {
521
+ [colorId: string]: string;
522
+ };
523
+ }
524
+ export interface IDefaultView {
525
+ /**
526
+ * The identifier of the view to show by default.
527
+ */
528
+ readonly id: string;
529
+ }
530
+ export interface IDefaultEditor {
531
+ /**
532
+ * The location of the editor in the editor grid layout.
533
+ * Editors are layed out in editor groups and the view
534
+ * column is counted from top left to bottom right in
535
+ * the order of appearance beginning with `1`.
536
+ *
537
+ * If not provided, the editor will open in the active
538
+ * group.
539
+ */
540
+ readonly viewColumn?: number;
541
+ /**
542
+ * The resource of the editor to open.
543
+ */
544
+ readonly uri: UriComponents;
545
+ /**
546
+ * Optional extra options like which editor
547
+ * to use or which text to select.
548
+ */
549
+ readonly options?: ITextEditorOptions;
550
+ /**
551
+ * Will not open an untitled editor in case
552
+ * the resource does not exist.
553
+ */
554
+ readonly openOnlyIfExists?: boolean;
555
+ }
556
+ export interface IDefaultLayout {
557
+ /**
558
+ * A list of views to show by default.
559
+ */
560
+ readonly views?: IDefaultView[];
561
+ /**
562
+ * A list of editors to show by default.
563
+ */
564
+ readonly editors?: IDefaultEditor[];
565
+ /**
566
+ * The layout to use for the workbench.
567
+ */
568
+ readonly layout?: {
569
+ /**
570
+ * The layout of the editor area.
571
+ */
572
+ readonly editors?: EditorGroupLayout;
573
+ };
574
+ /**
575
+ * Forces this layout to be applied even if this isn't
576
+ * the first time the workspace has been opened
577
+ */
578
+ readonly force?: boolean;
579
+ }
580
+ export interface IProductQualityChangeHandler {
581
+ /**
582
+ * Handler is being called when the user wants to switch between
583
+ * `insider` or `stable` product qualities.
584
+ */
585
+ (newQuality: "insider" | "stable"): void;
586
+ }
587
+ /**
588
+ * Settings sync options
589
+ */
590
+ export interface ISettingsSyncOptions {
591
+ /**
592
+ * Is settings sync enabled
593
+ */
594
+ readonly enabled: boolean;
595
+ /**
596
+ * Version of extensions sync state.
597
+ * Extensions sync state will be reset if version is provided and different from previous version.
598
+ */
599
+ readonly extensionsSyncStateVersion?: string;
600
+ /**
601
+ * Handler is being called when the user changes Settings Sync enablement.
602
+ */
603
+ enablementHandler?(enablement: boolean, authenticationProvider: string): void;
604
+ /**
605
+ * Authentication provider
606
+ */
607
+ readonly authenticationProvider?: {
608
+ /**
609
+ * Unique identifier of the authentication provider.
610
+ */
611
+ readonly id: string;
612
+ /**
613
+ * Called when the user wants to signin to Settings Sync using the given authentication provider.
614
+ * The returned promise should resolve to the authentication session id.
615
+ */
616
+ signIn(): Promise<string>;
617
+ };
618
+ }
619
+ export interface IDevelopmentOptions {
620
+ /**
621
+ * Current logging level. Default is `LogLevel.Info`.
622
+ */
623
+ readonly logLevel?: LogLevel;
624
+ /**
625
+ * Extension log level.
626
+ */
627
+ readonly extensionLogLevel?: [
628
+ string,
629
+ LogLevel
630
+ ][];
631
+ /**
632
+ * Location of a module containing extension tests to run once the workbench is open.
633
+ */
634
+ readonly extensionTestsPath?: UriComponents;
635
+ /**
636
+ * Add extensions under development.
637
+ */
638
+ readonly extensions?: readonly UriComponents[];
639
+ /**
640
+ * Whether to enable the smoke test driver.
641
+ */
642
+ readonly enableSmokeTestDriver?: boolean;
643
+ }
644
+ /**
645
+ * Utility provided in the {@link WorkbenchOptions} which allows loading resources
646
+ * when remote resolvers are used in the web.
647
+ */
648
+ export interface IRemoteResourceProvider {
649
+ /**
650
+ * Path the workbench should delegate requests to. The embedder should
651
+ * install a service worker on this path and emit {@link onDidReceiveRequest}
652
+ * events when requests come in for that path.
653
+ */
654
+ readonly path: string;
655
+ /**
656
+ * Event that should fire when requests are made on the {@link pathPrefix}.
657
+ */
658
+ readonly onDidReceiveRequest: Event<IRemoteResourceRequest>;
659
+ }
660
+ /**
661
+ * todo@connor4312: this may eventually gain more properties like method and
662
+ * headers, but for now we only deal with GET requests.
663
+ */
664
+ export interface IRemoteResourceRequest {
665
+ /**
666
+ * Request URI. Generally will begin with the current
667
+ * origin and {@link IRemoteResourceProvider.pathPrefix}.
668
+ */
669
+ uri: URI;
670
+ /**
671
+ * A method called by the editor to issue a response to the request.
672
+ */
673
+ respondWith(statusCode: number, body: Uint8Array, headers: Record<string, string>): void;
674
+ }
@@ -0,0 +1,16 @@
1
+
2
+
3
+ var Menu;
4
+ (function (Menu) {
5
+ Menu[Menu["CommandPalette"] = 0] = "CommandPalette";
6
+ Menu[Menu["StatusBarWindowIndicatorMenu"] = 1] = "StatusBarWindowIndicatorMenu";
7
+ })(Menu || (Menu = {}));
8
+ var ColorScheme;
9
+ (function (ColorScheme) {
10
+ ColorScheme["DARK"] = "dark";
11
+ ColorScheme["LIGHT"] = "light";
12
+ ColorScheme["HIGH_CONTRAST_LIGHT"] = "hcLight";
13
+ ColorScheme["HIGH_CONTRAST_DARK"] = "hcDark";
14
+ })(ColorScheme || (ColorScheme = {}));
15
+
16
+ export { ColorScheme, Menu };
package/workbench.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type IAnyWorkspaceIdentifier } from "./vscode/src/vs/platform/workspace/common/workspace.js";
2
- import type { IWorkbenchConstructionOptions } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/browser/web.api";
2
+ import type { IWorkbenchConstructionOptions } from "./vscode/src/vs/workbench/browser/web.api.js";
3
3
  import { URI } from "./vscode/src/vs/base/common/uri.js";
4
4
  export interface EnvironmentOverride {
5
5
  userHome?: URI;