@lvce-editor/problems-view 1.13.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 +516 -377
- 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
|
};
|
|
@@ -1072,10 +1073,11 @@ const create$2 = () => {
|
|
|
1072
1073
|
wrapCommand(fn) {
|
|
1073
1074
|
const wrapped = async (uid, ...args) => {
|
|
1074
1075
|
const {
|
|
1076
|
+
oldState,
|
|
1075
1077
|
newState
|
|
1076
1078
|
} = states[uid];
|
|
1077
1079
|
const newerState = await fn(newState, ...args);
|
|
1078
|
-
if (newState === newerState) {
|
|
1080
|
+
if (oldState === newerState || newState === newerState) {
|
|
1079
1081
|
return;
|
|
1080
1082
|
}
|
|
1081
1083
|
const latest = states[uid];
|
|
@@ -1146,6 +1148,11 @@ const UpArrow = 14;
|
|
|
1146
1148
|
const RightArrow = 15;
|
|
1147
1149
|
const DownArrow = 16;
|
|
1148
1150
|
|
|
1151
|
+
const Script$1 = 2;
|
|
1152
|
+
|
|
1153
|
+
const ManageExtension = 8;
|
|
1154
|
+
const ProblemsFilter$1 = 25;
|
|
1155
|
+
|
|
1149
1156
|
const DebugWorker = 55;
|
|
1150
1157
|
const EditorWorker$1 = 99;
|
|
1151
1158
|
const RendererWorker$1 = 1;
|
|
@@ -1157,9 +1164,17 @@ const set$5 = (id, rpc) => {
|
|
|
1157
1164
|
const get$1 = id => {
|
|
1158
1165
|
return rpcs[id];
|
|
1159
1166
|
};
|
|
1167
|
+
const remove = id => {
|
|
1168
|
+
delete rpcs[id];
|
|
1169
|
+
};
|
|
1160
1170
|
|
|
1171
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1161
1172
|
const create$1 = rpcId => {
|
|
1162
1173
|
return {
|
|
1174
|
+
async dispose() {
|
|
1175
|
+
const rpc = get$1(rpcId);
|
|
1176
|
+
await rpc.dispose();
|
|
1177
|
+
},
|
|
1163
1178
|
// @ts-ignore
|
|
1164
1179
|
invoke(method, ...params) {
|
|
1165
1180
|
const rpc = get$1(rpcId);
|
|
@@ -1172,21 +1187,30 @@ const create$1 = rpcId => {
|
|
|
1172
1187
|
// @ts-ignore
|
|
1173
1188
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1174
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
|
+
},
|
|
1175
1202
|
set(rpc) {
|
|
1176
1203
|
set$5(rpcId, rpc);
|
|
1177
|
-
},
|
|
1178
|
-
async dispose() {
|
|
1179
|
-
const rpc = get$1(rpcId);
|
|
1180
|
-
await rpc.dispose();
|
|
1181
1204
|
}
|
|
1182
1205
|
};
|
|
1183
1206
|
};
|
|
1184
1207
|
|
|
1185
1208
|
const {
|
|
1209
|
+
dispose: dispose$1,
|
|
1186
1210
|
invoke: invoke$1,
|
|
1187
1211
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1188
|
-
|
|
1189
|
-
|
|
1212
|
+
registerMockRpc: registerMockRpc$1,
|
|
1213
|
+
set: set$4
|
|
1190
1214
|
} = create$1(EditorWorker$1);
|
|
1191
1215
|
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1192
1216
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
@@ -1203,6 +1227,10 @@ const applyEdit = async (editorUid, changes) => {
|
|
|
1203
1227
|
// @ts-ignore
|
|
1204
1228
|
await invoke$1('Editor.applyEdit2', editorUid, changes);
|
|
1205
1229
|
};
|
|
1230
|
+
const applyDocumentEdits = async (editorUid, changes) => {
|
|
1231
|
+
// @ts-ignore
|
|
1232
|
+
await invoke$1('Editor.applyDocumentEdits', editorUid, changes);
|
|
1233
|
+
};
|
|
1206
1234
|
const applyWorkspaceEdit = async (editorUid, changes) => {
|
|
1207
1235
|
// @ts-ignore
|
|
1208
1236
|
await invoke$1('Editor.applyWorkspaceEdit', editorUid, changes);
|
|
@@ -1235,6 +1263,9 @@ const getSelections = async editorUid => {
|
|
|
1235
1263
|
const getWordAtOffset2 = async editorUid => {
|
|
1236
1264
|
return invoke$1('Editor.getWordAtOffset2', editorUid);
|
|
1237
1265
|
};
|
|
1266
|
+
const closeFind2 = async editorUid => {
|
|
1267
|
+
return invoke$1('Editor.closeFind2', editorUid);
|
|
1268
|
+
};
|
|
1238
1269
|
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
1239
1270
|
return invoke$1('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
|
|
1240
1271
|
};
|
|
@@ -1253,19 +1284,14 @@ const getProblems$2 = async () => {
|
|
|
1253
1284
|
// @ts-ignore
|
|
1254
1285
|
return invoke$1('Editor.getProblems');
|
|
1255
1286
|
};
|
|
1256
|
-
const registerMockRpc$1 = commandMap => {
|
|
1257
|
-
const mockRpc = createMockRpc({
|
|
1258
|
-
commandMap
|
|
1259
|
-
});
|
|
1260
|
-
set$4(mockRpc);
|
|
1261
|
-
return mockRpc;
|
|
1262
|
-
};
|
|
1263
1287
|
|
|
1264
1288
|
const EditorWorker = {
|
|
1265
1289
|
__proto__: null,
|
|
1266
1290
|
activateByEvent: activateByEvent$1,
|
|
1291
|
+
applyDocumentEdits,
|
|
1267
1292
|
applyEdit,
|
|
1268
1293
|
applyWorkspaceEdit,
|
|
1294
|
+
closeFind2,
|
|
1269
1295
|
closeWidget: closeWidget$1,
|
|
1270
1296
|
dispose: dispose$1,
|
|
1271
1297
|
getLanguageId,
|
|
@@ -1287,10 +1313,11 @@ const EditorWorker = {
|
|
|
1287
1313
|
};
|
|
1288
1314
|
|
|
1289
1315
|
const {
|
|
1316
|
+
dispose,
|
|
1290
1317
|
invoke,
|
|
1291
1318
|
invokeAndTransfer,
|
|
1292
|
-
|
|
1293
|
-
|
|
1319
|
+
registerMockRpc,
|
|
1320
|
+
set: set$3
|
|
1294
1321
|
} = create$1(RendererWorker$1);
|
|
1295
1322
|
const searchFileHtml = async uri => {
|
|
1296
1323
|
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
@@ -1298,9 +1325,20 @@ const searchFileHtml = async uri => {
|
|
|
1298
1325
|
const getFilePathElectron = async file => {
|
|
1299
1326
|
return invoke('FileSystemHandle.getFilePathElectron', file);
|
|
1300
1327
|
};
|
|
1328
|
+
/**
|
|
1329
|
+
* @deprecated
|
|
1330
|
+
*/
|
|
1301
1331
|
const showContextMenu = async (x, y, id, ...args) => {
|
|
1302
1332
|
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
1303
1333
|
};
|
|
1334
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1335
|
+
number(uid);
|
|
1336
|
+
number(menuId);
|
|
1337
|
+
number(x);
|
|
1338
|
+
number(y);
|
|
1339
|
+
// @ts-ignore
|
|
1340
|
+
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1341
|
+
};
|
|
1304
1342
|
const getElectronVersion = async () => {
|
|
1305
1343
|
return invoke('Process.getElectronVersion');
|
|
1306
1344
|
};
|
|
@@ -1348,6 +1386,11 @@ const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
|
1348
1386
|
// @ts-ignore
|
|
1349
1387
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1350
1388
|
};
|
|
1389
|
+
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1390
|
+
const command = 'IconTheme.handleMessagePort';
|
|
1391
|
+
// @ts-ignore
|
|
1392
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1393
|
+
};
|
|
1351
1394
|
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1352
1395
|
const command = 'FileSystem.handleMessagePort';
|
|
1353
1396
|
// @ts-ignore
|
|
@@ -1387,6 +1430,9 @@ const handleDebugChange = async params => {
|
|
|
1387
1430
|
const getFolderIcon = async options => {
|
|
1388
1431
|
return invoke('IconTheme.getFolderIcon', options);
|
|
1389
1432
|
};
|
|
1433
|
+
const handleWorkspaceRefresh = async () => {
|
|
1434
|
+
return invoke('Layout.handleWorkspaceRefresh');
|
|
1435
|
+
};
|
|
1390
1436
|
const closeWidget = async widgetId => {
|
|
1391
1437
|
return invoke('Viewlet.closeWidget', widgetId);
|
|
1392
1438
|
};
|
|
@@ -1394,6 +1440,10 @@ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
|
1394
1440
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1395
1441
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1396
1442
|
};
|
|
1443
|
+
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1444
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1445
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1446
|
+
};
|
|
1397
1447
|
const sendMessagePortToSearchProcess = async port => {
|
|
1398
1448
|
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1399
1449
|
};
|
|
@@ -1411,6 +1461,9 @@ const getKeyBindings$1 = async () => {
|
|
|
1411
1461
|
const writeClipBoardText$1 = async text => {
|
|
1412
1462
|
await invoke('ClipBoard.writeText', /* text */text);
|
|
1413
1463
|
};
|
|
1464
|
+
const readClipBoardText = async () => {
|
|
1465
|
+
return invoke('ClipBoard.readText');
|
|
1466
|
+
};
|
|
1414
1467
|
const writeClipBoardImage = async blob => {
|
|
1415
1468
|
// @ts-ignore
|
|
1416
1469
|
await invoke('ClipBoard.writeImage', /* text */blob);
|
|
@@ -1435,8 +1488,8 @@ const getIcons = async requests => {
|
|
|
1435
1488
|
const icons = await invoke('IconTheme.getIcons', requests);
|
|
1436
1489
|
return icons;
|
|
1437
1490
|
};
|
|
1438
|
-
const activateByEvent = event => {
|
|
1439
|
-
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
1491
|
+
const activateByEvent = (event, assetDir, platform) => {
|
|
1492
|
+
return invoke('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1440
1493
|
};
|
|
1441
1494
|
const setAdditionalFocus = focusKey => {
|
|
1442
1495
|
// @ts-ignore
|
|
@@ -1454,6 +1507,33 @@ const sendMessagePortToRendererProcess = async port => {
|
|
|
1454
1507
|
// @ts-ignore
|
|
1455
1508
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1456
1509
|
};
|
|
1510
|
+
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1511
|
+
const command = 'TextMeasurement.handleMessagePort';
|
|
1512
|
+
// @ts-ignore
|
|
1513
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1514
|
+
};
|
|
1515
|
+
const sendMessagePortToSourceControlWorker = async port => {
|
|
1516
|
+
const command = 'SourceControl.handleMessagePort';
|
|
1517
|
+
// @ts-ignore
|
|
1518
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1519
|
+
};
|
|
1520
|
+
const sendMessagePortToSharedProcess = async port => {
|
|
1521
|
+
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1522
|
+
// @ts-ignore
|
|
1523
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1524
|
+
};
|
|
1525
|
+
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1526
|
+
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1527
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
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
|
+
};
|
|
1457
1537
|
const getPreference = async key => {
|
|
1458
1538
|
return await invoke('Preferences.get', key);
|
|
1459
1539
|
};
|
|
@@ -1519,13 +1599,29 @@ const installExtension = async id => {
|
|
|
1519
1599
|
// @ts-ignore
|
|
1520
1600
|
return invoke('ExtensionManagement.install', id);
|
|
1521
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
|
+
};
|
|
1522
1618
|
const openExtensionSearch = async () => {
|
|
1523
1619
|
// @ts-ignore
|
|
1524
1620
|
return invoke('SideBar.openViewlet', 'Extensions');
|
|
1525
1621
|
};
|
|
1526
1622
|
const setExtensionsSearchValue = async searchValue => {
|
|
1527
1623
|
// @ts-ignore
|
|
1528
|
-
return invoke('Extensions.handleInput', searchValue);
|
|
1624
|
+
return invoke('Extensions.handleInput', searchValue, Script$1);
|
|
1529
1625
|
};
|
|
1530
1626
|
const openExternal = async uri => {
|
|
1531
1627
|
// @ts-ignore
|
|
@@ -1547,12 +1643,11 @@ const getLogsDir = async () => {
|
|
|
1547
1643
|
// @ts-ignore
|
|
1548
1644
|
return invoke('PlatformPaths.getLogsDir');
|
|
1549
1645
|
};
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
return mockRpc;
|
|
1646
|
+
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1647
|
+
return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1648
|
+
};
|
|
1649
|
+
const refreshOutput = async () => {
|
|
1650
|
+
await invoke('Output.refresh');
|
|
1556
1651
|
};
|
|
1557
1652
|
|
|
1558
1653
|
const RendererWorker = {
|
|
@@ -1560,6 +1655,7 @@ const RendererWorker = {
|
|
|
1560
1655
|
activateByEvent,
|
|
1561
1656
|
applyBulkReplacement,
|
|
1562
1657
|
closeWidget,
|
|
1658
|
+
closeWindow,
|
|
1563
1659
|
confirm,
|
|
1564
1660
|
disableExtension,
|
|
1565
1661
|
dispose,
|
|
@@ -1593,16 +1689,22 @@ const RendererWorker = {
|
|
|
1593
1689
|
handleDebugPaused,
|
|
1594
1690
|
handleDebugResumed,
|
|
1595
1691
|
handleDebugScriptParsed,
|
|
1692
|
+
handleWorkspaceRefresh,
|
|
1596
1693
|
installExtension,
|
|
1597
1694
|
invoke,
|
|
1598
1695
|
invokeAndTransfer,
|
|
1696
|
+
maximizeWindow,
|
|
1697
|
+
measureTextBlockHeight,
|
|
1698
|
+
minimizeWindow,
|
|
1599
1699
|
openExtensionSearch,
|
|
1600
1700
|
openExternal,
|
|
1601
1701
|
openNativeFolder,
|
|
1602
1702
|
openUri,
|
|
1603
1703
|
openUrl,
|
|
1604
1704
|
openWidget,
|
|
1705
|
+
readClipBoardText,
|
|
1605
1706
|
readFile,
|
|
1707
|
+
refreshOutput,
|
|
1606
1708
|
registerMockRpc,
|
|
1607
1709
|
registerWebViewInterceptor,
|
|
1608
1710
|
renderMarkdown,
|
|
@@ -1613,11 +1715,19 @@ const RendererWorker = {
|
|
|
1613
1715
|
sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
|
|
1614
1716
|
sendMessagePortToErrorWorker,
|
|
1615
1717
|
sendMessagePortToExtensionHostWorker,
|
|
1718
|
+
sendMessagePortToExtensionManagementWorker,
|
|
1719
|
+
sendMessagePortToFileSearchWorker,
|
|
1720
|
+
sendMessagePortToFileSystemProcess,
|
|
1616
1721
|
sendMessagePortToFileSystemWorker,
|
|
1722
|
+
sendMessagePortToIconThemeWorker,
|
|
1723
|
+
sendMessagePortToIframeWorker,
|
|
1617
1724
|
sendMessagePortToMarkdownWorker,
|
|
1618
1725
|
sendMessagePortToRendererProcess,
|
|
1619
1726
|
sendMessagePortToSearchProcess,
|
|
1727
|
+
sendMessagePortToSharedProcess,
|
|
1728
|
+
sendMessagePortToSourceControlWorker,
|
|
1620
1729
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1730
|
+
sendMessagePortToTextMeasurementWorker,
|
|
1621
1731
|
set: set$3,
|
|
1622
1732
|
setAdditionalFocus,
|
|
1623
1733
|
setColorTheme,
|
|
@@ -1626,19 +1736,21 @@ const RendererWorker = {
|
|
|
1626
1736
|
setWebViewPort,
|
|
1627
1737
|
setWorkspacePath,
|
|
1628
1738
|
showContextMenu,
|
|
1739
|
+
showContextMenu2,
|
|
1629
1740
|
showErrorDialog,
|
|
1630
1741
|
showMessageBox,
|
|
1631
1742
|
showSaveFilePicker,
|
|
1632
1743
|
uninstallExtension,
|
|
1744
|
+
unmaximizeWindow,
|
|
1633
1745
|
unregisterWebViewInterceptor,
|
|
1634
1746
|
writeClipBoardImage,
|
|
1635
1747
|
writeClipBoardText: writeClipBoardText$1
|
|
1636
1748
|
};
|
|
1637
1749
|
|
|
1638
1750
|
const {
|
|
1751
|
+
sendMessagePortToEditorWorker,
|
|
1639
1752
|
set: set$2,
|
|
1640
|
-
writeClipBoardText
|
|
1641
|
-
sendMessagePortToEditorWorker
|
|
1753
|
+
writeClipBoardText
|
|
1642
1754
|
} = RendererWorker;
|
|
1643
1755
|
|
|
1644
1756
|
const writeText = async text => {
|
|
@@ -1647,8 +1759,8 @@ const writeText = async text => {
|
|
|
1647
1759
|
|
|
1648
1760
|
const copyMessage = async state => {
|
|
1649
1761
|
const {
|
|
1650
|
-
|
|
1651
|
-
|
|
1762
|
+
focusedIndex,
|
|
1763
|
+
problems
|
|
1652
1764
|
} = state;
|
|
1653
1765
|
const problem = problems[focusedIndex];
|
|
1654
1766
|
await writeText(problem.message);
|
|
@@ -1670,25 +1782,25 @@ const List = 2;
|
|
|
1670
1782
|
|
|
1671
1783
|
const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
1672
1784
|
const state = {
|
|
1673
|
-
|
|
1674
|
-
|
|
1785
|
+
collapsedUris: [],
|
|
1786
|
+
filteredProblems: [],
|
|
1787
|
+
filterValue: '',
|
|
1675
1788
|
focusedIndex: -2,
|
|
1676
|
-
message: '',
|
|
1677
|
-
itemHeight: 22,
|
|
1678
|
-
x,
|
|
1679
|
-
y,
|
|
1680
|
-
width,
|
|
1681
1789
|
height,
|
|
1682
|
-
filterValue: '',
|
|
1683
|
-
viewMode: None,
|
|
1684
1790
|
inputSource: User,
|
|
1685
|
-
|
|
1686
|
-
maxLineY: 0,
|
|
1791
|
+
itemHeight: 22,
|
|
1687
1792
|
listItems: [],
|
|
1688
|
-
|
|
1793
|
+
maxLineY: 0,
|
|
1794
|
+
message: '',
|
|
1795
|
+
minLineY: 0,
|
|
1796
|
+
problems: [],
|
|
1689
1797
|
smallWidthBreakPoint: 650,
|
|
1690
|
-
|
|
1691
|
-
|
|
1798
|
+
uid: id,
|
|
1799
|
+
viewMode: None,
|
|
1800
|
+
width,
|
|
1801
|
+
workspaceUri,
|
|
1802
|
+
x,
|
|
1803
|
+
y
|
|
1692
1804
|
};
|
|
1693
1805
|
set$1(id, state, state);
|
|
1694
1806
|
};
|
|
@@ -1720,8 +1832,8 @@ const diff = (oldState, newState) => {
|
|
|
1720
1832
|
|
|
1721
1833
|
const diff2 = uid => {
|
|
1722
1834
|
const {
|
|
1723
|
-
|
|
1724
|
-
|
|
1835
|
+
newState,
|
|
1836
|
+
oldState
|
|
1725
1837
|
} = get(uid);
|
|
1726
1838
|
const diffResult = diff(oldState, newState);
|
|
1727
1839
|
return diffResult;
|
|
@@ -1752,9 +1864,9 @@ const mergeClassNames = (...classNames) => {
|
|
|
1752
1864
|
|
|
1753
1865
|
const text = data => {
|
|
1754
1866
|
return {
|
|
1755
|
-
|
|
1867
|
+
childCount: 0,
|
|
1756
1868
|
text: data,
|
|
1757
|
-
|
|
1869
|
+
type: Text
|
|
1758
1870
|
};
|
|
1759
1871
|
};
|
|
1760
1872
|
|
|
@@ -1762,52 +1874,56 @@ const FocusProblems = 19;
|
|
|
1762
1874
|
|
|
1763
1875
|
const getKeyBindings = () => {
|
|
1764
1876
|
return [{
|
|
1765
|
-
key: DownArrow,
|
|
1766
1877
|
command: 'Problems.focusNext',
|
|
1878
|
+
key: DownArrow,
|
|
1767
1879
|
when: FocusProblems
|
|
1768
1880
|
}, {
|
|
1769
|
-
key: UpArrow,
|
|
1770
1881
|
command: 'Problems.focusPrevious',
|
|
1882
|
+
key: UpArrow,
|
|
1771
1883
|
when: FocusProblems
|
|
1772
1884
|
}, {
|
|
1773
|
-
key: Home,
|
|
1774
1885
|
command: 'Problems.focusFirst',
|
|
1886
|
+
key: Home,
|
|
1775
1887
|
when: FocusProblems
|
|
1776
1888
|
}, {
|
|
1777
|
-
key: PageUp,
|
|
1778
1889
|
command: 'Problems.focusFirst',
|
|
1890
|
+
key: PageUp,
|
|
1779
1891
|
when: FocusProblems
|
|
1780
1892
|
}, {
|
|
1781
|
-
key: PageDown,
|
|
1782
1893
|
command: 'Problems.focusLast',
|
|
1894
|
+
key: PageDown,
|
|
1783
1895
|
when: FocusProblems
|
|
1784
1896
|
}, {
|
|
1785
|
-
key: End,
|
|
1786
1897
|
command: 'Problems.focusLast',
|
|
1898
|
+
key: End,
|
|
1787
1899
|
when: FocusProblems
|
|
1788
1900
|
}, {
|
|
1789
|
-
key: Space,
|
|
1790
1901
|
command: 'Problems.selectCurrent',
|
|
1902
|
+
key: Space,
|
|
1791
1903
|
when: FocusProblems
|
|
1792
1904
|
}, {
|
|
1793
|
-
key: Home,
|
|
1794
1905
|
command: 'Problems.focusFirst',
|
|
1906
|
+
key: Home,
|
|
1795
1907
|
when: FocusProblems
|
|
1796
1908
|
}, {
|
|
1797
|
-
key: End,
|
|
1798
1909
|
command: 'Problems.focusLast',
|
|
1910
|
+
key: End,
|
|
1799
1911
|
when: FocusProblems
|
|
1800
1912
|
}, {
|
|
1801
|
-
key: LeftArrow,
|
|
1802
1913
|
command: 'Problems.handleArrowLeft',
|
|
1914
|
+
key: LeftArrow,
|
|
1803
1915
|
when: FocusProblems
|
|
1804
1916
|
}, {
|
|
1805
|
-
key: RightArrow,
|
|
1806
1917
|
command: 'Problems.handleArrowRight',
|
|
1918
|
+
key: RightArrow,
|
|
1807
1919
|
when: FocusProblems
|
|
1808
1920
|
}];
|
|
1809
1921
|
};
|
|
1810
1922
|
|
|
1923
|
+
const getMenuIds = () => {
|
|
1924
|
+
return [ManageExtension, ProblemsFilter$1];
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1811
1927
|
const Item = 0;
|
|
1812
1928
|
const Expanded = 1;
|
|
1813
1929
|
const Collapsed = 2;
|
|
@@ -1829,9 +1945,9 @@ const getArrowLeftNewFocusedIndex = (problems, collapsedUris, focusedIndex) => {
|
|
|
1829
1945
|
};
|
|
1830
1946
|
const handleArrowLeft = state => {
|
|
1831
1947
|
const {
|
|
1832
|
-
|
|
1948
|
+
collapsedUris,
|
|
1833
1949
|
focusedIndex,
|
|
1834
|
-
|
|
1950
|
+
problems
|
|
1835
1951
|
} = state;
|
|
1836
1952
|
const {
|
|
1837
1953
|
index,
|
|
@@ -1839,8 +1955,8 @@ const handleArrowLeft = state => {
|
|
|
1839
1955
|
} = getArrowLeftNewFocusedIndex(problems, collapsedUris, focusedIndex);
|
|
1840
1956
|
return {
|
|
1841
1957
|
...state,
|
|
1842
|
-
|
|
1843
|
-
|
|
1958
|
+
collapsedUris: newCollapsedUris,
|
|
1959
|
+
focusedIndex: index
|
|
1844
1960
|
};
|
|
1845
1961
|
};
|
|
1846
1962
|
|
|
@@ -1862,9 +1978,9 @@ const getArrowRightNewFocusedIndex = (problems, collapsedUris, focusedIndex) =>
|
|
|
1862
1978
|
};
|
|
1863
1979
|
const handleArrowRight = state => {
|
|
1864
1980
|
const {
|
|
1865
|
-
|
|
1981
|
+
collapsedUris,
|
|
1866
1982
|
focusedIndex,
|
|
1867
|
-
|
|
1983
|
+
problems
|
|
1868
1984
|
} = state;
|
|
1869
1985
|
const {
|
|
1870
1986
|
index,
|
|
@@ -1872,8 +1988,8 @@ const handleArrowRight = state => {
|
|
|
1872
1988
|
} = getArrowRightNewFocusedIndex(problems, collapsedUris, focusedIndex);
|
|
1873
1989
|
return {
|
|
1874
1990
|
...state,
|
|
1875
|
-
|
|
1876
|
-
|
|
1991
|
+
collapsedUris: newCollapsedUris,
|
|
1992
|
+
focusedIndex: index
|
|
1877
1993
|
};
|
|
1878
1994
|
};
|
|
1879
1995
|
|
|
@@ -1885,10 +2001,10 @@ const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight) => {
|
|
|
1885
2001
|
|
|
1886
2002
|
const handleClickAt = (state, eventX, eventY) => {
|
|
1887
2003
|
const {
|
|
2004
|
+
itemHeight,
|
|
1888
2005
|
problems,
|
|
1889
2006
|
x,
|
|
1890
|
-
y
|
|
1891
|
-
itemHeight
|
|
2007
|
+
y
|
|
1892
2008
|
} = state;
|
|
1893
2009
|
|
|
1894
2010
|
// TODO use functional focus rendering
|
|
@@ -1910,9 +2026,27 @@ const handleClickButton = async (state, name) => {
|
|
|
1910
2026
|
return state;
|
|
1911
2027
|
};
|
|
1912
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
|
+
|
|
1913
2043
|
const handleContextMenu = async (state, eventX, eventY) => {
|
|
1914
|
-
|
|
1915
|
-
|
|
2044
|
+
const {
|
|
2045
|
+
uid
|
|
2046
|
+
} = state;
|
|
2047
|
+
await show2(uid, ProblemsFilter$1, eventX, eventY, {
|
|
2048
|
+
menuId: ProblemsFilter$1
|
|
2049
|
+
});
|
|
1916
2050
|
return state;
|
|
1917
2051
|
};
|
|
1918
2052
|
|
|
@@ -1947,8 +2081,8 @@ const createEditorWorkerRpc = async () => {
|
|
|
1947
2081
|
};
|
|
1948
2082
|
|
|
1949
2083
|
const {
|
|
1950
|
-
|
|
1951
|
-
|
|
2084
|
+
getProblems: getProblems$1,
|
|
2085
|
+
set
|
|
1952
2086
|
} = EditorWorker;
|
|
1953
2087
|
|
|
1954
2088
|
const initialize = async () => {
|
|
@@ -1958,29 +2092,29 @@ const initialize = async () => {
|
|
|
1958
2092
|
|
|
1959
2093
|
const toProblem = (diagnostic, index) => {
|
|
1960
2094
|
const {
|
|
2095
|
+
code,
|
|
2096
|
+
columnIndex,
|
|
1961
2097
|
message,
|
|
1962
2098
|
rowIndex,
|
|
1963
|
-
columnIndex,
|
|
1964
2099
|
source,
|
|
1965
|
-
code,
|
|
1966
2100
|
type,
|
|
1967
2101
|
uri
|
|
1968
2102
|
} = diagnostic;
|
|
1969
2103
|
return {
|
|
1970
|
-
|
|
1971
|
-
rowIndex: rowIndex || 0,
|
|
2104
|
+
code: code || '',
|
|
1972
2105
|
columnIndex: columnIndex || 0,
|
|
1973
|
-
uri,
|
|
1974
|
-
relativePath: '',
|
|
1975
2106
|
count: 0,
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
type: type || 'error',
|
|
2107
|
+
fileName: '',
|
|
2108
|
+
level: 2,
|
|
1979
2109
|
listItemType: Item,
|
|
2110
|
+
message: message || '',
|
|
1980
2111
|
posInSet: index,
|
|
2112
|
+
relativePath: '',
|
|
2113
|
+
rowIndex: rowIndex || 0,
|
|
1981
2114
|
setSize: 1,
|
|
1982
|
-
|
|
1983
|
-
|
|
2115
|
+
source: source || '',
|
|
2116
|
+
type: type || 'error',
|
|
2117
|
+
uri
|
|
1984
2118
|
};
|
|
1985
2119
|
};
|
|
1986
2120
|
const getRelativeParentUri = (uri, workspaceUri) => {
|
|
@@ -1994,20 +2128,20 @@ const getFileName = uri => {
|
|
|
1994
2128
|
const toProblems = (diagnostics, workspaceUri = '') => {
|
|
1995
2129
|
const problems = [];
|
|
1996
2130
|
let problem = {
|
|
1997
|
-
|
|
1998
|
-
rowIndex: 0,
|
|
2131
|
+
code: '',
|
|
1999
2132
|
columnIndex: 0,
|
|
2000
|
-
uri: '',
|
|
2001
|
-
relativePath: '',
|
|
2002
2133
|
count: 0,
|
|
2003
|
-
|
|
2004
|
-
code: '',
|
|
2134
|
+
fileName: '',
|
|
2005
2135
|
level: 0,
|
|
2006
2136
|
listItemType: 0,
|
|
2137
|
+
message: '',
|
|
2007
2138
|
posInSet: 0,
|
|
2139
|
+
relativePath: '',
|
|
2140
|
+
rowIndex: 0,
|
|
2008
2141
|
setSize: 0,
|
|
2142
|
+
source: '',
|
|
2009
2143
|
type: '',
|
|
2010
|
-
|
|
2144
|
+
uri: ''
|
|
2011
2145
|
};
|
|
2012
2146
|
let relativeIndex = 0;
|
|
2013
2147
|
for (const diagnostic of diagnostics) {
|
|
@@ -2017,20 +2151,20 @@ const toProblems = (diagnostics, workspaceUri = '') => {
|
|
|
2017
2151
|
} else {
|
|
2018
2152
|
relativeIndex = 1;
|
|
2019
2153
|
problem = {
|
|
2020
|
-
|
|
2021
|
-
rowIndex: 0,
|
|
2154
|
+
code: '',
|
|
2022
2155
|
columnIndex: 0,
|
|
2023
|
-
uri: diagnostic.uri,
|
|
2024
|
-
relativePath: '',
|
|
2025
2156
|
count: 1,
|
|
2026
|
-
|
|
2027
|
-
|
|
2157
|
+
fileName: '',
|
|
2158
|
+
level: 1,
|
|
2028
2159
|
listItemType: Expanded,
|
|
2160
|
+
message: '',
|
|
2029
2161
|
posInSet: relativeIndex,
|
|
2162
|
+
relativePath: '',
|
|
2163
|
+
rowIndex: 0,
|
|
2030
2164
|
setSize: 123,
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2165
|
+
source: '',
|
|
2166
|
+
type: '',
|
|
2167
|
+
uri: diagnostic.uri
|
|
2034
2168
|
};
|
|
2035
2169
|
problems.push(problem);
|
|
2036
2170
|
}
|
|
@@ -2055,13 +2189,13 @@ const getProblems = async workspaceUri => {
|
|
|
2055
2189
|
// @ts-ignore
|
|
2056
2190
|
const problems = toProblems(diagnostics, workspaceUri);
|
|
2057
2191
|
return {
|
|
2058
|
-
|
|
2059
|
-
|
|
2192
|
+
error: '',
|
|
2193
|
+
problems
|
|
2060
2194
|
};
|
|
2061
2195
|
} catch (error) {
|
|
2062
2196
|
return {
|
|
2063
|
-
|
|
2064
|
-
|
|
2197
|
+
error: `${error}`,
|
|
2198
|
+
problems: []
|
|
2065
2199
|
};
|
|
2066
2200
|
}
|
|
2067
2201
|
};
|
|
@@ -2168,8 +2302,8 @@ const getSavedCollapsedUris = savedState => {
|
|
|
2168
2302
|
};
|
|
2169
2303
|
const loadContent = async (state, savedState) => {
|
|
2170
2304
|
const {
|
|
2171
|
-
|
|
2172
|
-
|
|
2305
|
+
error,
|
|
2306
|
+
problems
|
|
2173
2307
|
} = await getProblems(state.workspaceUri);
|
|
2174
2308
|
if (error) {
|
|
2175
2309
|
return {
|
|
@@ -2183,14 +2317,14 @@ const loadContent = async (state, savedState) => {
|
|
|
2183
2317
|
const collapsedUris = getSavedCollapsedUris(savedState);
|
|
2184
2318
|
return {
|
|
2185
2319
|
...state,
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
viewMode,
|
|
2320
|
+
collapsedUris,
|
|
2321
|
+
filteredProblems: problems,
|
|
2189
2322
|
filterValue,
|
|
2190
2323
|
inputSource: Script,
|
|
2191
|
-
filteredProblems: problems,
|
|
2192
2324
|
listItems: [],
|
|
2193
|
-
|
|
2325
|
+
message,
|
|
2326
|
+
problems,
|
|
2327
|
+
viewMode
|
|
2194
2328
|
};
|
|
2195
2329
|
};
|
|
2196
2330
|
|
|
@@ -2237,41 +2371,42 @@ const HandleClearFilterClick = 'handleClearFilterClick';
|
|
|
2237
2371
|
const HandleContextMenu = 'handleContextMenu';
|
|
2238
2372
|
const HandleFilterInput = 'handleFilterInput';
|
|
2239
2373
|
const HandlePointerDown = 'handlePointerDown';
|
|
2374
|
+
const HandleClickMoreFilters = 'handleClickMoreFilters';
|
|
2240
2375
|
|
|
2241
2376
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2242
2377
|
return {
|
|
2243
|
-
|
|
2378
|
+
childCount: 0,
|
|
2244
2379
|
className: mergeClassNames('MaskIcon', `MaskIcon${icon}`),
|
|
2245
2380
|
role: None$1,
|
|
2246
|
-
|
|
2381
|
+
type
|
|
2247
2382
|
};
|
|
2248
2383
|
};
|
|
2249
2384
|
|
|
2250
2385
|
const getActionButtonVirtualDom = action => {
|
|
2251
2386
|
const {
|
|
2252
|
-
|
|
2387
|
+
command,
|
|
2253
2388
|
icon,
|
|
2254
|
-
|
|
2389
|
+
id
|
|
2255
2390
|
} = action;
|
|
2256
2391
|
return [{
|
|
2257
|
-
|
|
2392
|
+
childCount: 1,
|
|
2258
2393
|
className: IconButton,
|
|
2259
|
-
title: id,
|
|
2260
2394
|
'data-command': command,
|
|
2261
|
-
|
|
2395
|
+
title: id,
|
|
2396
|
+
type: Button$1
|
|
2262
2397
|
}, getIconVirtualDom(icon)];
|
|
2263
2398
|
};
|
|
2264
2399
|
|
|
2265
2400
|
const getInputBoxVirtualDom = (name, onInput, placeholder) => {
|
|
2266
2401
|
return {
|
|
2267
|
-
type: Input,
|
|
2268
|
-
className: InputBox,
|
|
2269
2402
|
autocapitalize: 'off',
|
|
2270
2403
|
autocorrect: 'off',
|
|
2404
|
+
className: InputBox,
|
|
2271
2405
|
name,
|
|
2272
2406
|
onInput: onInput,
|
|
2273
2407
|
placeholder: placeholder,
|
|
2274
|
-
spellcheck: false
|
|
2408
|
+
spellcheck: false,
|
|
2409
|
+
type: Input
|
|
2275
2410
|
};
|
|
2276
2411
|
};
|
|
2277
2412
|
|
|
@@ -2294,70 +2429,68 @@ const getBadgeDom = badgeText => {
|
|
|
2294
2429
|
return [];
|
|
2295
2430
|
}
|
|
2296
2431
|
return [{
|
|
2297
|
-
|
|
2432
|
+
childCount: 1,
|
|
2298
2433
|
className: FilterBadge,
|
|
2299
|
-
|
|
2434
|
+
type: Div
|
|
2300
2435
|
}, text(badgeText)];
|
|
2301
2436
|
};
|
|
2302
2437
|
const getProblemsFilterVirtualDom = action => {
|
|
2303
2438
|
return [{
|
|
2304
|
-
|
|
2439
|
+
childCount: getChildCount(action.badgeText),
|
|
2305
2440
|
className: Filter$1,
|
|
2306
|
-
|
|
2441
|
+
type: Div
|
|
2307
2442
|
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
|
|
2308
|
-
|
|
2309
|
-
// TODO use i18n string
|
|
2443
|
+
command: 'more filters',
|
|
2310
2444
|
icon: Filter,
|
|
2311
|
-
|
|
2312
|
-
})];
|
|
2445
|
+
id: 'more filters'})];
|
|
2313
2446
|
};
|
|
2314
2447
|
|
|
2315
2448
|
const getNoResultsWithFilterVirtualDom = () => {
|
|
2316
2449
|
return [{
|
|
2317
|
-
|
|
2450
|
+
childCount: 3,
|
|
2318
2451
|
className: Message,
|
|
2319
|
-
|
|
2452
|
+
type: Div
|
|
2320
2453
|
}, {
|
|
2321
|
-
|
|
2322
|
-
|
|
2454
|
+
childCount: 1,
|
|
2455
|
+
type: Span
|
|
2323
2456
|
}, text(noResultsFoundWithProvidedFilterCriteria()), {
|
|
2324
|
-
type: A,
|
|
2325
|
-
className: MessageAction,
|
|
2326
2457
|
childCount: 1,
|
|
2327
|
-
|
|
2458
|
+
className: MessageAction,
|
|
2459
|
+
onClick: HandleClearFilterClick,
|
|
2460
|
+
type: A
|
|
2328
2461
|
}, text(clearFilter()), text('.')];
|
|
2329
2462
|
};
|
|
2330
2463
|
|
|
2331
2464
|
const getBadgeVirtualDom = (className, count) => {
|
|
2332
2465
|
return [{
|
|
2333
|
-
|
|
2466
|
+
childCount: 1,
|
|
2334
2467
|
className: mergeClassNames('Badge', className) + (''),
|
|
2335
|
-
|
|
2468
|
+
type: Div
|
|
2336
2469
|
}, text(`${count}`)];
|
|
2337
2470
|
};
|
|
2338
2471
|
|
|
2339
2472
|
const getChevronDownVirtualDom = (extraClassName = '') => {
|
|
2340
2473
|
return {
|
|
2341
|
-
|
|
2474
|
+
childCount: 0,
|
|
2342
2475
|
className: mergeClassNames(Chevron, 'MaskIconChevronDown', extraClassName) + (extraClassName === '' ? ' ' : ''),
|
|
2343
|
-
|
|
2476
|
+
type: Div
|
|
2344
2477
|
};
|
|
2345
2478
|
};
|
|
2346
2479
|
const getChevronRightVirtualDom = (extraClassName = '') => {
|
|
2347
2480
|
return {
|
|
2348
|
-
|
|
2481
|
+
childCount: 0,
|
|
2349
2482
|
className: mergeClassNames(Chevron, 'MaskIconChevronRight', extraClassName) + (extraClassName === '' ? ' ' : ''),
|
|
2350
|
-
|
|
2483
|
+
type: Div
|
|
2351
2484
|
};
|
|
2352
2485
|
};
|
|
2353
2486
|
|
|
2354
2487
|
const getFileIconVirtualDom = icon => {
|
|
2355
2488
|
return {
|
|
2356
|
-
|
|
2489
|
+
childCount: 0,
|
|
2357
2490
|
className: FileIcon,
|
|
2358
|
-
src: icon,
|
|
2359
2491
|
role: None$1,
|
|
2360
|
-
|
|
2492
|
+
src: icon,
|
|
2493
|
+
type: Img
|
|
2361
2494
|
};
|
|
2362
2495
|
};
|
|
2363
2496
|
|
|
@@ -2366,15 +2499,15 @@ const Warning = 'warning';
|
|
|
2366
2499
|
const getProblemsIconVirtualDom = type => {
|
|
2367
2500
|
if (type === Warning) {
|
|
2368
2501
|
return {
|
|
2369
|
-
|
|
2502
|
+
childCount: 0,
|
|
2370
2503
|
className: mergeClassNames(ProblemsIcon, ProblemsWarningIcon),
|
|
2371
|
-
|
|
2504
|
+
type: Div
|
|
2372
2505
|
};
|
|
2373
2506
|
}
|
|
2374
2507
|
return {
|
|
2375
|
-
|
|
2508
|
+
childCount: 0,
|
|
2376
2509
|
className: mergeClassNames(ProblemsIcon, ProblemsErrorIcon),
|
|
2377
|
-
|
|
2510
|
+
type: Div
|
|
2378
2511
|
};
|
|
2379
2512
|
};
|
|
2380
2513
|
|
|
@@ -2400,6 +2533,7 @@ const getProblemVirtualDom = problem => {
|
|
|
2400
2533
|
const {
|
|
2401
2534
|
code,
|
|
2402
2535
|
columnIndex,
|
|
2536
|
+
fileName,
|
|
2403
2537
|
filterValueLength,
|
|
2404
2538
|
icon,
|
|
2405
2539
|
isActive,
|
|
@@ -2413,8 +2547,7 @@ const getProblemVirtualDom = problem => {
|
|
|
2413
2547
|
rowIndex,
|
|
2414
2548
|
setSize,
|
|
2415
2549
|
source,
|
|
2416
|
-
type
|
|
2417
|
-
fileName
|
|
2550
|
+
type
|
|
2418
2551
|
} = problem;
|
|
2419
2552
|
let className = Problem;
|
|
2420
2553
|
if (isActive) {
|
|
@@ -2422,41 +2555,41 @@ const getProblemVirtualDom = problem => {
|
|
|
2422
2555
|
}
|
|
2423
2556
|
if (listItemType === Expanded || listItemType === Collapsed) {
|
|
2424
2557
|
return [{
|
|
2425
|
-
type: Div,
|
|
2426
|
-
className,
|
|
2427
|
-
childCount: 5,
|
|
2428
|
-
paddingLeft: getTreeItemIndent(1),
|
|
2429
|
-
ariaPosInSet: posInSet,
|
|
2430
|
-
ariaSetSize: setSize,
|
|
2431
|
-
ariaLevel: level,
|
|
2432
2558
|
ariaExpanded: !isCollapsed,
|
|
2559
|
+
ariaLevel: level,
|
|
2560
|
+
ariaPosInSet: posInSet,
|
|
2433
2561
|
ariaSelected: isActive,
|
|
2434
|
-
|
|
2562
|
+
ariaSetSize: setSize,
|
|
2563
|
+
childCount: 5,
|
|
2564
|
+
className,
|
|
2565
|
+
paddingLeft: getTreeItemIndent(1),
|
|
2566
|
+
role: TreeItem,
|
|
2567
|
+
type: Div
|
|
2435
2568
|
}, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), text(fileName), {
|
|
2436
|
-
|
|
2569
|
+
childCount: 1,
|
|
2437
2570
|
className: LabelDetail,
|
|
2438
|
-
|
|
2571
|
+
type: Div
|
|
2439
2572
|
}, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
|
|
2440
2573
|
}
|
|
2441
2574
|
const lineColumn = atLineColumn(rowIndex, columnIndex);
|
|
2442
2575
|
const label = {
|
|
2443
|
-
|
|
2576
|
+
childCount: 1,
|
|
2444
2577
|
className: Label,
|
|
2445
|
-
|
|
2578
|
+
type: Div
|
|
2446
2579
|
};
|
|
2447
2580
|
/**
|
|
2448
2581
|
* @type {any}
|
|
2449
2582
|
*/
|
|
2450
2583
|
const dom = [{
|
|
2451
|
-
type: Div,
|
|
2452
|
-
className,
|
|
2453
|
-
childCount: 3,
|
|
2454
|
-
paddingLeft: getTreeItemIndent(2),
|
|
2455
|
-
ariaPosInSet: posInSet,
|
|
2456
|
-
ariaSetSize: setSize,
|
|
2457
2584
|
ariaLevel: level,
|
|
2585
|
+
ariaPosInSet: posInSet,
|
|
2458
2586
|
ariaSelected: isActive,
|
|
2459
|
-
|
|
2587
|
+
ariaSetSize: setSize,
|
|
2588
|
+
childCount: 3,
|
|
2589
|
+
className,
|
|
2590
|
+
paddingLeft: getTreeItemIndent(2),
|
|
2591
|
+
role: TreeItem,
|
|
2592
|
+
type: Div
|
|
2460
2593
|
}, getProblemsIconVirtualDom(type), label];
|
|
2461
2594
|
if (filterValueLength) {
|
|
2462
2595
|
const before = message.slice(0, messageMatchIndex);
|
|
@@ -2464,37 +2597,38 @@ const getProblemVirtualDom = problem => {
|
|
|
2464
2597
|
const after = message.slice(messageMatchIndex + filterValueLength);
|
|
2465
2598
|
label.childCount += 2;
|
|
2466
2599
|
dom.push(text(before), {
|
|
2467
|
-
|
|
2600
|
+
childCount: 1,
|
|
2468
2601
|
className: Highlight,
|
|
2469
|
-
|
|
2602
|
+
type: Div
|
|
2470
2603
|
}, text(middle), text(after));
|
|
2471
2604
|
} else {
|
|
2472
2605
|
dom.push(text(message));
|
|
2473
2606
|
}
|
|
2474
2607
|
dom.push({
|
|
2475
|
-
|
|
2608
|
+
childCount: 2,
|
|
2476
2609
|
className: ProblemAt,
|
|
2477
|
-
|
|
2610
|
+
type: Span
|
|
2478
2611
|
}, text(getProblemSourceDetail(source, code)), text(lineColumn));
|
|
2479
2612
|
return dom;
|
|
2480
2613
|
};
|
|
2481
2614
|
|
|
2482
2615
|
const getProblemsListVirtualDom = problems => {
|
|
2483
2616
|
const dom = [{
|
|
2484
|
-
|
|
2485
|
-
|
|
2617
|
+
ariaLabel: 'Problems Tree',
|
|
2618
|
+
// TODO use i18n string
|
|
2486
2619
|
childCount: problems.length,
|
|
2620
|
+
className: ProblemsList,
|
|
2487
2621
|
role: Tree,
|
|
2488
|
-
|
|
2622
|
+
type: Div
|
|
2489
2623
|
}, ...problems.flatMap(getProblemVirtualDom)];
|
|
2490
2624
|
return dom;
|
|
2491
2625
|
};
|
|
2492
2626
|
|
|
2493
2627
|
const getProblemsNoProblemsFoundVirtualDom = () => {
|
|
2494
2628
|
return [{
|
|
2495
|
-
|
|
2629
|
+
childCount: 1,
|
|
2496
2630
|
className: Message,
|
|
2497
|
-
|
|
2631
|
+
type: Div
|
|
2498
2632
|
}, text(noProblemsDetected())];
|
|
2499
2633
|
};
|
|
2500
2634
|
|
|
@@ -2507,11 +2641,11 @@ const getClassName = isEven => {
|
|
|
2507
2641
|
const getProblemsTableRowVirtualDom = problem => {
|
|
2508
2642
|
const {
|
|
2509
2643
|
code,
|
|
2510
|
-
source,
|
|
2511
|
-
uri,
|
|
2512
|
-
message,
|
|
2513
2644
|
isEven,
|
|
2514
|
-
|
|
2645
|
+
message,
|
|
2646
|
+
source,
|
|
2647
|
+
type,
|
|
2648
|
+
uri
|
|
2515
2649
|
} = problem;
|
|
2516
2650
|
// TODO problems are grouped by uri, depending
|
|
2517
2651
|
// on which renderer is used the data needs to look different
|
|
@@ -2519,38 +2653,38 @@ const getProblemsTableRowVirtualDom = problem => {
|
|
|
2519
2653
|
return [];
|
|
2520
2654
|
}
|
|
2521
2655
|
const dom = [{
|
|
2522
|
-
|
|
2656
|
+
childCount: 5,
|
|
2523
2657
|
className: getClassName(isEven),
|
|
2524
|
-
|
|
2658
|
+
type: Div
|
|
2525
2659
|
}, {
|
|
2526
|
-
|
|
2660
|
+
childCount: 1,
|
|
2527
2661
|
className: ProblemsTableRowItem,
|
|
2528
|
-
|
|
2662
|
+
type: Div
|
|
2529
2663
|
}, getProblemsIconVirtualDom(type), {
|
|
2530
|
-
|
|
2664
|
+
childCount: 1,
|
|
2531
2665
|
className: ProblemsTableRowItem,
|
|
2532
|
-
|
|
2666
|
+
type: Div
|
|
2533
2667
|
}, text(getProblemSourceDetail(source, code)), {
|
|
2534
|
-
|
|
2668
|
+
childCount: 1,
|
|
2535
2669
|
className: ProblemsTableRowItem,
|
|
2536
|
-
|
|
2670
|
+
type: Div
|
|
2537
2671
|
}, text(message), {
|
|
2538
|
-
|
|
2672
|
+
childCount: 1,
|
|
2539
2673
|
className: ProblemsTableRowItem,
|
|
2540
|
-
|
|
2674
|
+
type: Div
|
|
2541
2675
|
}, text(uri), {
|
|
2542
|
-
|
|
2676
|
+
childCount: 1,
|
|
2543
2677
|
className: ProblemsTableRowItem,
|
|
2544
|
-
|
|
2678
|
+
type: Div
|
|
2545
2679
|
}, text(source)];
|
|
2546
2680
|
return dom;
|
|
2547
2681
|
};
|
|
2548
2682
|
|
|
2549
2683
|
const getProblemsTableBodyVirtualDom = problems => {
|
|
2550
2684
|
const dom = [{
|
|
2551
|
-
|
|
2685
|
+
childCount: problems.length,
|
|
2552
2686
|
className: ProblemsTableBody,
|
|
2553
|
-
|
|
2687
|
+
type: Div
|
|
2554
2688
|
}, ...problems.flatMap(getProblemsTableRowVirtualDom)];
|
|
2555
2689
|
return dom;
|
|
2556
2690
|
};
|
|
@@ -2561,42 +2695,42 @@ const getProblemsTableHeaderVirtualDom = () => {
|
|
|
2561
2695
|
const textMessage = message();
|
|
2562
2696
|
const textFile = file();
|
|
2563
2697
|
const dom = [{
|
|
2564
|
-
|
|
2698
|
+
childCount: 1,
|
|
2565
2699
|
className: ProblemsTableHeader,
|
|
2566
|
-
|
|
2700
|
+
type: Div
|
|
2567
2701
|
}, {
|
|
2568
|
-
|
|
2702
|
+
childCount: 5,
|
|
2569
2703
|
className: ProblemsTableRow,
|
|
2570
|
-
|
|
2704
|
+
type: Div
|
|
2571
2705
|
}, {
|
|
2572
|
-
|
|
2706
|
+
childCount: 0,
|
|
2573
2707
|
className: ProblemsTableRowItem,
|
|
2574
|
-
|
|
2708
|
+
type: Div
|
|
2575
2709
|
}, {
|
|
2576
|
-
|
|
2710
|
+
childCount: 1,
|
|
2577
2711
|
className: ProblemsTableRowItem,
|
|
2578
|
-
|
|
2712
|
+
type: Div
|
|
2579
2713
|
}, text(textCode), {
|
|
2580
|
-
|
|
2714
|
+
childCount: 1,
|
|
2581
2715
|
className: ProblemsTableRowItem,
|
|
2582
|
-
|
|
2716
|
+
type: Div
|
|
2583
2717
|
}, text(textMessage), {
|
|
2584
|
-
|
|
2718
|
+
childCount: 1,
|
|
2585
2719
|
className: ProblemsTableRowItem,
|
|
2586
|
-
|
|
2720
|
+
type: Div
|
|
2587
2721
|
}, text(textFile), {
|
|
2588
|
-
|
|
2722
|
+
childCount: 1,
|
|
2589
2723
|
className: ProblemsTableRowItem,
|
|
2590
|
-
|
|
2724
|
+
type: Div
|
|
2591
2725
|
}, text(textSource)];
|
|
2592
2726
|
return dom;
|
|
2593
2727
|
};
|
|
2594
2728
|
|
|
2595
2729
|
const getProblemsTableVirtualDom = problems => {
|
|
2596
2730
|
const dom = [{
|
|
2597
|
-
|
|
2731
|
+
childCount: 2,
|
|
2598
2732
|
className: ProblemsTable,
|
|
2599
|
-
|
|
2733
|
+
type: Div
|
|
2600
2734
|
}, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
|
|
2601
2735
|
return dom;
|
|
2602
2736
|
};
|
|
@@ -2604,9 +2738,9 @@ const getProblemsTableVirtualDom = problems => {
|
|
|
2604
2738
|
const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
|
|
2605
2739
|
if (problems.length === 0 && message) {
|
|
2606
2740
|
return [{
|
|
2607
|
-
|
|
2741
|
+
childCount: 1,
|
|
2608
2742
|
className: Message,
|
|
2609
|
-
|
|
2743
|
+
type: Div
|
|
2610
2744
|
}, text(message)];
|
|
2611
2745
|
}
|
|
2612
2746
|
if (problems.length === 0 && filterValue) {
|
|
@@ -2625,19 +2759,19 @@ const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message
|
|
|
2625
2759
|
// TODO avoid mutation
|
|
2626
2760
|
const dom = [];
|
|
2627
2761
|
dom.push({
|
|
2628
|
-
|
|
2762
|
+
childCount: 1,
|
|
2629
2763
|
className: mergeClassNames(Viewlet, Problems),
|
|
2630
|
-
tabIndex: 0,
|
|
2631
|
-
onPointerDown: HandlePointerDown,
|
|
2632
|
-
onContextMenu: HandleContextMenu,
|
|
2633
2764
|
onBlur: HandleBlur,
|
|
2634
|
-
|
|
2765
|
+
onContextMenu: HandleContextMenu,
|
|
2766
|
+
onPointerDown: HandlePointerDown,
|
|
2767
|
+
tabIndex: 0,
|
|
2768
|
+
type: Div
|
|
2635
2769
|
});
|
|
2636
2770
|
if (isSmall) {
|
|
2637
2771
|
dom[0].childCount++;
|
|
2638
2772
|
dom.push(...getProblemsFilterVirtualDom({
|
|
2639
|
-
command: HandleFilterInput,
|
|
2640
2773
|
badgeText: '',
|
|
2774
|
+
command: HandleFilterInput,
|
|
2641
2775
|
placeholder: filter()}));
|
|
2642
2776
|
}
|
|
2643
2777
|
dom.push(...getProblemsVirtualDom$1(viewMode, problems, filterValue, message));
|
|
@@ -2675,11 +2809,11 @@ const filterProblems = (problems, collapsedUris, filterValue) => {
|
|
|
2675
2809
|
}
|
|
2676
2810
|
filtered.push({
|
|
2677
2811
|
...problem,
|
|
2678
|
-
|
|
2679
|
-
sourceMatchIndex,
|
|
2680
|
-
messageMatchIndex,
|
|
2812
|
+
isCollapsed,
|
|
2681
2813
|
listItemType: getListItemType(problem.listItemType, isCollapsed),
|
|
2682
|
-
|
|
2814
|
+
messageMatchIndex,
|
|
2815
|
+
sourceMatchIndex,
|
|
2816
|
+
uriMatchIndex
|
|
2683
2817
|
});
|
|
2684
2818
|
}
|
|
2685
2819
|
return filtered;
|
|
@@ -2707,10 +2841,10 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
|
|
|
2707
2841
|
const problem = filtered[i];
|
|
2708
2842
|
visibleItems.push({
|
|
2709
2843
|
...problem,
|
|
2710
|
-
|
|
2711
|
-
isActive: i === focusedIndex,
|
|
2844
|
+
filterValueLength,
|
|
2712
2845
|
icon: getIcon(problem.uri),
|
|
2713
|
-
|
|
2846
|
+
isActive: i === focusedIndex,
|
|
2847
|
+
isEven: i % 2 === 0
|
|
2714
2848
|
});
|
|
2715
2849
|
}
|
|
2716
2850
|
return visibleItems;
|
|
@@ -2718,14 +2852,14 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
|
|
|
2718
2852
|
|
|
2719
2853
|
const renderItems = (oldState, newState) => {
|
|
2720
2854
|
const {
|
|
2721
|
-
problems,
|
|
2722
|
-
width,
|
|
2723
|
-
smallWidthBreakPoint,
|
|
2724
2855
|
collapsedUris,
|
|
2856
|
+
filterValue,
|
|
2725
2857
|
focusedIndex,
|
|
2858
|
+
message,
|
|
2859
|
+
problems,
|
|
2860
|
+
smallWidthBreakPoint,
|
|
2726
2861
|
viewMode,
|
|
2727
|
-
|
|
2728
|
-
message
|
|
2862
|
+
width
|
|
2729
2863
|
} = newState;
|
|
2730
2864
|
const visible = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue);
|
|
2731
2865
|
const isSmall = width <= smallWidthBreakPoint;
|
|
@@ -2735,10 +2869,10 @@ const renderItems = (oldState, newState) => {
|
|
|
2735
2869
|
|
|
2736
2870
|
const getRenderer = diffType => {
|
|
2737
2871
|
switch (diffType) {
|
|
2738
|
-
case RenderItems:
|
|
2739
|
-
return renderItems;
|
|
2740
2872
|
case RenderFilterValue:
|
|
2741
2873
|
return renderFilterValue;
|
|
2874
|
+
case RenderItems:
|
|
2875
|
+
return renderItems;
|
|
2742
2876
|
default:
|
|
2743
2877
|
throw new Error('unknown renderer');
|
|
2744
2878
|
}
|
|
@@ -2755,8 +2889,8 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
2755
2889
|
|
|
2756
2890
|
const render2 = (uid, diffResult) => {
|
|
2757
2891
|
const {
|
|
2758
|
-
|
|
2759
|
-
|
|
2892
|
+
newState,
|
|
2893
|
+
oldState
|
|
2760
2894
|
} = get(uid);
|
|
2761
2895
|
set$1(uid, newState, newState);
|
|
2762
2896
|
const commands = applyRender(oldState, newState, diffResult);
|
|
@@ -2776,23 +2910,23 @@ const getActionVirtualDom = action => {
|
|
|
2776
2910
|
|
|
2777
2911
|
const getActionsVirtualDom = actions => {
|
|
2778
2912
|
return [{
|
|
2779
|
-
|
|
2913
|
+
childCount: actions.length,
|
|
2780
2914
|
className: Actions,
|
|
2781
2915
|
role: ToolBar,
|
|
2782
|
-
|
|
2916
|
+
type: Div
|
|
2783
2917
|
}, ...actions.flatMap(getActionVirtualDom)];
|
|
2784
2918
|
};
|
|
2785
2919
|
|
|
2786
2920
|
const getActions = state => {
|
|
2787
2921
|
const {
|
|
2788
|
-
problems,
|
|
2789
|
-
width,
|
|
2790
2922
|
collapsedUris,
|
|
2791
|
-
focusedIndex,
|
|
2792
|
-
smallWidthBreakPoint,
|
|
2793
2923
|
filterValue,
|
|
2924
|
+
focusedIndex,
|
|
2794
2925
|
inputSource,
|
|
2795
|
-
|
|
2926
|
+
problems,
|
|
2927
|
+
smallWidthBreakPoint,
|
|
2928
|
+
viewMode,
|
|
2929
|
+
width
|
|
2796
2930
|
} = state;
|
|
2797
2931
|
const visibleCount = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue).length;
|
|
2798
2932
|
const problemsCount = problems.length;
|
|
@@ -2800,32 +2934,32 @@ const getActions = state => {
|
|
|
2800
2934
|
const actions = [];
|
|
2801
2935
|
if (!isSmall) {
|
|
2802
2936
|
actions.push({
|
|
2803
|
-
type: ProblemsFilter,
|
|
2804
|
-
id: 'Filter',
|
|
2805
|
-
command: HandleFilterInput,
|
|
2806
2937
|
badgeText: visibleCount === problemsCount ? '' : showingOf(visibleCount, problemsCount),
|
|
2938
|
+
command: HandleFilterInput,
|
|
2939
|
+
id: 'Filter',
|
|
2807
2940
|
placeholder: filter(),
|
|
2941
|
+
type: ProblemsFilter,
|
|
2808
2942
|
value: inputSource === Script ? filterValue : ''
|
|
2809
2943
|
});
|
|
2810
2944
|
}
|
|
2811
2945
|
if (viewMode === Table) {
|
|
2812
2946
|
actions.push({
|
|
2813
|
-
type: Button,
|
|
2814
|
-
id: viewAsList$1(),
|
|
2815
2947
|
command: 'viewAsList',
|
|
2816
|
-
icon: ListTree
|
|
2948
|
+
icon: ListTree,
|
|
2949
|
+
id: viewAsList$1(),
|
|
2950
|
+
type: Button
|
|
2817
2951
|
});
|
|
2818
2952
|
} else {
|
|
2819
2953
|
actions.push({
|
|
2820
|
-
type: Button,
|
|
2821
|
-
id: collapseAll(),
|
|
2822
2954
|
command: 'collapseAll',
|
|
2823
|
-
icon: CollapseAll
|
|
2955
|
+
icon: CollapseAll,
|
|
2956
|
+
id: collapseAll(),
|
|
2957
|
+
type: Button
|
|
2824
2958
|
}, {
|
|
2825
|
-
type: Button,
|
|
2826
|
-
id: viewAsTable$1(),
|
|
2827
2959
|
command: 'viewAsTable',
|
|
2828
|
-
icon: ListFlat
|
|
2960
|
+
icon: ListFlat,
|
|
2961
|
+
id: viewAsTable$1(),
|
|
2962
|
+
type: Button
|
|
2829
2963
|
});
|
|
2830
2964
|
}
|
|
2831
2965
|
return actions;
|
|
@@ -2858,6 +2992,9 @@ const renderEventListeners = () => {
|
|
|
2858
2992
|
}, {
|
|
2859
2993
|
name: HandlePointerDown,
|
|
2860
2994
|
params: ['handleClickAt', 'event.clientX', 'event.clientY']
|
|
2995
|
+
}, {
|
|
2996
|
+
name: HandleClickMoreFilters,
|
|
2997
|
+
params: ['handleClickMoreFilters']
|
|
2861
2998
|
}];
|
|
2862
2999
|
};
|
|
2863
3000
|
|
|
@@ -2870,14 +3007,14 @@ const resize = (state, dimensions) => {
|
|
|
2870
3007
|
|
|
2871
3008
|
const saveState = state => {
|
|
2872
3009
|
const {
|
|
2873
|
-
|
|
3010
|
+
collapsedUris,
|
|
2874
3011
|
filterValue,
|
|
2875
|
-
|
|
3012
|
+
viewMode
|
|
2876
3013
|
} = state;
|
|
2877
3014
|
return {
|
|
2878
|
-
|
|
3015
|
+
collapsedUris,
|
|
2879
3016
|
filterValue,
|
|
2880
|
-
|
|
3017
|
+
viewMode
|
|
2881
3018
|
};
|
|
2882
3019
|
};
|
|
2883
3020
|
|
|
@@ -2902,11 +3039,13 @@ const commandMap = {
|
|
|
2902
3039
|
'Problems.focusIndex': wrapCommand(focusIndex),
|
|
2903
3040
|
'Problems.getCommandIds': getCommandIds,
|
|
2904
3041
|
'Problems.getKeyBindings': getKeyBindings,
|
|
3042
|
+
'Problems.getMenuIds': getMenuIds,
|
|
2905
3043
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
2906
3044
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
2907
3045
|
'Problems.handleClickAt': wrapCommand(handleClickAt),
|
|
2908
|
-
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2909
3046
|
'Problems.handleClickButton': wrapCommand(handleClickButton),
|
|
3047
|
+
'Problems.handleClickMoreFilters': wrapCommand(handleClickMoreFilters),
|
|
3048
|
+
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2910
3049
|
'Problems.handleFilterInput': wrapCommand(handleFilterInput),
|
|
2911
3050
|
'Problems.handleIconThemeChange': wrapCommand(handleIconThemeChange),
|
|
2912
3051
|
'Problems.initialize': initialize,
|