@lvce-editor/problems-view 1.14.0 → 1.16.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/problemsViewWorkerMain.js +234 -144
- package/package.json +1 -1
|
@@ -237,8 +237,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
237
237
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
238
238
|
const message = lines[messageIndex];
|
|
239
239
|
return {
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
241
|
+
message
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
244
|
const isModuleNotFoundError = stderr => {
|
|
@@ -261,14 +261,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
261
261
|
const getNativeModuleErrorMessage = stderr => {
|
|
262
262
|
const message = getMessageCodeBlock(stderr);
|
|
263
263
|
return {
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
265
|
+
message: `Incompatible native node module: ${message}`
|
|
266
266
|
};
|
|
267
267
|
};
|
|
268
268
|
const getModuleSyntaxError = () => {
|
|
269
269
|
return {
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
271
|
+
message: `ES Modules are not supported in electron`
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -287,8 +287,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
287
287
|
rest
|
|
288
288
|
} = getDetails(lines);
|
|
289
289
|
return {
|
|
290
|
-
message: actualMessage,
|
|
291
290
|
code: '',
|
|
291
|
+
message: actualMessage,
|
|
292
292
|
stack: rest
|
|
293
293
|
};
|
|
294
294
|
};
|
|
@@ -298,8 +298,8 @@ class IpcError extends VError {
|
|
|
298
298
|
if (stdout || stderr) {
|
|
299
299
|
// @ts-ignore
|
|
300
300
|
const {
|
|
301
|
-
message,
|
|
302
301
|
code,
|
|
302
|
+
message,
|
|
303
303
|
stack
|
|
304
304
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
305
305
|
const cause = new Error(message);
|
|
@@ -360,8 +360,8 @@ const wrap$f = global => {
|
|
|
360
360
|
};
|
|
361
361
|
const waitForFirstMessage = async port => {
|
|
362
362
|
const {
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
promise,
|
|
364
|
+
resolve
|
|
365
365
|
} = Promise.withResolvers();
|
|
366
366
|
port.addEventListener('message', resolve, {
|
|
367
367
|
once: true
|
|
@@ -381,8 +381,8 @@ const listen$6 = async () => {
|
|
|
381
381
|
const type = firstMessage.params[0];
|
|
382
382
|
if (type === 'message-port') {
|
|
383
383
|
parentIpc.send({
|
|
384
|
-
jsonrpc: '2.0',
|
|
385
384
|
id: firstMessage.id,
|
|
385
|
+
jsonrpc: '2.0',
|
|
386
386
|
result: null
|
|
387
387
|
});
|
|
388
388
|
parentIpc.dispose();
|
|
@@ -439,8 +439,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
439
439
|
};
|
|
440
440
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
441
441
|
const {
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
promise,
|
|
443
|
+
resolve
|
|
444
444
|
} = Promise.withResolvers();
|
|
445
445
|
const listenerMap = Object.create(null);
|
|
446
446
|
const cleanup = value => {
|
|
@@ -452,8 +452,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
452
452
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
453
453
|
const listener = event => {
|
|
454
454
|
cleanup({
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
event,
|
|
456
|
+
type
|
|
457
457
|
});
|
|
458
458
|
};
|
|
459
459
|
addListener(eventEmitter, event, listener);
|
|
@@ -462,9 +462,9 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
462
462
|
return promise;
|
|
463
463
|
};
|
|
464
464
|
const Message$1$1 = 3;
|
|
465
|
-
const create$5
|
|
466
|
-
|
|
467
|
-
|
|
465
|
+
const create$5 = async ({
|
|
466
|
+
isMessagePortOpen,
|
|
467
|
+
messagePort
|
|
468
468
|
}) => {
|
|
469
469
|
if (!isMessagePort(messagePort)) {
|
|
470
470
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -477,8 +477,8 @@ const create$5$1 = async ({
|
|
|
477
477
|
});
|
|
478
478
|
messagePort.start();
|
|
479
479
|
const {
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
event,
|
|
481
|
+
type
|
|
482
482
|
} = await eventPromise;
|
|
483
483
|
if (type !== Message$1$1) {
|
|
484
484
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -513,61 +513,19 @@ const wrap$5 = messagePort => {
|
|
|
513
513
|
};
|
|
514
514
|
const IpcParentWithMessagePort$1 = {
|
|
515
515
|
__proto__: null,
|
|
516
|
-
create: create$5
|
|
516
|
+
create: create$5,
|
|
517
517
|
signal: signal$1,
|
|
518
518
|
wrap: wrap$5
|
|
519
519
|
};
|
|
520
520
|
|
|
521
|
-
const Two = '2.0';
|
|
522
|
-
const create$4$1 = (method, params) => {
|
|
523
|
-
return {
|
|
524
|
-
jsonrpc: Two,
|
|
525
|
-
method,
|
|
526
|
-
params
|
|
527
|
-
};
|
|
528
|
-
};
|
|
521
|
+
const Two$1 = '2.0';
|
|
529
522
|
const callbacks = Object.create(null);
|
|
530
|
-
const set$6 = (id, fn) => {
|
|
531
|
-
callbacks[id] = fn;
|
|
532
|
-
};
|
|
533
523
|
const get$2 = id => {
|
|
534
524
|
return callbacks[id];
|
|
535
525
|
};
|
|
536
|
-
const remove = id => {
|
|
526
|
+
const remove$1 = id => {
|
|
537
527
|
delete callbacks[id];
|
|
538
528
|
};
|
|
539
|
-
let id = 0;
|
|
540
|
-
const create$3$1 = () => {
|
|
541
|
-
return ++id;
|
|
542
|
-
};
|
|
543
|
-
const registerPromise = () => {
|
|
544
|
-
const id = create$3$1();
|
|
545
|
-
const {
|
|
546
|
-
resolve,
|
|
547
|
-
promise
|
|
548
|
-
} = Promise.withResolvers();
|
|
549
|
-
set$6(id, resolve);
|
|
550
|
-
return {
|
|
551
|
-
id,
|
|
552
|
-
promise
|
|
553
|
-
};
|
|
554
|
-
};
|
|
555
|
-
const create$2$1 = (method, params) => {
|
|
556
|
-
const {
|
|
557
|
-
id,
|
|
558
|
-
promise
|
|
559
|
-
} = registerPromise();
|
|
560
|
-
const message = {
|
|
561
|
-
jsonrpc: Two,
|
|
562
|
-
method,
|
|
563
|
-
params,
|
|
564
|
-
id
|
|
565
|
-
};
|
|
566
|
-
return {
|
|
567
|
-
message,
|
|
568
|
-
promise
|
|
569
|
-
};
|
|
570
|
-
};
|
|
571
529
|
class JsonRpcError extends Error {
|
|
572
530
|
constructor(message) {
|
|
573
531
|
super(message);
|
|
@@ -718,7 +676,7 @@ const resolve = (id, response) => {
|
|
|
718
676
|
return;
|
|
719
677
|
}
|
|
720
678
|
fn(response);
|
|
721
|
-
remove(id);
|
|
679
|
+
remove$1(id);
|
|
722
680
|
};
|
|
723
681
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
724
682
|
const getErrorType = prettyError => {
|
|
@@ -761,9 +719,9 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
761
719
|
}
|
|
762
720
|
};
|
|
763
721
|
};
|
|
764
|
-
const create$1$
|
|
722
|
+
const create$1$2 = (id, error) => {
|
|
765
723
|
return {
|
|
766
|
-
jsonrpc: Two,
|
|
724
|
+
jsonrpc: Two$1,
|
|
767
725
|
id,
|
|
768
726
|
error
|
|
769
727
|
};
|
|
@@ -772,22 +730,22 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
772
730
|
const prettyError = preparePrettyError(error);
|
|
773
731
|
logError(error, prettyError);
|
|
774
732
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
775
|
-
return create$1$
|
|
733
|
+
return create$1$2(id, errorProperty);
|
|
776
734
|
};
|
|
777
|
-
const create$
|
|
735
|
+
const create$3 = (message, result) => {
|
|
778
736
|
return {
|
|
779
|
-
jsonrpc: Two,
|
|
737
|
+
jsonrpc: Two$1,
|
|
780
738
|
id: message.id,
|
|
781
739
|
result: result ?? null
|
|
782
740
|
};
|
|
783
741
|
};
|
|
784
742
|
const getSuccessResponse = (message, result) => {
|
|
785
743
|
const resultProperty = result ?? null;
|
|
786
|
-
return create$
|
|
744
|
+
return create$3(message, resultProperty);
|
|
787
745
|
};
|
|
788
746
|
const getErrorResponseSimple = (id, error) => {
|
|
789
747
|
return {
|
|
790
|
-
jsonrpc: Two,
|
|
748
|
+
jsonrpc: Two$1,
|
|
791
749
|
id,
|
|
792
750
|
error: {
|
|
793
751
|
code: Custom,
|
|
@@ -874,29 +832,6 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
874
832
|
}
|
|
875
833
|
throw new JsonRpcError('unexpected message');
|
|
876
834
|
};
|
|
877
|
-
const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
878
|
-
const {
|
|
879
|
-
message,
|
|
880
|
-
promise
|
|
881
|
-
} = create$2$1(method, params);
|
|
882
|
-
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
883
|
-
ipc.sendAndTransfer(message);
|
|
884
|
-
} else {
|
|
885
|
-
ipc.send(message);
|
|
886
|
-
}
|
|
887
|
-
const responseMessage = await promise;
|
|
888
|
-
return unwrapJsonRpcResult(responseMessage);
|
|
889
|
-
};
|
|
890
|
-
const send$1 = (transport, method, ...params) => {
|
|
891
|
-
const message = create$4$1(method, params);
|
|
892
|
-
transport.send(message);
|
|
893
|
-
};
|
|
894
|
-
const invoke$2 = (ipc, method, ...params) => {
|
|
895
|
-
return invokeHelper(ipc, method, params, false);
|
|
896
|
-
};
|
|
897
|
-
const invokeAndTransfer$2 = (ipc, method, ...params) => {
|
|
898
|
-
return invokeHelper(ipc, method, params, true);
|
|
899
|
-
};
|
|
900
835
|
|
|
901
836
|
class CommandNotFoundError extends Error {
|
|
902
837
|
constructor(command) {
|
|
@@ -919,24 +854,87 @@ const execute = (command, ...args) => {
|
|
|
919
854
|
return fn(...args);
|
|
920
855
|
};
|
|
921
856
|
|
|
857
|
+
const Two = '2.0';
|
|
858
|
+
const create$s = (method, params) => {
|
|
859
|
+
return {
|
|
860
|
+
jsonrpc: Two,
|
|
861
|
+
method,
|
|
862
|
+
params
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
const create$r = (id, method, params) => {
|
|
866
|
+
const message = {
|
|
867
|
+
id,
|
|
868
|
+
jsonrpc: Two,
|
|
869
|
+
method,
|
|
870
|
+
params
|
|
871
|
+
};
|
|
872
|
+
return message;
|
|
873
|
+
};
|
|
874
|
+
let id = 0;
|
|
875
|
+
const create$q = () => {
|
|
876
|
+
return ++id;
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
880
|
+
|
|
881
|
+
const registerPromise = map => {
|
|
882
|
+
const id = create$q();
|
|
883
|
+
const {
|
|
884
|
+
promise,
|
|
885
|
+
resolve
|
|
886
|
+
} = Promise.withResolvers();
|
|
887
|
+
map[id] = resolve;
|
|
888
|
+
return {
|
|
889
|
+
id,
|
|
890
|
+
promise
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
// @ts-ignore
|
|
895
|
+
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
896
|
+
const {
|
|
897
|
+
id,
|
|
898
|
+
promise
|
|
899
|
+
} = registerPromise(callbacks);
|
|
900
|
+
const message = create$r(id, method, params);
|
|
901
|
+
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
902
|
+
ipc.sendAndTransfer(message);
|
|
903
|
+
} else {
|
|
904
|
+
ipc.send(message);
|
|
905
|
+
}
|
|
906
|
+
const responseMessage = await promise;
|
|
907
|
+
return unwrapJsonRpcResult(responseMessage);
|
|
908
|
+
};
|
|
922
909
|
const createRpc = ipc => {
|
|
910
|
+
const callbacks = Object.create(null);
|
|
911
|
+
ipc._resolve = (id, response) => {
|
|
912
|
+
const fn = callbacks[id];
|
|
913
|
+
if (!fn) {
|
|
914
|
+
console.warn(`callback ${id} may already be disposed`);
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
fn(response);
|
|
918
|
+
delete callbacks[id];
|
|
919
|
+
};
|
|
923
920
|
const rpc = {
|
|
921
|
+
async dispose() {
|
|
922
|
+
await ipc?.dispose();
|
|
923
|
+
},
|
|
924
|
+
invoke(method, ...params) {
|
|
925
|
+
return invokeHelper(callbacks, ipc, method, params, false);
|
|
926
|
+
},
|
|
927
|
+
invokeAndTransfer(method, ...params) {
|
|
928
|
+
return invokeHelper(callbacks, ipc, method, params, true);
|
|
929
|
+
},
|
|
924
930
|
// @ts-ignore
|
|
925
931
|
ipc,
|
|
926
932
|
/**
|
|
927
933
|
* @deprecated
|
|
928
934
|
*/
|
|
929
935
|
send(method, ...params) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
invoke(method, ...params) {
|
|
933
|
-
return invoke$2(ipc, method, ...params);
|
|
934
|
-
},
|
|
935
|
-
invokeAndTransfer(method, ...params) {
|
|
936
|
-
return invokeAndTransfer$2(ipc, method, ...params);
|
|
937
|
-
},
|
|
938
|
-
async dispose() {
|
|
939
|
-
await ipc?.dispose();
|
|
936
|
+
const message = create$s(method, params);
|
|
937
|
+
ipc.send(message);
|
|
940
938
|
}
|
|
941
939
|
};
|
|
942
940
|
return rpc;
|
|
@@ -953,7 +951,7 @@ const logError = () => {
|
|
|
953
951
|
const handleMessage = event => {
|
|
954
952
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
955
953
|
const actualExecute = event?.target?.execute || execute;
|
|
956
|
-
return handleJsonRpcMessage(event.target, event.data, actualExecute,
|
|
954
|
+
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
957
955
|
};
|
|
958
956
|
const handleIpc = ipc => {
|
|
959
957
|
if ('addEventListener' in ipc) {
|
|
@@ -971,15 +969,16 @@ const listen$1 = async (module, options) => {
|
|
|
971
969
|
const ipc = module.wrap(rawIpc);
|
|
972
970
|
return ipc;
|
|
973
971
|
};
|
|
974
|
-
const create$
|
|
972
|
+
const create$4 = async ({
|
|
975
973
|
commandMap,
|
|
974
|
+
isMessagePortOpen = true,
|
|
976
975
|
messagePort
|
|
977
976
|
}) => {
|
|
978
977
|
// TODO create a commandMap per rpc instance
|
|
979
978
|
register(commandMap);
|
|
980
979
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
981
|
-
|
|
982
|
-
|
|
980
|
+
isMessagePortOpen,
|
|
981
|
+
messagePort
|
|
983
982
|
});
|
|
984
983
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
985
984
|
handleIpc(ipc);
|
|
@@ -987,8 +986,9 @@ const create$5 = async ({
|
|
|
987
986
|
messagePort.start();
|
|
988
987
|
return rpc;
|
|
989
988
|
};
|
|
990
|
-
const create$
|
|
989
|
+
const create$2$1 = async ({
|
|
991
990
|
commandMap,
|
|
991
|
+
isMessagePortOpen,
|
|
992
992
|
send
|
|
993
993
|
}) => {
|
|
994
994
|
const {
|
|
@@ -996,16 +996,17 @@ const create$3 = async ({
|
|
|
996
996
|
port2
|
|
997
997
|
} = new MessageChannel();
|
|
998
998
|
await send(port1);
|
|
999
|
-
return create$
|
|
999
|
+
return create$4({
|
|
1000
1000
|
commandMap,
|
|
1001
|
+
isMessagePortOpen,
|
|
1001
1002
|
messagePort: port2
|
|
1002
1003
|
});
|
|
1003
1004
|
};
|
|
1004
1005
|
const TransferMessagePortRpcParent = {
|
|
1005
1006
|
__proto__: null,
|
|
1006
|
-
create: create$
|
|
1007
|
+
create: create$2$1
|
|
1007
1008
|
};
|
|
1008
|
-
const create$
|
|
1009
|
+
const create$1$1 = async ({
|
|
1009
1010
|
commandMap
|
|
1010
1011
|
}) => {
|
|
1011
1012
|
// TODO create a commandMap per rpc instance
|
|
@@ -1017,7 +1018,7 @@ const create$4 = async ({
|
|
|
1017
1018
|
};
|
|
1018
1019
|
const WebWorkerRpcClient = {
|
|
1019
1020
|
__proto__: null,
|
|
1020
|
-
create: create$
|
|
1021
|
+
create: create$1$1
|
|
1021
1022
|
};
|
|
1022
1023
|
const createMockRpc = ({
|
|
1023
1024
|
commandMap
|
|
@@ -1032,9 +1033,9 @@ const createMockRpc = ({
|
|
|
1032
1033
|
return command(...params);
|
|
1033
1034
|
};
|
|
1034
1035
|
const mockRpc = {
|
|
1036
|
+
invocations,
|
|
1035
1037
|
invoke,
|
|
1036
|
-
invokeAndTransfer: invoke
|
|
1037
|
-
invocations
|
|
1038
|
+
invokeAndTransfer: invoke
|
|
1038
1039
|
};
|
|
1039
1040
|
return mockRpc;
|
|
1040
1041
|
};
|
|
@@ -1149,6 +1150,8 @@ const DownArrow = 16;
|
|
|
1149
1150
|
|
|
1150
1151
|
const Script$1 = 2;
|
|
1151
1152
|
|
|
1153
|
+
const ProblemsFilter$1 = 25;
|
|
1154
|
+
|
|
1152
1155
|
const DebugWorker = 55;
|
|
1153
1156
|
const EditorWorker$1 = 99;
|
|
1154
1157
|
const RendererWorker$1 = 1;
|
|
@@ -1160,9 +1163,17 @@ const set$5 = (id, rpc) => {
|
|
|
1160
1163
|
const get$1 = id => {
|
|
1161
1164
|
return rpcs[id];
|
|
1162
1165
|
};
|
|
1166
|
+
const remove = id => {
|
|
1167
|
+
delete rpcs[id];
|
|
1168
|
+
};
|
|
1163
1169
|
|
|
1170
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1164
1171
|
const create$1 = rpcId => {
|
|
1165
1172
|
return {
|
|
1173
|
+
async dispose() {
|
|
1174
|
+
const rpc = get$1(rpcId);
|
|
1175
|
+
await rpc.dispose();
|
|
1176
|
+
},
|
|
1166
1177
|
// @ts-ignore
|
|
1167
1178
|
invoke(method, ...params) {
|
|
1168
1179
|
const rpc = get$1(rpcId);
|
|
@@ -1175,21 +1186,30 @@ const create$1 = rpcId => {
|
|
|
1175
1186
|
// @ts-ignore
|
|
1176
1187
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1177
1188
|
},
|
|
1189
|
+
registerMockRpc(commandMap) {
|
|
1190
|
+
const mockRpc = createMockRpc({
|
|
1191
|
+
commandMap
|
|
1192
|
+
});
|
|
1193
|
+
set$5(rpcId, mockRpc);
|
|
1194
|
+
// @ts-ignore
|
|
1195
|
+
mockRpc[Symbol.dispose] = () => {
|
|
1196
|
+
remove(rpcId);
|
|
1197
|
+
};
|
|
1198
|
+
// @ts-ignore
|
|
1199
|
+
return mockRpc;
|
|
1200
|
+
},
|
|
1178
1201
|
set(rpc) {
|
|
1179
1202
|
set$5(rpcId, rpc);
|
|
1180
|
-
},
|
|
1181
|
-
async dispose() {
|
|
1182
|
-
const rpc = get$1(rpcId);
|
|
1183
|
-
await rpc.dispose();
|
|
1184
1203
|
}
|
|
1185
1204
|
};
|
|
1186
1205
|
};
|
|
1187
1206
|
|
|
1188
1207
|
const {
|
|
1208
|
+
dispose: dispose$1,
|
|
1189
1209
|
invoke: invoke$1,
|
|
1190
1210
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1191
|
-
|
|
1192
|
-
|
|
1211
|
+
registerMockRpc: registerMockRpc$1,
|
|
1212
|
+
set: set$4
|
|
1193
1213
|
} = create$1(EditorWorker$1);
|
|
1194
1214
|
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1195
1215
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
@@ -1206,6 +1226,10 @@ const applyEdit = async (editorUid, changes) => {
|
|
|
1206
1226
|
// @ts-ignore
|
|
1207
1227
|
await invoke$1('Editor.applyEdit2', editorUid, changes);
|
|
1208
1228
|
};
|
|
1229
|
+
const applyDocumentEdits = async (editorUid, changes) => {
|
|
1230
|
+
// @ts-ignore
|
|
1231
|
+
await invoke$1('Editor.applyDocumentEdits', editorUid, changes);
|
|
1232
|
+
};
|
|
1209
1233
|
const applyWorkspaceEdit = async (editorUid, changes) => {
|
|
1210
1234
|
// @ts-ignore
|
|
1211
1235
|
await invoke$1('Editor.applyWorkspaceEdit', editorUid, changes);
|
|
@@ -1238,6 +1262,9 @@ const getSelections = async editorUid => {
|
|
|
1238
1262
|
const getWordAtOffset2 = async editorUid => {
|
|
1239
1263
|
return invoke$1('Editor.getWordAtOffset2', editorUid);
|
|
1240
1264
|
};
|
|
1265
|
+
const closeFind2 = async editorUid => {
|
|
1266
|
+
return invoke$1('Editor.closeFind2', editorUid);
|
|
1267
|
+
};
|
|
1241
1268
|
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
1242
1269
|
return invoke$1('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
|
|
1243
1270
|
};
|
|
@@ -1256,19 +1283,14 @@ const getProblems$2 = async () => {
|
|
|
1256
1283
|
// @ts-ignore
|
|
1257
1284
|
return invoke$1('Editor.getProblems');
|
|
1258
1285
|
};
|
|
1259
|
-
const registerMockRpc$1 = commandMap => {
|
|
1260
|
-
const mockRpc = createMockRpc({
|
|
1261
|
-
commandMap
|
|
1262
|
-
});
|
|
1263
|
-
set$4(mockRpc);
|
|
1264
|
-
return mockRpc;
|
|
1265
|
-
};
|
|
1266
1286
|
|
|
1267
1287
|
const EditorWorker = {
|
|
1268
1288
|
__proto__: null,
|
|
1269
1289
|
activateByEvent: activateByEvent$1,
|
|
1290
|
+
applyDocumentEdits,
|
|
1270
1291
|
applyEdit,
|
|
1271
1292
|
applyWorkspaceEdit,
|
|
1293
|
+
closeFind2,
|
|
1272
1294
|
closeWidget: closeWidget$1,
|
|
1273
1295
|
dispose: dispose$1,
|
|
1274
1296
|
getLanguageId,
|
|
@@ -1290,10 +1312,11 @@ const EditorWorker = {
|
|
|
1290
1312
|
};
|
|
1291
1313
|
|
|
1292
1314
|
const {
|
|
1315
|
+
dispose,
|
|
1293
1316
|
invoke,
|
|
1294
1317
|
invokeAndTransfer,
|
|
1295
|
-
|
|
1296
|
-
|
|
1318
|
+
registerMockRpc,
|
|
1319
|
+
set: set$3
|
|
1297
1320
|
} = create$1(RendererWorker$1);
|
|
1298
1321
|
const searchFileHtml = async uri => {
|
|
1299
1322
|
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
@@ -1416,6 +1439,10 @@ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
|
1416
1439
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1417
1440
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1418
1441
|
};
|
|
1442
|
+
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1443
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1444
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1445
|
+
};
|
|
1419
1446
|
const sendMessagePortToSearchProcess = async port => {
|
|
1420
1447
|
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1421
1448
|
};
|
|
@@ -1460,8 +1487,8 @@ const getIcons = async requests => {
|
|
|
1460
1487
|
const icons = await invoke('IconTheme.getIcons', requests);
|
|
1461
1488
|
return icons;
|
|
1462
1489
|
};
|
|
1463
|
-
const activateByEvent = event => {
|
|
1464
|
-
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
1490
|
+
const activateByEvent = (event, assetDir, platform) => {
|
|
1491
|
+
return invoke('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1465
1492
|
};
|
|
1466
1493
|
const setAdditionalFocus = focusKey => {
|
|
1467
1494
|
// @ts-ignore
|
|
@@ -1489,10 +1516,23 @@ const sendMessagePortToSourceControlWorker = async port => {
|
|
|
1489
1516
|
// @ts-ignore
|
|
1490
1517
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1491
1518
|
};
|
|
1519
|
+
const sendMessagePortToSharedProcess = async port => {
|
|
1520
|
+
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1521
|
+
// @ts-ignore
|
|
1522
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1523
|
+
};
|
|
1492
1524
|
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1493
1525
|
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1494
1526
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1495
1527
|
};
|
|
1528
|
+
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1529
|
+
const command = 'Iframes.handleMessagePort';
|
|
1530
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1531
|
+
};
|
|
1532
|
+
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1533
|
+
const command = 'Extensions.handleMessagePort';
|
|
1534
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1535
|
+
};
|
|
1496
1536
|
const getPreference = async key => {
|
|
1497
1537
|
return await invoke('Preferences.get', key);
|
|
1498
1538
|
};
|
|
@@ -1558,6 +1598,22 @@ const installExtension = async id => {
|
|
|
1558
1598
|
// @ts-ignore
|
|
1559
1599
|
return invoke('ExtensionManagement.install', id);
|
|
1560
1600
|
};
|
|
1601
|
+
const minimizeWindow = async () => {
|
|
1602
|
+
// @ts-ignore
|
|
1603
|
+
return invoke('ElectronWindow.minimize');
|
|
1604
|
+
};
|
|
1605
|
+
const unmaximizeWindow = async () => {
|
|
1606
|
+
// @ts-ignore
|
|
1607
|
+
return invoke('ElectronWindow.unmaximize');
|
|
1608
|
+
};
|
|
1609
|
+
const maximizeWindow = async () => {
|
|
1610
|
+
// @ts-ignore
|
|
1611
|
+
return invoke('ElectronWindow.maximize');
|
|
1612
|
+
};
|
|
1613
|
+
const closeWindow = async () => {
|
|
1614
|
+
// @ts-ignore
|
|
1615
|
+
return invoke('ElectronWindow.close');
|
|
1616
|
+
};
|
|
1561
1617
|
const openExtensionSearch = async () => {
|
|
1562
1618
|
// @ts-ignore
|
|
1563
1619
|
return invoke('SideBar.openViewlet', 'Extensions');
|
|
@@ -1589,12 +1645,8 @@ const getLogsDir = async () => {
|
|
|
1589
1645
|
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1590
1646
|
return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1591
1647
|
};
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
commandMap
|
|
1595
|
-
});
|
|
1596
|
-
set$3(mockRpc);
|
|
1597
|
-
return mockRpc;
|
|
1648
|
+
const refreshOutput = async () => {
|
|
1649
|
+
await invoke('Output.refresh');
|
|
1598
1650
|
};
|
|
1599
1651
|
|
|
1600
1652
|
const RendererWorker = {
|
|
@@ -1602,6 +1654,7 @@ const RendererWorker = {
|
|
|
1602
1654
|
activateByEvent,
|
|
1603
1655
|
applyBulkReplacement,
|
|
1604
1656
|
closeWidget,
|
|
1657
|
+
closeWindow,
|
|
1605
1658
|
confirm,
|
|
1606
1659
|
disableExtension,
|
|
1607
1660
|
dispose,
|
|
@@ -1639,7 +1692,9 @@ const RendererWorker = {
|
|
|
1639
1692
|
installExtension,
|
|
1640
1693
|
invoke,
|
|
1641
1694
|
invokeAndTransfer,
|
|
1695
|
+
maximizeWindow,
|
|
1642
1696
|
measureTextBlockHeight,
|
|
1697
|
+
minimizeWindow,
|
|
1643
1698
|
openExtensionSearch,
|
|
1644
1699
|
openExternal,
|
|
1645
1700
|
openNativeFolder,
|
|
@@ -1648,6 +1703,7 @@ const RendererWorker = {
|
|
|
1648
1703
|
openWidget,
|
|
1649
1704
|
readClipBoardText,
|
|
1650
1705
|
readFile,
|
|
1706
|
+
refreshOutput,
|
|
1651
1707
|
registerMockRpc,
|
|
1652
1708
|
registerWebViewInterceptor,
|
|
1653
1709
|
renderMarkdown,
|
|
@@ -1658,12 +1714,16 @@ const RendererWorker = {
|
|
|
1658
1714
|
sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
|
|
1659
1715
|
sendMessagePortToErrorWorker,
|
|
1660
1716
|
sendMessagePortToExtensionHostWorker,
|
|
1717
|
+
sendMessagePortToExtensionManagementWorker,
|
|
1718
|
+
sendMessagePortToFileSearchWorker,
|
|
1661
1719
|
sendMessagePortToFileSystemProcess,
|
|
1662
1720
|
sendMessagePortToFileSystemWorker,
|
|
1663
1721
|
sendMessagePortToIconThemeWorker,
|
|
1722
|
+
sendMessagePortToIframeWorker,
|
|
1664
1723
|
sendMessagePortToMarkdownWorker,
|
|
1665
1724
|
sendMessagePortToRendererProcess,
|
|
1666
1725
|
sendMessagePortToSearchProcess,
|
|
1726
|
+
sendMessagePortToSharedProcess,
|
|
1667
1727
|
sendMessagePortToSourceControlWorker,
|
|
1668
1728
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1669
1729
|
sendMessagePortToTextMeasurementWorker,
|
|
@@ -1680,6 +1740,7 @@ const RendererWorker = {
|
|
|
1680
1740
|
showMessageBox,
|
|
1681
1741
|
showSaveFilePicker,
|
|
1682
1742
|
uninstallExtension,
|
|
1743
|
+
unmaximizeWindow,
|
|
1683
1744
|
unregisterWebViewInterceptor,
|
|
1684
1745
|
writeClipBoardImage,
|
|
1685
1746
|
writeClipBoardText: writeClipBoardText$1
|
|
@@ -1802,9 +1863,9 @@ const mergeClassNames = (...classNames) => {
|
|
|
1802
1863
|
|
|
1803
1864
|
const text = data => {
|
|
1804
1865
|
return {
|
|
1805
|
-
|
|
1866
|
+
childCount: 0,
|
|
1806
1867
|
text: data,
|
|
1807
|
-
|
|
1868
|
+
type: Text
|
|
1808
1869
|
};
|
|
1809
1870
|
};
|
|
1810
1871
|
|
|
@@ -1858,6 +1919,10 @@ const getKeyBindings = () => {
|
|
|
1858
1919
|
}];
|
|
1859
1920
|
};
|
|
1860
1921
|
|
|
1922
|
+
const getMenuIds = () => {
|
|
1923
|
+
return [ProblemsFilter$1];
|
|
1924
|
+
};
|
|
1925
|
+
|
|
1861
1926
|
const Item = 0;
|
|
1862
1927
|
const Expanded = 1;
|
|
1863
1928
|
const Collapsed = 2;
|
|
@@ -1960,7 +2025,27 @@ const handleClickButton = async (state, name) => {
|
|
|
1960
2025
|
return state;
|
|
1961
2026
|
};
|
|
1962
2027
|
|
|
2028
|
+
const show2 = async (uid, menuId, x, y, args) => {
|
|
2029
|
+
await showContextMenu2(uid, menuId, x, y, args);
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
const handleClickMoreFilters = async (state, eventX, eventY) => {
|
|
2033
|
+
const {
|
|
2034
|
+
uid
|
|
2035
|
+
} = state;
|
|
2036
|
+
await show2(uid, ProblemsFilter$1, eventX, eventY, {
|
|
2037
|
+
menuId: ProblemsFilter$1
|
|
2038
|
+
});
|
|
2039
|
+
return state;
|
|
2040
|
+
};
|
|
2041
|
+
|
|
1963
2042
|
const handleContextMenu = async (state, eventX, eventY) => {
|
|
2043
|
+
const {
|
|
2044
|
+
uid
|
|
2045
|
+
} = state;
|
|
2046
|
+
await show2(uid, ProblemsFilter$1, eventX, eventY, {
|
|
2047
|
+
menuId: ProblemsFilter$1
|
|
2048
|
+
});
|
|
1964
2049
|
return state;
|
|
1965
2050
|
};
|
|
1966
2051
|
|
|
@@ -2285,6 +2370,7 @@ const HandleClearFilterClick = 'handleClearFilterClick';
|
|
|
2285
2370
|
const HandleContextMenu = 'handleContextMenu';
|
|
2286
2371
|
const HandleFilterInput = 'handleFilterInput';
|
|
2287
2372
|
const HandlePointerDown = 'handlePointerDown';
|
|
2373
|
+
const HandleClickMoreFilters = 'handleClickMoreFilters';
|
|
2288
2374
|
|
|
2289
2375
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2290
2376
|
return {
|
|
@@ -2355,8 +2441,7 @@ const getProblemsFilterVirtualDom = action => {
|
|
|
2355
2441
|
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
|
|
2356
2442
|
command: 'more filters',
|
|
2357
2443
|
icon: Filter,
|
|
2358
|
-
id: 'more filters'
|
|
2359
|
-
})];
|
|
2444
|
+
id: 'more filters'})];
|
|
2360
2445
|
};
|
|
2361
2446
|
|
|
2362
2447
|
const getNoResultsWithFilterVirtualDom = () => {
|
|
@@ -2906,6 +2991,9 @@ const renderEventListeners = () => {
|
|
|
2906
2991
|
}, {
|
|
2907
2992
|
name: HandlePointerDown,
|
|
2908
2993
|
params: ['handleClickAt', 'event.clientX', 'event.clientY']
|
|
2994
|
+
}, {
|
|
2995
|
+
name: HandleClickMoreFilters,
|
|
2996
|
+
params: ['handleClickMoreFilters']
|
|
2909
2997
|
}];
|
|
2910
2998
|
};
|
|
2911
2999
|
|
|
@@ -2950,10 +3038,12 @@ const commandMap = {
|
|
|
2950
3038
|
'Problems.focusIndex': wrapCommand(focusIndex),
|
|
2951
3039
|
'Problems.getCommandIds': getCommandIds,
|
|
2952
3040
|
'Problems.getKeyBindings': getKeyBindings,
|
|
3041
|
+
'Problems.getMenuIds': getMenuIds,
|
|
2953
3042
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
2954
3043
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
2955
3044
|
'Problems.handleClickAt': wrapCommand(handleClickAt),
|
|
2956
3045
|
'Problems.handleClickButton': wrapCommand(handleClickButton),
|
|
3046
|
+
'Problems.handleClickMoreFilters': wrapCommand(handleClickMoreFilters),
|
|
2957
3047
|
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2958
3048
|
'Problems.handleFilterInput': wrapCommand(handleFilterInput),
|
|
2959
3049
|
'Problems.handleIconThemeChange': wrapCommand(handleIconThemeChange),
|