@lvce-editor/extension-management-worker 4.90.0 → 4.90.1
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.
|
@@ -3647,6 +3647,42 @@ const createWebViewWorkerRpc = async (rpcInfo, port) => {
|
|
|
3647
3647
|
});
|
|
3648
3648
|
};
|
|
3649
3649
|
|
|
3650
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
3651
|
+
|
|
3652
|
+
const instances = Object.create(null);
|
|
3653
|
+
const set$1 = (uid, instance) => {
|
|
3654
|
+
instances[uid] = instance;
|
|
3655
|
+
};
|
|
3656
|
+
const get$1 = uid => {
|
|
3657
|
+
return instances[uid];
|
|
3658
|
+
};
|
|
3659
|
+
const getEntries = () => {
|
|
3660
|
+
return Object.entries(instances).map(([uid, instance]) => ({
|
|
3661
|
+
instance,
|
|
3662
|
+
uid: Number(uid)
|
|
3663
|
+
}));
|
|
3664
|
+
};
|
|
3665
|
+
const remove = uid => {
|
|
3666
|
+
delete instances[uid];
|
|
3667
|
+
};
|
|
3668
|
+
const invalidateRpc = rpc => {
|
|
3669
|
+
for (const {
|
|
3670
|
+
instance,
|
|
3671
|
+
uid
|
|
3672
|
+
} of getEntries()) {
|
|
3673
|
+
if (instance.status === 'ready' && instance.rpc === rpc) {
|
|
3674
|
+
set$1(uid, {
|
|
3675
|
+
error: {
|
|
3676
|
+
message: 'Extension runtime disposed',
|
|
3677
|
+
name: 'Error'
|
|
3678
|
+
},
|
|
3679
|
+
status: 'error',
|
|
3680
|
+
viewId: instance.viewId
|
|
3681
|
+
});
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
};
|
|
3685
|
+
|
|
3650
3686
|
const disposeIsolatedExtensionHostWorker = async (extensionId, invoke = invoke$2) => {
|
|
3651
3687
|
unregister(extensionId);
|
|
3652
3688
|
const rpc = remove$1(extensionId);
|
|
@@ -3654,6 +3690,7 @@ const disposeIsolatedExtensionHostWorker = async (extensionId, invoke = invoke$2
|
|
|
3654
3690
|
await disposeOwner(extensionId);
|
|
3655
3691
|
return false;
|
|
3656
3692
|
}
|
|
3693
|
+
invalidateRpc(rpc);
|
|
3657
3694
|
resetExtensionActivation(extensionId);
|
|
3658
3695
|
resetExtensionRuntimeState(extensionId);
|
|
3659
3696
|
// Close all owned resources even if one backend fails during teardown.
|
|
@@ -5064,25 +5101,6 @@ const readOutputChannel = async (extensionsState, uri) => {
|
|
|
5064
5101
|
return logs;
|
|
5065
5102
|
};
|
|
5066
5103
|
|
|
5067
|
-
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
5068
|
-
|
|
5069
|
-
const instances = Object.create(null);
|
|
5070
|
-
const set$1 = (uid, instance) => {
|
|
5071
|
-
instances[uid] = instance;
|
|
5072
|
-
};
|
|
5073
|
-
const get$1 = uid => {
|
|
5074
|
-
return instances[uid];
|
|
5075
|
-
};
|
|
5076
|
-
const getEntries = () => {
|
|
5077
|
-
return Object.entries(instances).map(([uid, instance]) => ({
|
|
5078
|
-
instance,
|
|
5079
|
-
uid: Number(uid)
|
|
5080
|
-
}));
|
|
5081
|
-
};
|
|
5082
|
-
const remove = uid => {
|
|
5083
|
-
delete instances[uid];
|
|
5084
|
-
};
|
|
5085
|
-
|
|
5086
5104
|
const serializeError = error => {
|
|
5087
5105
|
if (error instanceof Error) {
|
|
5088
5106
|
return {
|