@lvce-editor/extension-management-worker 4.78.3 → 4.79.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.
@@ -184,6 +184,7 @@ const resetRuntimeState = applicationId => {
184
184
  runtimeStatuses: Object.create(null)
185
185
  }, applicationId);
186
186
  };
187
+ const getApplicationIds = () => applications$2.keys().toArray();
187
188
 
188
189
  const getErrorMessage = error => {
189
190
  if (error instanceof Error) {
@@ -3560,6 +3561,37 @@ const disableWorkspaceExtension = async id => {
3560
3561
  await invalidateExtensionsCache(id, true);
3561
3562
  };
3562
3563
 
3564
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3565
+
3566
+ const disposeExtensionApplication = async applicationId => {
3567
+ const application = get$7(applicationId);
3568
+ const ids = new Set([...getIds(applicationId), ...getPendingExtensionIds(application)]);
3569
+ const runtimes = ids.values().map(id => ({
3570
+ id,
3571
+ rpc: get$2(id, applicationId)
3572
+ })).toArray();
3573
+ // Invalidate pending activations and extension callbacks before awaiting teardown.
3574
+ removeApplication(applicationId);
3575
+ clear$1(applicationId);
3576
+ resetAllExtensionActivations(application);
3577
+ reset(applicationId);
3578
+ const results = await Promise.allSettled([dispose(application), ...runtimes.map(async ({
3579
+ id,
3580
+ rpc
3581
+ }) => {
3582
+ const runtimeId = getRuntimeId(id, application);
3583
+ const disposal = await Promise.allSettled([Promise.try(() => rpc?.dispose()), invoke$2('LaunchIsolatedExtensionHostWorker.disposeIsolatedExtensionHostWorker', runtimeId)]);
3584
+ const errors = disposal.filter(result => result.status === 'rejected').map(result => result.reason);
3585
+ if (errors.length > 0) {
3586
+ throw new AggregateError(errors, `Failed to dispose extension ${id}`);
3587
+ }
3588
+ })]);
3589
+ const errors = results.filter(result => result.status === 'rejected').map(result => result.reason);
3590
+ if (errors.length > 0) {
3591
+ throw new AggregateError(errors, `Failed to dispose extension application ${applicationId}`);
3592
+ }
3593
+ };
3594
+
3563
3595
  const disposeLanguageServers = async (extensionIds, disposeAll) => {
3564
3596
  if (!disposeAll) {
3565
3597
  await Promise.all(extensionIds.map(async extensionId => {
@@ -3605,35 +3637,10 @@ const disposeAllExtensionRuntimes = async (getExtensions = getAllExtensions) =>
3605
3637
  }
3606
3638
  };
3607
3639
 
3608
- /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3609
-
3610
- const disposeExtensionApplication = async applicationId => {
3611
- const application = get$7(applicationId);
3612
- const ids = new Set([...getIds(applicationId), ...getPendingExtensionIds(application)]);
3613
- const runtimes = ids.values().map(id => ({
3614
- id,
3615
- rpc: get$2(id, applicationId)
3616
- })).toArray();
3617
- // Invalidate pending activations and extension callbacks before awaiting teardown.
3618
- removeApplication(applicationId);
3619
- clear$1(applicationId);
3620
- resetAllExtensionActivations(application);
3621
- reset(applicationId);
3622
- const results = await Promise.allSettled([dispose(application), ...runtimes.map(async ({
3623
- id,
3624
- rpc
3625
- }) => {
3626
- const runtimeId = getRuntimeId(id, application);
3627
- const disposal = await Promise.allSettled([Promise.try(() => rpc?.dispose()), invoke$2('LaunchIsolatedExtensionHostWorker.disposeIsolatedExtensionHostWorker', runtimeId)]);
3628
- const errors = disposal.filter(result => result.status === 'rejected').map(result => result.reason);
3629
- if (errors.length > 0) {
3630
- throw new AggregateError(errors, `Failed to dispose extension ${id}`);
3631
- }
3632
- })]);
3633
- const errors = results.filter(result => result.status === 'rejected').map(result => result.reason);
3634
- if (errors.length > 0) {
3635
- throw new AggregateError(errors, `Failed to dispose extension application ${applicationId}`);
3636
- }
3640
+ // Unlike a workspace change, hot reload must retire even workspace-independent runtimes.
3641
+ const disposeForHotReload = async () => {
3642
+ await Promise.all(getApplicationIds().map(disposeExtensionApplication));
3643
+ await disposeAllExtensionRuntimes(async () => []);
3637
3644
  };
3638
3645
 
3639
3646
  const enableExtension2 = async (id, platform) => {
@@ -6195,6 +6202,7 @@ const commandMap = {
6195
6202
  'ExtensionHostSourceControl.generateCommitMessage': wrapSourceControlProviderCommand('executeSourceControlGenerateCommitMessage'),
6196
6203
  'ExtensionHostSourceControl.getBadgeCount': wrapSourceControlProviderCommand('executeSourceControlGetBadgeCount'),
6197
6204
  'ExtensionHostSourceControl.getChangedFiles': wrapSourceControlProviderCommand('executeSourceControlGetChangedFiles'),
6205
+ 'ExtensionHostSourceControl.getCurrentBranch': wrapSourceControlProviderCommand('executeSourceControlGetCurrentBranch'),
6198
6206
  'ExtensionHostSourceControl.getEnabledProviderIds': wrapCommand(getEnabledSourceControlProviderIds),
6199
6207
  'ExtensionHostSourceControl.getFeatures': wrapSourceControlProviderCommand('executeSourceControlGetFeatures'),
6200
6208
  'ExtensionHostSourceControl.getFileBefore': wrapSourceControlProviderCommand('executeSourceControlGetFileBefore'),
@@ -6219,6 +6227,7 @@ const commandMap = {
6219
6227
  'Extensions.dispatchViewEvent': dispatchViewEvent,
6220
6228
  'Extensions.disposeAllRuntimes': disposeAllExtensionRuntimes,
6221
6229
  'Extensions.disposeApplication': disposeExtensionApplication,
6230
+ 'Extensions.disposeForHotReload': disposeForHotReload,
6222
6231
  'Extensions.disposeViewInstance': disposeViewInstance,
6223
6232
  'Extensions.enable': enableExtension,
6224
6233
  'Extensions.enable2': enableExtension2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-management-worker",
3
- "version": "4.78.3",
3
+ "version": "4.79.0",
4
4
  "description": "Webworker for the Extension Management functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"