@lvce-editor/problems-view 1.14.0 → 1.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/problemsViewWorkerMain.js +235 -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,9 @@ const DownArrow = 16;
|
|
|
1149
1150
|
|
|
1150
1151
|
const Script$1 = 2;
|
|
1151
1152
|
|
|
1153
|
+
const ManageExtension = 8;
|
|
1154
|
+
const ProblemsFilter$1 = 25;
|
|
1155
|
+
|
|
1152
1156
|
const DebugWorker = 55;
|
|
1153
1157
|
const EditorWorker$1 = 99;
|
|
1154
1158
|
const RendererWorker$1 = 1;
|
|
@@ -1160,9 +1164,17 @@ const set$5 = (id, rpc) => {
|
|
|
1160
1164
|
const get$1 = id => {
|
|
1161
1165
|
return rpcs[id];
|
|
1162
1166
|
};
|
|
1167
|
+
const remove = id => {
|
|
1168
|
+
delete rpcs[id];
|
|
1169
|
+
};
|
|
1163
1170
|
|
|
1171
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1164
1172
|
const create$1 = rpcId => {
|
|
1165
1173
|
return {
|
|
1174
|
+
async dispose() {
|
|
1175
|
+
const rpc = get$1(rpcId);
|
|
1176
|
+
await rpc.dispose();
|
|
1177
|
+
},
|
|
1166
1178
|
// @ts-ignore
|
|
1167
1179
|
invoke(method, ...params) {
|
|
1168
1180
|
const rpc = get$1(rpcId);
|
|
@@ -1175,21 +1187,30 @@ const create$1 = rpcId => {
|
|
|
1175
1187
|
// @ts-ignore
|
|
1176
1188
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1177
1189
|
},
|
|
1190
|
+
registerMockRpc(commandMap) {
|
|
1191
|
+
const mockRpc = createMockRpc({
|
|
1192
|
+
commandMap
|
|
1193
|
+
});
|
|
1194
|
+
set$5(rpcId, mockRpc);
|
|
1195
|
+
// @ts-ignore
|
|
1196
|
+
mockRpc[Symbol.dispose] = () => {
|
|
1197
|
+
remove(rpcId);
|
|
1198
|
+
};
|
|
1199
|
+
// @ts-ignore
|
|
1200
|
+
return mockRpc;
|
|
1201
|
+
},
|
|
1178
1202
|
set(rpc) {
|
|
1179
1203
|
set$5(rpcId, rpc);
|
|
1180
|
-
},
|
|
1181
|
-
async dispose() {
|
|
1182
|
-
const rpc = get$1(rpcId);
|
|
1183
|
-
await rpc.dispose();
|
|
1184
1204
|
}
|
|
1185
1205
|
};
|
|
1186
1206
|
};
|
|
1187
1207
|
|
|
1188
1208
|
const {
|
|
1209
|
+
dispose: dispose$1,
|
|
1189
1210
|
invoke: invoke$1,
|
|
1190
1211
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1191
|
-
|
|
1192
|
-
|
|
1212
|
+
registerMockRpc: registerMockRpc$1,
|
|
1213
|
+
set: set$4
|
|
1193
1214
|
} = create$1(EditorWorker$1);
|
|
1194
1215
|
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1195
1216
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
@@ -1206,6 +1227,10 @@ const applyEdit = async (editorUid, changes) => {
|
|
|
1206
1227
|
// @ts-ignore
|
|
1207
1228
|
await invoke$1('Editor.applyEdit2', editorUid, changes);
|
|
1208
1229
|
};
|
|
1230
|
+
const applyDocumentEdits = async (editorUid, changes) => {
|
|
1231
|
+
// @ts-ignore
|
|
1232
|
+
await invoke$1('Editor.applyDocumentEdits', editorUid, changes);
|
|
1233
|
+
};
|
|
1209
1234
|
const applyWorkspaceEdit = async (editorUid, changes) => {
|
|
1210
1235
|
// @ts-ignore
|
|
1211
1236
|
await invoke$1('Editor.applyWorkspaceEdit', editorUid, changes);
|
|
@@ -1238,6 +1263,9 @@ const getSelections = async editorUid => {
|
|
|
1238
1263
|
const getWordAtOffset2 = async editorUid => {
|
|
1239
1264
|
return invoke$1('Editor.getWordAtOffset2', editorUid);
|
|
1240
1265
|
};
|
|
1266
|
+
const closeFind2 = async editorUid => {
|
|
1267
|
+
return invoke$1('Editor.closeFind2', editorUid);
|
|
1268
|
+
};
|
|
1241
1269
|
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
1242
1270
|
return invoke$1('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
|
|
1243
1271
|
};
|
|
@@ -1256,19 +1284,14 @@ const getProblems$2 = async () => {
|
|
|
1256
1284
|
// @ts-ignore
|
|
1257
1285
|
return invoke$1('Editor.getProblems');
|
|
1258
1286
|
};
|
|
1259
|
-
const registerMockRpc$1 = commandMap => {
|
|
1260
|
-
const mockRpc = createMockRpc({
|
|
1261
|
-
commandMap
|
|
1262
|
-
});
|
|
1263
|
-
set$4(mockRpc);
|
|
1264
|
-
return mockRpc;
|
|
1265
|
-
};
|
|
1266
1287
|
|
|
1267
1288
|
const EditorWorker = {
|
|
1268
1289
|
__proto__: null,
|
|
1269
1290
|
activateByEvent: activateByEvent$1,
|
|
1291
|
+
applyDocumentEdits,
|
|
1270
1292
|
applyEdit,
|
|
1271
1293
|
applyWorkspaceEdit,
|
|
1294
|
+
closeFind2,
|
|
1272
1295
|
closeWidget: closeWidget$1,
|
|
1273
1296
|
dispose: dispose$1,
|
|
1274
1297
|
getLanguageId,
|
|
@@ -1290,10 +1313,11 @@ const EditorWorker = {
|
|
|
1290
1313
|
};
|
|
1291
1314
|
|
|
1292
1315
|
const {
|
|
1316
|
+
dispose,
|
|
1293
1317
|
invoke,
|
|
1294
1318
|
invokeAndTransfer,
|
|
1295
|
-
|
|
1296
|
-
|
|
1319
|
+
registerMockRpc,
|
|
1320
|
+
set: set$3
|
|
1297
1321
|
} = create$1(RendererWorker$1);
|
|
1298
1322
|
const searchFileHtml = async uri => {
|
|
1299
1323
|
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
@@ -1416,6 +1440,10 @@ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
|
1416
1440
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1417
1441
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1418
1442
|
};
|
|
1443
|
+
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1444
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1445
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1446
|
+
};
|
|
1419
1447
|
const sendMessagePortToSearchProcess = async port => {
|
|
1420
1448
|
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1421
1449
|
};
|
|
@@ -1460,8 +1488,8 @@ const getIcons = async requests => {
|
|
|
1460
1488
|
const icons = await invoke('IconTheme.getIcons', requests);
|
|
1461
1489
|
return icons;
|
|
1462
1490
|
};
|
|
1463
|
-
const activateByEvent = event => {
|
|
1464
|
-
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
1491
|
+
const activateByEvent = (event, assetDir, platform) => {
|
|
1492
|
+
return invoke('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1465
1493
|
};
|
|
1466
1494
|
const setAdditionalFocus = focusKey => {
|
|
1467
1495
|
// @ts-ignore
|
|
@@ -1489,10 +1517,23 @@ const sendMessagePortToSourceControlWorker = async port => {
|
|
|
1489
1517
|
// @ts-ignore
|
|
1490
1518
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1491
1519
|
};
|
|
1520
|
+
const sendMessagePortToSharedProcess = async port => {
|
|
1521
|
+
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1522
|
+
// @ts-ignore
|
|
1523
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1524
|
+
};
|
|
1492
1525
|
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1493
1526
|
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1494
1527
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1495
1528
|
};
|
|
1529
|
+
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1530
|
+
const command = 'Iframes.handleMessagePort';
|
|
1531
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1532
|
+
};
|
|
1533
|
+
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1534
|
+
const command = 'Extensions.handleMessagePort';
|
|
1535
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1536
|
+
};
|
|
1496
1537
|
const getPreference = async key => {
|
|
1497
1538
|
return await invoke('Preferences.get', key);
|
|
1498
1539
|
};
|
|
@@ -1558,6 +1599,22 @@ const installExtension = async id => {
|
|
|
1558
1599
|
// @ts-ignore
|
|
1559
1600
|
return invoke('ExtensionManagement.install', id);
|
|
1560
1601
|
};
|
|
1602
|
+
const minimizeWindow = async () => {
|
|
1603
|
+
// @ts-ignore
|
|
1604
|
+
return invoke('ElectronWindow.minimize');
|
|
1605
|
+
};
|
|
1606
|
+
const unmaximizeWindow = async () => {
|
|
1607
|
+
// @ts-ignore
|
|
1608
|
+
return invoke('ElectronWindow.unmaximize');
|
|
1609
|
+
};
|
|
1610
|
+
const maximizeWindow = async () => {
|
|
1611
|
+
// @ts-ignore
|
|
1612
|
+
return invoke('ElectronWindow.maximize');
|
|
1613
|
+
};
|
|
1614
|
+
const closeWindow = async () => {
|
|
1615
|
+
// @ts-ignore
|
|
1616
|
+
return invoke('ElectronWindow.close');
|
|
1617
|
+
};
|
|
1561
1618
|
const openExtensionSearch = async () => {
|
|
1562
1619
|
// @ts-ignore
|
|
1563
1620
|
return invoke('SideBar.openViewlet', 'Extensions');
|
|
@@ -1589,12 +1646,8 @@ const getLogsDir = async () => {
|
|
|
1589
1646
|
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1590
1647
|
return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1591
1648
|
};
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
commandMap
|
|
1595
|
-
});
|
|
1596
|
-
set$3(mockRpc);
|
|
1597
|
-
return mockRpc;
|
|
1649
|
+
const refreshOutput = async () => {
|
|
1650
|
+
await invoke('Output.refresh');
|
|
1598
1651
|
};
|
|
1599
1652
|
|
|
1600
1653
|
const RendererWorker = {
|
|
@@ -1602,6 +1655,7 @@ const RendererWorker = {
|
|
|
1602
1655
|
activateByEvent,
|
|
1603
1656
|
applyBulkReplacement,
|
|
1604
1657
|
closeWidget,
|
|
1658
|
+
closeWindow,
|
|
1605
1659
|
confirm,
|
|
1606
1660
|
disableExtension,
|
|
1607
1661
|
dispose,
|
|
@@ -1639,7 +1693,9 @@ const RendererWorker = {
|
|
|
1639
1693
|
installExtension,
|
|
1640
1694
|
invoke,
|
|
1641
1695
|
invokeAndTransfer,
|
|
1696
|
+
maximizeWindow,
|
|
1642
1697
|
measureTextBlockHeight,
|
|
1698
|
+
minimizeWindow,
|
|
1643
1699
|
openExtensionSearch,
|
|
1644
1700
|
openExternal,
|
|
1645
1701
|
openNativeFolder,
|
|
@@ -1648,6 +1704,7 @@ const RendererWorker = {
|
|
|
1648
1704
|
openWidget,
|
|
1649
1705
|
readClipBoardText,
|
|
1650
1706
|
readFile,
|
|
1707
|
+
refreshOutput,
|
|
1651
1708
|
registerMockRpc,
|
|
1652
1709
|
registerWebViewInterceptor,
|
|
1653
1710
|
renderMarkdown,
|
|
@@ -1658,12 +1715,16 @@ const RendererWorker = {
|
|
|
1658
1715
|
sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
|
|
1659
1716
|
sendMessagePortToErrorWorker,
|
|
1660
1717
|
sendMessagePortToExtensionHostWorker,
|
|
1718
|
+
sendMessagePortToExtensionManagementWorker,
|
|
1719
|
+
sendMessagePortToFileSearchWorker,
|
|
1661
1720
|
sendMessagePortToFileSystemProcess,
|
|
1662
1721
|
sendMessagePortToFileSystemWorker,
|
|
1663
1722
|
sendMessagePortToIconThemeWorker,
|
|
1723
|
+
sendMessagePortToIframeWorker,
|
|
1664
1724
|
sendMessagePortToMarkdownWorker,
|
|
1665
1725
|
sendMessagePortToRendererProcess,
|
|
1666
1726
|
sendMessagePortToSearchProcess,
|
|
1727
|
+
sendMessagePortToSharedProcess,
|
|
1667
1728
|
sendMessagePortToSourceControlWorker,
|
|
1668
1729
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1669
1730
|
sendMessagePortToTextMeasurementWorker,
|
|
@@ -1680,6 +1741,7 @@ const RendererWorker = {
|
|
|
1680
1741
|
showMessageBox,
|
|
1681
1742
|
showSaveFilePicker,
|
|
1682
1743
|
uninstallExtension,
|
|
1744
|
+
unmaximizeWindow,
|
|
1683
1745
|
unregisterWebViewInterceptor,
|
|
1684
1746
|
writeClipBoardImage,
|
|
1685
1747
|
writeClipBoardText: writeClipBoardText$1
|
|
@@ -1802,9 +1864,9 @@ const mergeClassNames = (...classNames) => {
|
|
|
1802
1864
|
|
|
1803
1865
|
const text = data => {
|
|
1804
1866
|
return {
|
|
1805
|
-
|
|
1867
|
+
childCount: 0,
|
|
1806
1868
|
text: data,
|
|
1807
|
-
|
|
1869
|
+
type: Text
|
|
1808
1870
|
};
|
|
1809
1871
|
};
|
|
1810
1872
|
|
|
@@ -1858,6 +1920,10 @@ const getKeyBindings = () => {
|
|
|
1858
1920
|
}];
|
|
1859
1921
|
};
|
|
1860
1922
|
|
|
1923
|
+
const getMenuIds = () => {
|
|
1924
|
+
return [ManageExtension, ProblemsFilter$1];
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1861
1927
|
const Item = 0;
|
|
1862
1928
|
const Expanded = 1;
|
|
1863
1929
|
const Collapsed = 2;
|
|
@@ -1960,7 +2026,27 @@ const handleClickButton = async (state, name) => {
|
|
|
1960
2026
|
return state;
|
|
1961
2027
|
};
|
|
1962
2028
|
|
|
2029
|
+
const show2 = async (uid, menuId, x, y, args) => {
|
|
2030
|
+
await showContextMenu2(uid, menuId, x, y, args);
|
|
2031
|
+
};
|
|
2032
|
+
|
|
2033
|
+
const handleClickMoreFilters = async (state, eventX, eventY) => {
|
|
2034
|
+
const {
|
|
2035
|
+
uid
|
|
2036
|
+
} = state;
|
|
2037
|
+
await show2(uid, ProblemsFilter$1, eventX, eventY, {
|
|
2038
|
+
menuId: ProblemsFilter$1
|
|
2039
|
+
});
|
|
2040
|
+
return state;
|
|
2041
|
+
};
|
|
2042
|
+
|
|
1963
2043
|
const handleContextMenu = async (state, eventX, eventY) => {
|
|
2044
|
+
const {
|
|
2045
|
+
uid
|
|
2046
|
+
} = state;
|
|
2047
|
+
await show2(uid, ProblemsFilter$1, eventX, eventY, {
|
|
2048
|
+
menuId: ProblemsFilter$1
|
|
2049
|
+
});
|
|
1964
2050
|
return state;
|
|
1965
2051
|
};
|
|
1966
2052
|
|
|
@@ -2285,6 +2371,7 @@ const HandleClearFilterClick = 'handleClearFilterClick';
|
|
|
2285
2371
|
const HandleContextMenu = 'handleContextMenu';
|
|
2286
2372
|
const HandleFilterInput = 'handleFilterInput';
|
|
2287
2373
|
const HandlePointerDown = 'handlePointerDown';
|
|
2374
|
+
const HandleClickMoreFilters = 'handleClickMoreFilters';
|
|
2288
2375
|
|
|
2289
2376
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2290
2377
|
return {
|
|
@@ -2355,8 +2442,7 @@ const getProblemsFilterVirtualDom = action => {
|
|
|
2355
2442
|
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
|
|
2356
2443
|
command: 'more filters',
|
|
2357
2444
|
icon: Filter,
|
|
2358
|
-
id: 'more filters'
|
|
2359
|
-
})];
|
|
2445
|
+
id: 'more filters'})];
|
|
2360
2446
|
};
|
|
2361
2447
|
|
|
2362
2448
|
const getNoResultsWithFilterVirtualDom = () => {
|
|
@@ -2906,6 +2992,9 @@ const renderEventListeners = () => {
|
|
|
2906
2992
|
}, {
|
|
2907
2993
|
name: HandlePointerDown,
|
|
2908
2994
|
params: ['handleClickAt', 'event.clientX', 'event.clientY']
|
|
2995
|
+
}, {
|
|
2996
|
+
name: HandleClickMoreFilters,
|
|
2997
|
+
params: ['handleClickMoreFilters']
|
|
2909
2998
|
}];
|
|
2910
2999
|
};
|
|
2911
3000
|
|
|
@@ -2950,10 +3039,12 @@ const commandMap = {
|
|
|
2950
3039
|
'Problems.focusIndex': wrapCommand(focusIndex),
|
|
2951
3040
|
'Problems.getCommandIds': getCommandIds,
|
|
2952
3041
|
'Problems.getKeyBindings': getKeyBindings,
|
|
3042
|
+
'Problems.getMenuIds': getMenuIds,
|
|
2953
3043
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
2954
3044
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
2955
3045
|
'Problems.handleClickAt': wrapCommand(handleClickAt),
|
|
2956
3046
|
'Problems.handleClickButton': wrapCommand(handleClickButton),
|
|
3047
|
+
'Problems.handleClickMoreFilters': wrapCommand(handleClickMoreFilters),
|
|
2957
3048
|
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2958
3049
|
'Problems.handleFilterInput': wrapCommand(handleFilterInput),
|
|
2959
3050
|
'Problems.handleIconThemeChange': wrapCommand(handleIconThemeChange),
|