@lvce-editor/test-worker 10.11.0 → 10.13.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/api.d.ts +6 -0
- package/dist/testWorkerMain.js +158 -124
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -50,6 +50,11 @@ export interface FileSystemTmpDirOptions {
|
|
|
50
50
|
readonly scheme?: string;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
export interface SelectItem2Options {
|
|
54
|
+
readonly callbackCommand: string;
|
|
55
|
+
readonly label: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
interface Workspace {
|
|
54
59
|
readonly openTmpDir: () => Promise<string>;
|
|
55
60
|
readonly setPath: (path: string) => Promise<void>;
|
|
@@ -429,6 +434,7 @@ interface QuickPick {
|
|
|
429
434
|
readonly selectCurrentIndex: () => Promise<void>;
|
|
430
435
|
readonly selectIndex: (index: number) => Promise<void>;
|
|
431
436
|
readonly selectItem: (label: string) => Promise<void>;
|
|
437
|
+
readonly selectItem2: ({ callbackCommand, label }: SelectItem2Options) => Promise<void>;
|
|
432
438
|
readonly setValue: (value: string) => Promise<void>;
|
|
433
439
|
}
|
|
434
440
|
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -231,8 +231,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
231
231
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
232
232
|
const message = lines[messageIndex];
|
|
233
233
|
return {
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
235
|
+
message
|
|
236
236
|
};
|
|
237
237
|
};
|
|
238
238
|
const isModuleNotFoundError = stderr => {
|
|
@@ -255,14 +255,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
255
255
|
const getNativeModuleErrorMessage = stderr => {
|
|
256
256
|
const message = getMessageCodeBlock(stderr);
|
|
257
257
|
return {
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
259
|
+
message: `Incompatible native node module: ${message}`
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
const getModuleSyntaxError = () => {
|
|
263
263
|
return {
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
265
|
+
message: `ES Modules are not supported in electron`
|
|
266
266
|
};
|
|
267
267
|
};
|
|
268
268
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -281,8 +281,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
281
281
|
rest
|
|
282
282
|
} = getDetails(lines);
|
|
283
283
|
return {
|
|
284
|
-
message: actualMessage,
|
|
285
284
|
code: '',
|
|
285
|
+
message: actualMessage,
|
|
286
286
|
stack: rest
|
|
287
287
|
};
|
|
288
288
|
};
|
|
@@ -292,8 +292,8 @@ class IpcError extends VError {
|
|
|
292
292
|
if (stdout || stderr) {
|
|
293
293
|
// @ts-ignore
|
|
294
294
|
const {
|
|
295
|
-
message,
|
|
296
295
|
code,
|
|
296
|
+
message,
|
|
297
297
|
stack
|
|
298
298
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
299
299
|
const cause = new Error(message);
|
|
@@ -354,8 +354,8 @@ const wrap$f = global => {
|
|
|
354
354
|
};
|
|
355
355
|
const waitForFirstMessage = async port => {
|
|
356
356
|
const {
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
promise,
|
|
358
|
+
resolve
|
|
359
359
|
} = Promise.withResolvers();
|
|
360
360
|
port.addEventListener('message', resolve, {
|
|
361
361
|
once: true
|
|
@@ -375,8 +375,8 @@ const listen$6 = async () => {
|
|
|
375
375
|
const type = firstMessage.params[0];
|
|
376
376
|
if (type === 'message-port') {
|
|
377
377
|
parentIpc.send({
|
|
378
|
-
jsonrpc: '2.0',
|
|
379
378
|
id: firstMessage.id,
|
|
379
|
+
jsonrpc: '2.0',
|
|
380
380
|
result: null
|
|
381
381
|
});
|
|
382
382
|
parentIpc.dispose();
|
|
@@ -433,8 +433,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
433
433
|
};
|
|
434
434
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
435
435
|
const {
|
|
436
|
-
|
|
437
|
-
|
|
436
|
+
promise,
|
|
437
|
+
resolve
|
|
438
438
|
} = Promise.withResolvers();
|
|
439
439
|
const listenerMap = Object.create(null);
|
|
440
440
|
const cleanup = value => {
|
|
@@ -446,8 +446,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
446
446
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
447
447
|
const listener = event => {
|
|
448
448
|
cleanup({
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
event,
|
|
450
|
+
type
|
|
451
451
|
});
|
|
452
452
|
};
|
|
453
453
|
addListener(eventEmitter, event, listener);
|
|
@@ -457,8 +457,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
457
457
|
};
|
|
458
458
|
const Message$1 = 3;
|
|
459
459
|
const create$5$1 = async ({
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
isMessagePortOpen,
|
|
461
|
+
messagePort
|
|
462
462
|
}) => {
|
|
463
463
|
if (!isMessagePort(messagePort)) {
|
|
464
464
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -471,8 +471,8 @@ const create$5$1 = async ({
|
|
|
471
471
|
});
|
|
472
472
|
messagePort.start();
|
|
473
473
|
const {
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
event,
|
|
475
|
+
type
|
|
476
476
|
} = await eventPromise;
|
|
477
477
|
if (type !== Message$1) {
|
|
478
478
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -512,55 +512,13 @@ const IpcParentWithMessagePort$1 = {
|
|
|
512
512
|
wrap: wrap$5
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
-
const Two = '2.0';
|
|
516
|
-
const
|
|
517
|
-
return {
|
|
518
|
-
jsonrpc: Two,
|
|
519
|
-
method,
|
|
520
|
-
params
|
|
521
|
-
};
|
|
522
|
-
};
|
|
523
|
-
const callbacks = Object.create(null);
|
|
524
|
-
const set$3 = (id, fn) => {
|
|
525
|
-
callbacks[id] = fn;
|
|
526
|
-
};
|
|
515
|
+
const Two$1 = '2.0';
|
|
516
|
+
const callbacks$1 = Object.create(null);
|
|
527
517
|
const get$2 = id => {
|
|
528
|
-
return callbacks[id];
|
|
518
|
+
return callbacks$1[id];
|
|
529
519
|
};
|
|
530
520
|
const remove$1 = id => {
|
|
531
|
-
delete callbacks[id];
|
|
532
|
-
};
|
|
533
|
-
let id = 0;
|
|
534
|
-
const create$3$1 = () => {
|
|
535
|
-
return ++id;
|
|
536
|
-
};
|
|
537
|
-
const registerPromise = () => {
|
|
538
|
-
const id = create$3$1();
|
|
539
|
-
const {
|
|
540
|
-
resolve,
|
|
541
|
-
promise
|
|
542
|
-
} = Promise.withResolvers();
|
|
543
|
-
set$3(id, resolve);
|
|
544
|
-
return {
|
|
545
|
-
id,
|
|
546
|
-
promise
|
|
547
|
-
};
|
|
548
|
-
};
|
|
549
|
-
const create$2$1 = (method, params) => {
|
|
550
|
-
const {
|
|
551
|
-
id,
|
|
552
|
-
promise
|
|
553
|
-
} = registerPromise();
|
|
554
|
-
const message = {
|
|
555
|
-
jsonrpc: Two,
|
|
556
|
-
method,
|
|
557
|
-
params,
|
|
558
|
-
id
|
|
559
|
-
};
|
|
560
|
-
return {
|
|
561
|
-
message,
|
|
562
|
-
promise
|
|
563
|
-
};
|
|
521
|
+
delete callbacks$1[id];
|
|
564
522
|
};
|
|
565
523
|
class JsonRpcError extends Error {
|
|
566
524
|
constructor(message) {
|
|
@@ -757,7 +715,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
757
715
|
};
|
|
758
716
|
const create$1$1 = (id, error) => {
|
|
759
717
|
return {
|
|
760
|
-
jsonrpc: Two,
|
|
718
|
+
jsonrpc: Two$1,
|
|
761
719
|
id,
|
|
762
720
|
error
|
|
763
721
|
};
|
|
@@ -768,20 +726,20 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
768
726
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
769
727
|
return create$1$1(id, errorProperty);
|
|
770
728
|
};
|
|
771
|
-
const create$
|
|
729
|
+
const create$3 = (message, result) => {
|
|
772
730
|
return {
|
|
773
|
-
jsonrpc: Two,
|
|
731
|
+
jsonrpc: Two$1,
|
|
774
732
|
id: message.id,
|
|
775
733
|
result: result ?? null
|
|
776
734
|
};
|
|
777
735
|
};
|
|
778
736
|
const getSuccessResponse = (message, result) => {
|
|
779
737
|
const resultProperty = result ?? null;
|
|
780
|
-
return create$
|
|
738
|
+
return create$3(message, resultProperty);
|
|
781
739
|
};
|
|
782
740
|
const getErrorResponseSimple = (id, error) => {
|
|
783
741
|
return {
|
|
784
|
-
jsonrpc: Two,
|
|
742
|
+
jsonrpc: Two$1,
|
|
785
743
|
id,
|
|
786
744
|
error: {
|
|
787
745
|
code: Custom,
|
|
@@ -868,29 +826,6 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
868
826
|
}
|
|
869
827
|
throw new JsonRpcError('unexpected message');
|
|
870
828
|
};
|
|
871
|
-
const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
872
|
-
const {
|
|
873
|
-
message,
|
|
874
|
-
promise
|
|
875
|
-
} = create$2$1(method, params);
|
|
876
|
-
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
877
|
-
ipc.sendAndTransfer(message);
|
|
878
|
-
} else {
|
|
879
|
-
ipc.send(message);
|
|
880
|
-
}
|
|
881
|
-
const responseMessage = await promise;
|
|
882
|
-
return unwrapJsonRpcResult(responseMessage);
|
|
883
|
-
};
|
|
884
|
-
const send$1 = (transport, method, ...params) => {
|
|
885
|
-
const message = create$4(method, params);
|
|
886
|
-
transport.send(message);
|
|
887
|
-
};
|
|
888
|
-
const invoke$2 = (ipc, method, ...params) => {
|
|
889
|
-
return invokeHelper(ipc, method, params, false);
|
|
890
|
-
};
|
|
891
|
-
const invokeAndTransfer$1 = (ipc, method, ...params) => {
|
|
892
|
-
return invokeHelper(ipc, method, params, true);
|
|
893
|
-
};
|
|
894
829
|
|
|
895
830
|
class CommandNotFoundError extends Error {
|
|
896
831
|
constructor(command) {
|
|
@@ -913,24 +848,87 @@ const execute$2 = (command, ...args) => {
|
|
|
913
848
|
return fn(...args);
|
|
914
849
|
};
|
|
915
850
|
|
|
851
|
+
const Two = '2.0';
|
|
852
|
+
const create$p = (method, params) => {
|
|
853
|
+
return {
|
|
854
|
+
jsonrpc: Two,
|
|
855
|
+
method,
|
|
856
|
+
params
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
const create$o = (id, method, params) => {
|
|
860
|
+
const message = {
|
|
861
|
+
id,
|
|
862
|
+
jsonrpc: Two,
|
|
863
|
+
method,
|
|
864
|
+
params
|
|
865
|
+
};
|
|
866
|
+
return message;
|
|
867
|
+
};
|
|
868
|
+
let id = 0;
|
|
869
|
+
const create$n = () => {
|
|
870
|
+
return ++id;
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
874
|
+
|
|
875
|
+
const registerPromise = map => {
|
|
876
|
+
const id = create$n();
|
|
877
|
+
const {
|
|
878
|
+
promise,
|
|
879
|
+
resolve
|
|
880
|
+
} = Promise.withResolvers();
|
|
881
|
+
map[id] = resolve;
|
|
882
|
+
return {
|
|
883
|
+
id,
|
|
884
|
+
promise
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
// @ts-ignore
|
|
889
|
+
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
890
|
+
const {
|
|
891
|
+
id,
|
|
892
|
+
promise
|
|
893
|
+
} = registerPromise(callbacks);
|
|
894
|
+
const message = create$o(id, method, params);
|
|
895
|
+
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
896
|
+
ipc.sendAndTransfer(message);
|
|
897
|
+
} else {
|
|
898
|
+
ipc.send(message);
|
|
899
|
+
}
|
|
900
|
+
const responseMessage = await promise;
|
|
901
|
+
return unwrapJsonRpcResult(responseMessage);
|
|
902
|
+
};
|
|
916
903
|
const createRpc = ipc => {
|
|
904
|
+
const callbacks = Object.create(null);
|
|
905
|
+
ipc._resolve = (id, response) => {
|
|
906
|
+
const fn = callbacks[id];
|
|
907
|
+
if (!fn) {
|
|
908
|
+
console.warn(`callback ${id} may already be disposed`);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
fn(response);
|
|
912
|
+
delete callbacks[id];
|
|
913
|
+
};
|
|
917
914
|
const rpc = {
|
|
915
|
+
async dispose() {
|
|
916
|
+
await ipc?.dispose();
|
|
917
|
+
},
|
|
918
|
+
invoke(method, ...params) {
|
|
919
|
+
return invokeHelper(callbacks, ipc, method, params, false);
|
|
920
|
+
},
|
|
921
|
+
invokeAndTransfer(method, ...params) {
|
|
922
|
+
return invokeHelper(callbacks, ipc, method, params, true);
|
|
923
|
+
},
|
|
918
924
|
// @ts-ignore
|
|
919
925
|
ipc,
|
|
920
926
|
/**
|
|
921
927
|
* @deprecated
|
|
922
928
|
*/
|
|
923
929
|
send(method, ...params) {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
invoke(method, ...params) {
|
|
927
|
-
return invoke$2(ipc, method, ...params);
|
|
928
|
-
},
|
|
929
|
-
invokeAndTransfer(method, ...params) {
|
|
930
|
-
return invokeAndTransfer$1(ipc, method, ...params);
|
|
931
|
-
},
|
|
932
|
-
async dispose() {
|
|
933
|
-
await ipc?.dispose();
|
|
930
|
+
const message = create$p(method, params);
|
|
931
|
+
ipc.send(message);
|
|
934
932
|
}
|
|
935
933
|
};
|
|
936
934
|
return rpc;
|
|
@@ -947,7 +945,7 @@ const logError = () => {
|
|
|
947
945
|
const handleMessage = event => {
|
|
948
946
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
949
947
|
const actualExecute = event?.target?.execute || execute$2;
|
|
950
|
-
return handleJsonRpcMessage(event.target, event.data, actualExecute,
|
|
948
|
+
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
951
949
|
};
|
|
952
950
|
const handleIpc = ipc => {
|
|
953
951
|
if ('addEventListener' in ipc) {
|
|
@@ -965,16 +963,16 @@ const listen$1 = async (module, options) => {
|
|
|
965
963
|
const ipc = module.wrap(rawIpc);
|
|
966
964
|
return ipc;
|
|
967
965
|
};
|
|
968
|
-
const create$
|
|
966
|
+
const create$g = async ({
|
|
969
967
|
commandMap,
|
|
970
|
-
|
|
971
|
-
|
|
968
|
+
isMessagePortOpen,
|
|
969
|
+
messagePort
|
|
972
970
|
}) => {
|
|
973
971
|
// TODO create a commandMap per rpc instance
|
|
974
972
|
register(commandMap);
|
|
975
973
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
976
|
-
|
|
977
|
-
|
|
974
|
+
isMessagePortOpen,
|
|
975
|
+
messagePort
|
|
978
976
|
});
|
|
979
977
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
980
978
|
handleIpc(ipc);
|
|
@@ -983,17 +981,18 @@ const create$e = async ({
|
|
|
983
981
|
};
|
|
984
982
|
const MessagePortRpcParent = {
|
|
985
983
|
__proto__: null,
|
|
986
|
-
create: create$
|
|
984
|
+
create: create$g
|
|
987
985
|
};
|
|
988
|
-
const create$
|
|
986
|
+
const create$7 = async ({
|
|
989
987
|
commandMap,
|
|
988
|
+
isMessagePortOpen = true,
|
|
990
989
|
messagePort
|
|
991
990
|
}) => {
|
|
992
991
|
// TODO create a commandMap per rpc instance
|
|
993
992
|
register(commandMap);
|
|
994
993
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
995
|
-
|
|
996
|
-
|
|
994
|
+
isMessagePortOpen,
|
|
995
|
+
messagePort
|
|
997
996
|
});
|
|
998
997
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
999
998
|
handleIpc(ipc);
|
|
@@ -1001,8 +1000,9 @@ const create$5 = async ({
|
|
|
1001
1000
|
messagePort.start();
|
|
1002
1001
|
return rpc;
|
|
1003
1002
|
};
|
|
1004
|
-
const create$
|
|
1003
|
+
const create$5 = async ({
|
|
1005
1004
|
commandMap,
|
|
1005
|
+
isMessagePortOpen,
|
|
1006
1006
|
send
|
|
1007
1007
|
}) => {
|
|
1008
1008
|
const {
|
|
@@ -1010,14 +1010,15 @@ const create$3 = async ({
|
|
|
1010
1010
|
port2
|
|
1011
1011
|
} = new MessageChannel();
|
|
1012
1012
|
await send(port1);
|
|
1013
|
-
return create$
|
|
1013
|
+
return create$7({
|
|
1014
1014
|
commandMap,
|
|
1015
|
+
isMessagePortOpen,
|
|
1015
1016
|
messagePort: port2
|
|
1016
1017
|
});
|
|
1017
1018
|
};
|
|
1018
1019
|
const TransferMessagePortRpcParent = {
|
|
1019
1020
|
__proto__: null,
|
|
1020
|
-
create: create$
|
|
1021
|
+
create: create$5
|
|
1021
1022
|
};
|
|
1022
1023
|
const create$2 = async ({
|
|
1023
1024
|
commandMap
|
|
@@ -1055,6 +1056,10 @@ const get$1 = id => {
|
|
|
1055
1056
|
|
|
1056
1057
|
const create$1 = rpcId => {
|
|
1057
1058
|
return {
|
|
1059
|
+
async dispose() {
|
|
1060
|
+
const rpc = get$1(rpcId);
|
|
1061
|
+
await rpc.dispose();
|
|
1062
|
+
},
|
|
1058
1063
|
// @ts-ignore
|
|
1059
1064
|
invoke(method, ...params) {
|
|
1060
1065
|
const rpc = get$1(rpcId);
|
|
@@ -1069,10 +1074,6 @@ const create$1 = rpcId => {
|
|
|
1069
1074
|
},
|
|
1070
1075
|
set(rpc) {
|
|
1071
1076
|
set$2(rpcId, rpc);
|
|
1072
|
-
},
|
|
1073
|
-
async dispose() {
|
|
1074
|
-
const rpc = get$1(rpcId);
|
|
1075
|
-
await rpc.dispose();
|
|
1076
1077
|
}
|
|
1077
1078
|
};
|
|
1078
1079
|
};
|
|
@@ -1080,7 +1081,8 @@ const create$1 = rpcId => {
|
|
|
1080
1081
|
const {
|
|
1081
1082
|
invoke: invoke$1,
|
|
1082
1083
|
invokeAndTransfer,
|
|
1083
|
-
set: set$1
|
|
1084
|
+
set: set$1
|
|
1085
|
+
} = create$1(RendererWorker);
|
|
1084
1086
|
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1085
1087
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1086
1088
|
// @ts-ignore
|
|
@@ -1104,13 +1106,18 @@ const createLazyRpc = rpcId => {
|
|
|
1104
1106
|
await rpcPromise;
|
|
1105
1107
|
};
|
|
1106
1108
|
return {
|
|
1107
|
-
setFactory(value) {
|
|
1108
|
-
factory = value;
|
|
1109
|
-
},
|
|
1110
1109
|
async invoke(method, ...params) {
|
|
1111
1110
|
await ensureRpc();
|
|
1112
1111
|
const rpc = get$1(rpcId);
|
|
1113
1112
|
return rpc.invoke(method, ...params);
|
|
1113
|
+
},
|
|
1114
|
+
async invokeAndTransfer(method, ...params) {
|
|
1115
|
+
await ensureRpc();
|
|
1116
|
+
const rpc = get$1(rpcId);
|
|
1117
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1118
|
+
},
|
|
1119
|
+
setFactory(value) {
|
|
1120
|
+
factory = value;
|
|
1114
1121
|
}
|
|
1115
1122
|
};
|
|
1116
1123
|
};
|
|
@@ -3244,6 +3251,21 @@ const Problems = {
|
|
|
3244
3251
|
viewAsTable
|
|
3245
3252
|
};
|
|
3246
3253
|
|
|
3254
|
+
const callbacks = Object.create(null);
|
|
3255
|
+
const registerCallbackCommand = async commandId => {
|
|
3256
|
+
const id = createId();
|
|
3257
|
+
const {
|
|
3258
|
+
promise,
|
|
3259
|
+
resolve
|
|
3260
|
+
} = Promise.withResolvers();
|
|
3261
|
+
callbacks[id] = resolve;
|
|
3262
|
+
// @ts-ignore
|
|
3263
|
+
await invoke$1(`Test.registerTestCommand`, commandId);
|
|
3264
|
+
return {
|
|
3265
|
+
promise
|
|
3266
|
+
};
|
|
3267
|
+
};
|
|
3268
|
+
|
|
3247
3269
|
const QuickPick$1 = 'QuickPick';
|
|
3248
3270
|
|
|
3249
3271
|
const open$1 = async () => {
|
|
@@ -3302,6 +3324,17 @@ const executeCommand = async label => {
|
|
|
3302
3324
|
// @ts-ignore
|
|
3303
3325
|
await invoke$1('QuickPick.selectItem', label);
|
|
3304
3326
|
};
|
|
3327
|
+
const selectItem2 = async ({
|
|
3328
|
+
callbackCommand,
|
|
3329
|
+
label
|
|
3330
|
+
}) => {
|
|
3331
|
+
const {
|
|
3332
|
+
promise
|
|
3333
|
+
} = await registerCallbackCommand(callbackCommand);
|
|
3334
|
+
// @ts-ignore
|
|
3335
|
+
invoke$1('QuickPick.selectItem', label);
|
|
3336
|
+
await promise;
|
|
3337
|
+
};
|
|
3305
3338
|
|
|
3306
3339
|
const QuickPick = {
|
|
3307
3340
|
__proto__: null,
|
|
@@ -3317,6 +3350,7 @@ const QuickPick = {
|
|
|
3317
3350
|
selectCurrentIndex,
|
|
3318
3351
|
selectIndex: selectIndex$3,
|
|
3319
3352
|
selectItem,
|
|
3353
|
+
selectItem2,
|
|
3320
3354
|
setValue: setValue$1
|
|
3321
3355
|
};
|
|
3322
3356
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-worker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.13.0",
|
|
4
4
|
"description": "Test Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/testWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lvce-editor/constants": "^
|
|
14
|
+
"@lvce-editor/constants": "^2.8.0"
|
|
15
15
|
},
|
|
16
16
|
"types": "dist/api.d.ts"
|
|
17
17
|
}
|