@lvce-editor/extension-host-worker 8.13.0 → 8.15.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/dist/extensionHostWorkerMain.js +79 -36
- package/package.json +1 -1
|
@@ -1908,7 +1908,7 @@ const createMockRpc = ({
|
|
|
1908
1908
|
};
|
|
1909
1909
|
|
|
1910
1910
|
const rpcs$2 = Object.create(null);
|
|
1911
|
-
const set$
|
|
1911
|
+
const set$d = (id, rpc) => {
|
|
1912
1912
|
rpcs$2[id] = rpc;
|
|
1913
1913
|
};
|
|
1914
1914
|
const get$a = id => {
|
|
@@ -1941,7 +1941,7 @@ const create$7 = rpcId => {
|
|
|
1941
1941
|
const mockRpc = createMockRpc({
|
|
1942
1942
|
commandMap
|
|
1943
1943
|
});
|
|
1944
|
-
set$
|
|
1944
|
+
set$d(rpcId, mockRpc);
|
|
1945
1945
|
// @ts-ignore
|
|
1946
1946
|
mockRpc[Symbol.dispose] = () => {
|
|
1947
1947
|
remove$4(rpcId);
|
|
@@ -1950,7 +1950,7 @@ const create$7 = rpcId => {
|
|
|
1950
1950
|
return mockRpc;
|
|
1951
1951
|
},
|
|
1952
1952
|
set(rpc) {
|
|
1953
|
-
set$
|
|
1953
|
+
set$d(rpcId, rpc);
|
|
1954
1954
|
}
|
|
1955
1955
|
};
|
|
1956
1956
|
};
|
|
@@ -1970,13 +1970,17 @@ const DebugWorker = {
|
|
|
1970
1970
|
const {
|
|
1971
1971
|
invoke: invoke$5,
|
|
1972
1972
|
invokeAndTransfer: invokeAndTransfer$3,
|
|
1973
|
-
set: set$
|
|
1973
|
+
set: set$c
|
|
1974
1974
|
} = create$7(ExtensionManagementWorker);
|
|
1975
1975
|
|
|
1976
|
+
const {
|
|
1977
|
+
set: set$b
|
|
1978
|
+
} = create$7(7013);
|
|
1979
|
+
|
|
1976
1980
|
const {
|
|
1977
1981
|
invoke: invoke$4,
|
|
1978
1982
|
set: set$a
|
|
1979
|
-
} = create$7(
|
|
1983
|
+
} = create$7(10_000);
|
|
1980
1984
|
|
|
1981
1985
|
const {
|
|
1982
1986
|
invoke: invoke$3,
|
|
@@ -1985,6 +1989,10 @@ const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
|
1985
1989
|
const command = 'QuickPick.handleMessagePort';
|
|
1986
1990
|
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1987
1991
|
};
|
|
1992
|
+
const sendMessagePortToQuickPickWorker = async (port, rpcId = 0) => {
|
|
1993
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1994
|
+
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToQuickPickWorker', port, command, rpcId);
|
|
1995
|
+
};
|
|
1988
1996
|
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1989
1997
|
const command = 'Iframes.handleMessagePort';
|
|
1990
1998
|
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
@@ -2751,17 +2759,43 @@ const create$1 = () => {
|
|
|
2751
2759
|
return ++id$1;
|
|
2752
2760
|
};
|
|
2753
2761
|
|
|
2754
|
-
const
|
|
2755
|
-
|
|
2762
|
+
const validateQuickPickItem = item => {
|
|
2763
|
+
if (!item || typeof item !== 'object') {
|
|
2764
|
+
throw new TypeError('quick pick item must be an object');
|
|
2765
|
+
}
|
|
2766
|
+
if (typeof item.label !== 'string') {
|
|
2767
|
+
throw new TypeError('quick pick item.label must be a string');
|
|
2768
|
+
}
|
|
2769
|
+
if (typeof item.description !== 'string') {
|
|
2770
|
+
throw new TypeError('quick pick item.description must be a string');
|
|
2771
|
+
}
|
|
2772
|
+
if (!('value' in item)) {
|
|
2773
|
+
throw new TypeError('quick pick item.value is required');
|
|
2774
|
+
}
|
|
2775
|
+
};
|
|
2756
2776
|
const showQuickPick = async ({
|
|
2757
|
-
|
|
2758
|
-
|
|
2777
|
+
items,
|
|
2778
|
+
placeholder
|
|
2759
2779
|
}) => {
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2780
|
+
if (!Array.isArray(items)) {
|
|
2781
|
+
throw new TypeError('showQuickPick items must be an array');
|
|
2782
|
+
}
|
|
2783
|
+
for (const item of items) {
|
|
2784
|
+
validateQuickPickItem(item);
|
|
2785
|
+
}
|
|
2786
|
+
return invoke$4('QuickPick.showQuickPick', {
|
|
2787
|
+
items,
|
|
2788
|
+
placeholder
|
|
2789
|
+
});
|
|
2763
2790
|
};
|
|
2764
2791
|
const quickInputs = Object.create(null);
|
|
2792
|
+
const renderQuickInput = async (id, searchValue) => {
|
|
2793
|
+
const render = quickInputs[id];
|
|
2794
|
+
if (!render) {
|
|
2795
|
+
return [];
|
|
2796
|
+
}
|
|
2797
|
+
return render(searchValue);
|
|
2798
|
+
};
|
|
2765
2799
|
const showQuickInput = async ({
|
|
2766
2800
|
ignoreFocusOut,
|
|
2767
2801
|
initialValue,
|
|
@@ -2769,6 +2803,7 @@ const showQuickInput = async ({
|
|
|
2769
2803
|
}) => {
|
|
2770
2804
|
const id = create$1();
|
|
2771
2805
|
quickInputs[id] = render;
|
|
2806
|
+
const initialItems = await render('');
|
|
2772
2807
|
// TODO create direct connection to file search worker
|
|
2773
2808
|
const {
|
|
2774
2809
|
canceled,
|
|
@@ -2776,13 +2811,17 @@ const showQuickInput = async ({
|
|
|
2776
2811
|
} = await invoke$4('QuickPick.showQuickInput', {
|
|
2777
2812
|
id,
|
|
2778
2813
|
ignoreFocusOut,
|
|
2814
|
+
initialItems,
|
|
2779
2815
|
initialValue
|
|
2780
2816
|
});
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2817
|
+
try {
|
|
2818
|
+
return {
|
|
2819
|
+
canceled,
|
|
2820
|
+
inputValue
|
|
2821
|
+
};
|
|
2822
|
+
} finally {
|
|
2823
|
+
delete quickInputs[id];
|
|
2824
|
+
}
|
|
2786
2825
|
};
|
|
2787
2826
|
|
|
2788
2827
|
const {
|
|
@@ -3790,21 +3829,17 @@ const launchExtensionManagementWorker = async () => {
|
|
|
3790
3829
|
await sendMessagePortToExtensionManagementWorker(port, 0);
|
|
3791
3830
|
}
|
|
3792
3831
|
});
|
|
3793
|
-
set$
|
|
3832
|
+
set$c(rpc);
|
|
3794
3833
|
};
|
|
3795
3834
|
|
|
3796
3835
|
const launchFileSearchWorker = async () => {
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
set$a(rpc);
|
|
3805
|
-
} catch {
|
|
3806
|
-
// ignore
|
|
3807
|
-
}
|
|
3836
|
+
const rpc = await create$d({
|
|
3837
|
+
commandMap: {},
|
|
3838
|
+
async send(port) {
|
|
3839
|
+
await sendMessagePortToFileSearchWorker(port, 0);
|
|
3840
|
+
}
|
|
3841
|
+
});
|
|
3842
|
+
set$b(rpc);
|
|
3808
3843
|
};
|
|
3809
3844
|
|
|
3810
3845
|
const create = () => {
|
|
@@ -5359,9 +5394,6 @@ const getContentType = uri => {
|
|
|
5359
5394
|
return mime;
|
|
5360
5395
|
};
|
|
5361
5396
|
|
|
5362
|
-
/* eslint-disable sonarjs/prefer-single-boolean-return, sonarjs/redundant-type-aliases, sonarjs/cognitive-complexity */
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
5397
|
// TODO move this to an extension?
|
|
5366
5398
|
|
|
5367
5399
|
const readFile = uri => {
|
|
@@ -5657,7 +5689,7 @@ const handleMessagePort2 = async (port, rpcId) => {
|
|
|
5657
5689
|
messagePort: port
|
|
5658
5690
|
});
|
|
5659
5691
|
if (rpcId) {
|
|
5660
|
-
set$
|
|
5692
|
+
set$d(rpcId, rpc);
|
|
5661
5693
|
}
|
|
5662
5694
|
};
|
|
5663
5695
|
|
|
@@ -5667,7 +5699,7 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
5667
5699
|
messagePort: port
|
|
5668
5700
|
});
|
|
5669
5701
|
if (rpcId) {
|
|
5670
|
-
set$
|
|
5702
|
+
set$d(rpcId, rpc);
|
|
5671
5703
|
}
|
|
5672
5704
|
};
|
|
5673
5705
|
|
|
@@ -6363,6 +6395,7 @@ const commandMap = {
|
|
|
6363
6395
|
'ExtensionHostDebug.stepInto': stepInto,
|
|
6364
6396
|
'ExtensionHostDebug.stepOut': stepOut,
|
|
6365
6397
|
'ExtensionHostDebug.stepOver': stepOver,
|
|
6398
|
+
'ExtensionHostQuickPick.renderQuickInput': renderQuickInput,
|
|
6366
6399
|
'ExtensionHostRename.executeprepareRenameProvider': executeprepareRenameProvider,
|
|
6367
6400
|
'ExtensionHostRename.executeRenameProvider': executeRenameProvider,
|
|
6368
6401
|
'ExtensionHostSourceControl.getIconDefinitions': getIconDefinitions,
|
|
@@ -6429,15 +6462,25 @@ const commandMap = {
|
|
|
6429
6462
|
'WebViews.getWebViews': getWebViews
|
|
6430
6463
|
};
|
|
6431
6464
|
|
|
6465
|
+
const launchQuickPickWorker = async () => {
|
|
6466
|
+
const rpc = await create$d({
|
|
6467
|
+
commandMap: commandMap,
|
|
6468
|
+
async send(port) {
|
|
6469
|
+
await sendMessagePortToQuickPickWorker(port, 0);
|
|
6470
|
+
}
|
|
6471
|
+
});
|
|
6472
|
+
set$a(rpc);
|
|
6473
|
+
};
|
|
6474
|
+
|
|
6432
6475
|
const launchRendererWorker = async () => {
|
|
6433
6476
|
const rpc = await create$8({
|
|
6434
6477
|
commandMap: commandMap
|
|
6435
6478
|
});
|
|
6436
|
-
set$
|
|
6479
|
+
set$d(RendererWorker, rpc);
|
|
6437
6480
|
};
|
|
6438
6481
|
|
|
6439
6482
|
const listen = async () => {
|
|
6440
|
-
await Promise.all([launchExtensionManagementWorker(), launchFileSearchWorker(), launchRendererWorker()]);
|
|
6483
|
+
await Promise.all([launchExtensionManagementWorker(), launchFileSearchWorker(), launchRendererWorker(), launchQuickPickWorker()]);
|
|
6441
6484
|
};
|
|
6442
6485
|
|
|
6443
6486
|
const main = async () => {
|