@lvce-editor/problems-view 1.17.0 → 1.19.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 +267 -723
- package/package.json +1 -1
|
@@ -2,46 +2,72 @@ const toCommandId = key => {
|
|
|
2
2
|
const dotIndex = key.indexOf('.');
|
|
3
3
|
return key.slice(dotIndex + 1);
|
|
4
4
|
};
|
|
5
|
-
const create$
|
|
5
|
+
const create$a = () => {
|
|
6
6
|
const states = Object.create(null);
|
|
7
7
|
const commandMapRef = {};
|
|
8
8
|
return {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
clear() {
|
|
10
|
+
for (const key of Object.keys(states)) {
|
|
11
|
+
delete states[key];
|
|
12
|
+
}
|
|
11
13
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
14
|
+
diff(uid, modules, numbers) {
|
|
15
|
+
const {
|
|
16
|
+
newState,
|
|
17
|
+
oldState
|
|
18
|
+
} = states[uid];
|
|
19
|
+
const diffResult = [];
|
|
20
|
+
for (let i = 0; i < modules.length; i++) {
|
|
21
|
+
const fn = modules[i];
|
|
22
|
+
if (!fn(oldState, newState)) {
|
|
23
|
+
diffResult.push(numbers[i]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return diffResult;
|
|
17
27
|
},
|
|
18
28
|
dispose(uid) {
|
|
19
29
|
delete states[uid];
|
|
20
30
|
},
|
|
31
|
+
get(uid) {
|
|
32
|
+
return states[uid];
|
|
33
|
+
},
|
|
34
|
+
getCommandIds() {
|
|
35
|
+
const keys = Object.keys(commandMapRef);
|
|
36
|
+
const ids = keys.map(toCommandId);
|
|
37
|
+
return ids;
|
|
38
|
+
},
|
|
21
39
|
getKeys() {
|
|
22
40
|
return Object.keys(states).map(key => {
|
|
23
|
-
return Number.
|
|
41
|
+
return Number.parseFloat(key);
|
|
24
42
|
});
|
|
25
43
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
44
|
+
registerCommands(commandMap) {
|
|
45
|
+
Object.assign(commandMapRef, commandMap);
|
|
46
|
+
},
|
|
47
|
+
set(uid, oldState, newState) {
|
|
48
|
+
states[uid] = {
|
|
49
|
+
newState,
|
|
50
|
+
oldState
|
|
51
|
+
};
|
|
30
52
|
},
|
|
31
53
|
wrapCommand(fn) {
|
|
32
54
|
const wrapped = async (uid, ...args) => {
|
|
33
55
|
const {
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
newState,
|
|
57
|
+
oldState
|
|
36
58
|
} = states[uid];
|
|
37
59
|
const newerState = await fn(newState, ...args);
|
|
38
60
|
if (oldState === newerState || newState === newerState) {
|
|
39
61
|
return;
|
|
40
62
|
}
|
|
41
|
-
const
|
|
63
|
+
const latestOld = states[uid];
|
|
64
|
+
const latestNew = {
|
|
65
|
+
...latestOld.newState,
|
|
66
|
+
...newerState
|
|
67
|
+
};
|
|
42
68
|
states[uid] = {
|
|
43
|
-
|
|
44
|
-
|
|
69
|
+
newState: latestNew,
|
|
70
|
+
oldState: latestOld.oldState
|
|
45
71
|
};
|
|
46
72
|
};
|
|
47
73
|
return wrapped;
|
|
@@ -55,27 +81,36 @@ const create$6 = () => {
|
|
|
55
81
|
};
|
|
56
82
|
return wrapped;
|
|
57
83
|
},
|
|
58
|
-
|
|
59
|
-
const {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
wrapLoadContent(fn) {
|
|
85
|
+
const wrapped = async (uid, ...args) => {
|
|
86
|
+
const {
|
|
87
|
+
newState,
|
|
88
|
+
oldState
|
|
89
|
+
} = states[uid];
|
|
90
|
+
const result = await fn(newState, ...args);
|
|
91
|
+
const {
|
|
92
|
+
error,
|
|
93
|
+
state
|
|
94
|
+
} = result;
|
|
95
|
+
if (oldState === state || newState === state) {
|
|
96
|
+
return {
|
|
97
|
+
error
|
|
98
|
+
};
|
|
68
99
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
100
|
+
const latestOld = states[uid];
|
|
101
|
+
const latestNew = {
|
|
102
|
+
...latestOld.newState,
|
|
103
|
+
...state
|
|
104
|
+
};
|
|
105
|
+
states[uid] = {
|
|
106
|
+
newState: latestNew,
|
|
107
|
+
oldState: latestOld.oldState
|
|
108
|
+
};
|
|
109
|
+
return {
|
|
110
|
+
error
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
return wrapped;
|
|
79
114
|
}
|
|
80
115
|
};
|
|
81
116
|
};
|
|
@@ -83,39 +118,6 @@ const terminate = () => {
|
|
|
83
118
|
globalThis.close();
|
|
84
119
|
};
|
|
85
120
|
|
|
86
|
-
const None$2 = 'none';
|
|
87
|
-
const ToolBar = 'toolbar';
|
|
88
|
-
const Tree = 'tree';
|
|
89
|
-
const TreeItem = 'treeitem';
|
|
90
|
-
|
|
91
|
-
const Button$1 = 1;
|
|
92
|
-
const Div = 4;
|
|
93
|
-
const Input = 6;
|
|
94
|
-
const Span = 8;
|
|
95
|
-
const Text = 12;
|
|
96
|
-
const Img = 17;
|
|
97
|
-
const A = 53;
|
|
98
|
-
|
|
99
|
-
const Space = 9;
|
|
100
|
-
const PageUp = 10;
|
|
101
|
-
const PageDown = 11;
|
|
102
|
-
const End = 255;
|
|
103
|
-
const Home = 12;
|
|
104
|
-
const LeftArrow = 13;
|
|
105
|
-
const UpArrow = 14;
|
|
106
|
-
const RightArrow = 15;
|
|
107
|
-
const DownArrow = 16;
|
|
108
|
-
|
|
109
|
-
const Script$1 = 2;
|
|
110
|
-
|
|
111
|
-
const ProblemsFilter$1 = 25;
|
|
112
|
-
|
|
113
|
-
const None$1 = 0;
|
|
114
|
-
|
|
115
|
-
const DebugWorker = 55;
|
|
116
|
-
const EditorWorker$1 = 99;
|
|
117
|
-
const RendererWorker$1 = 1;
|
|
118
|
-
|
|
119
121
|
const normalizeLine = line => {
|
|
120
122
|
if (line.startsWith('Error: ')) {
|
|
121
123
|
return line.slice('Error: '.length);
|
|
@@ -580,7 +582,7 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
580
582
|
return promise;
|
|
581
583
|
};
|
|
582
584
|
const Message$1$1 = 3;
|
|
583
|
-
const create$5 = async ({
|
|
585
|
+
const create$5$1 = async ({
|
|
584
586
|
isMessagePortOpen,
|
|
585
587
|
messagePort
|
|
586
588
|
}) => {
|
|
@@ -631,11 +633,32 @@ const wrap$5 = messagePort => {
|
|
|
631
633
|
};
|
|
632
634
|
const IpcParentWithMessagePort$1 = {
|
|
633
635
|
__proto__: null,
|
|
634
|
-
create: create$5,
|
|
636
|
+
create: create$5$1,
|
|
635
637
|
signal: signal$1,
|
|
636
638
|
wrap: wrap$5
|
|
637
639
|
};
|
|
638
640
|
|
|
641
|
+
class CommandNotFoundError extends Error {
|
|
642
|
+
constructor(command) {
|
|
643
|
+
super(`Command not found ${command}`);
|
|
644
|
+
this.name = 'CommandNotFoundError';
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
const commands = Object.create(null);
|
|
648
|
+
const register = commandMap => {
|
|
649
|
+
Object.assign(commands, commandMap);
|
|
650
|
+
};
|
|
651
|
+
const getCommand = key => {
|
|
652
|
+
return commands[key];
|
|
653
|
+
};
|
|
654
|
+
const execute = (command, ...args) => {
|
|
655
|
+
const fn = getCommand(command);
|
|
656
|
+
if (!fn) {
|
|
657
|
+
throw new CommandNotFoundError(command);
|
|
658
|
+
}
|
|
659
|
+
return fn(...args);
|
|
660
|
+
};
|
|
661
|
+
|
|
639
662
|
const Two$1 = '2.0';
|
|
640
663
|
const callbacks = Object.create(null);
|
|
641
664
|
const get$2 = id => {
|
|
@@ -660,12 +683,12 @@ const getErrorConstructor = (message, type) => {
|
|
|
660
683
|
switch (type) {
|
|
661
684
|
case DomException:
|
|
662
685
|
return DOMException;
|
|
663
|
-
case TypeError$1:
|
|
664
|
-
return TypeError;
|
|
665
|
-
case SyntaxError$1:
|
|
666
|
-
return SyntaxError;
|
|
667
686
|
case ReferenceError$1:
|
|
668
687
|
return ReferenceError;
|
|
688
|
+
case SyntaxError$1:
|
|
689
|
+
return SyntaxError;
|
|
690
|
+
case TypeError$1:
|
|
691
|
+
return TypeError;
|
|
669
692
|
default:
|
|
670
693
|
return Error;
|
|
671
694
|
}
|
|
@@ -821,56 +844,56 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
821
844
|
if (error && error.code === E_COMMAND_NOT_FOUND) {
|
|
822
845
|
return {
|
|
823
846
|
code: MethodNotFound,
|
|
824
|
-
|
|
825
|
-
|
|
847
|
+
data: error.stack,
|
|
848
|
+
message: error.message
|
|
826
849
|
};
|
|
827
850
|
}
|
|
828
851
|
return {
|
|
829
852
|
code: Custom,
|
|
830
|
-
message: prettyError.message,
|
|
831
853
|
data: {
|
|
832
|
-
stack: getStack(prettyError),
|
|
833
|
-
codeFrame: prettyError.codeFrame,
|
|
834
|
-
type: getErrorType(prettyError),
|
|
835
854
|
code: prettyError.code,
|
|
836
|
-
|
|
837
|
-
|
|
855
|
+
codeFrame: prettyError.codeFrame,
|
|
856
|
+
name: prettyError.name,
|
|
857
|
+
stack: getStack(prettyError),
|
|
858
|
+
type: getErrorType(prettyError)
|
|
859
|
+
},
|
|
860
|
+
message: prettyError.message
|
|
838
861
|
};
|
|
839
862
|
};
|
|
840
|
-
const create$1$
|
|
863
|
+
const create$1$1 = (id, error) => {
|
|
841
864
|
return {
|
|
842
|
-
|
|
865
|
+
error,
|
|
843
866
|
id,
|
|
844
|
-
|
|
867
|
+
jsonrpc: Two$1
|
|
845
868
|
};
|
|
846
869
|
};
|
|
847
870
|
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
848
871
|
const prettyError = preparePrettyError(error);
|
|
849
872
|
logError(error, prettyError);
|
|
850
873
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
851
|
-
return create$1$
|
|
874
|
+
return create$1$1(id, errorProperty);
|
|
852
875
|
};
|
|
853
|
-
const create$
|
|
876
|
+
const create$9 = (message, result) => {
|
|
854
877
|
return {
|
|
855
|
-
jsonrpc: Two$1,
|
|
856
878
|
id: message.id,
|
|
879
|
+
jsonrpc: Two$1,
|
|
857
880
|
result: result ?? null
|
|
858
881
|
};
|
|
859
882
|
};
|
|
860
883
|
const getSuccessResponse = (message, result) => {
|
|
861
884
|
const resultProperty = result ?? null;
|
|
862
|
-
return create$
|
|
885
|
+
return create$9(message, resultProperty);
|
|
863
886
|
};
|
|
864
887
|
const getErrorResponseSimple = (id, error) => {
|
|
865
888
|
return {
|
|
866
|
-
jsonrpc: Two$1,
|
|
867
|
-
id,
|
|
868
889
|
error: {
|
|
869
890
|
code: Custom,
|
|
891
|
+
data: error,
|
|
870
892
|
// @ts-ignore
|
|
871
|
-
message: error.message
|
|
872
|
-
|
|
873
|
-
|
|
893
|
+
message: error.message
|
|
894
|
+
},
|
|
895
|
+
id,
|
|
896
|
+
jsonrpc: Two$1
|
|
874
897
|
};
|
|
875
898
|
};
|
|
876
899
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
@@ -900,35 +923,35 @@ const normalizeParams = args => {
|
|
|
900
923
|
if (args.length === 1) {
|
|
901
924
|
const options = args[0];
|
|
902
925
|
return {
|
|
926
|
+
execute: options.execute,
|
|
903
927
|
ipc: options.ipc,
|
|
928
|
+
logError: options.logError || defaultLogError,
|
|
904
929
|
message: options.message,
|
|
905
|
-
execute: options.execute,
|
|
906
|
-
resolve: options.resolve || defaultResolve,
|
|
907
930
|
preparePrettyError: options.preparePrettyError || defaultPreparePrettyError,
|
|
908
|
-
|
|
909
|
-
|
|
931
|
+
requiresSocket: options.requiresSocket || defaultRequiresSocket,
|
|
932
|
+
resolve: options.resolve || defaultResolve
|
|
910
933
|
};
|
|
911
934
|
}
|
|
912
935
|
return {
|
|
936
|
+
execute: args[2],
|
|
913
937
|
ipc: args[0],
|
|
938
|
+
logError: args[5],
|
|
914
939
|
message: args[1],
|
|
915
|
-
execute: args[2],
|
|
916
|
-
resolve: args[3],
|
|
917
940
|
preparePrettyError: args[4],
|
|
918
|
-
|
|
919
|
-
|
|
941
|
+
requiresSocket: args[6],
|
|
942
|
+
resolve: args[3]
|
|
920
943
|
};
|
|
921
944
|
};
|
|
922
945
|
const handleJsonRpcMessage = async (...args) => {
|
|
923
946
|
const options = normalizeParams(args);
|
|
924
947
|
const {
|
|
925
|
-
message,
|
|
926
|
-
ipc,
|
|
927
948
|
execute,
|
|
928
|
-
|
|
929
|
-
preparePrettyError,
|
|
949
|
+
ipc,
|
|
930
950
|
logError,
|
|
931
|
-
|
|
951
|
+
message,
|
|
952
|
+
preparePrettyError,
|
|
953
|
+
requiresSocket,
|
|
954
|
+
resolve
|
|
932
955
|
} = options;
|
|
933
956
|
if ('id' in message) {
|
|
934
957
|
if ('method' in message) {
|
|
@@ -951,36 +974,17 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
951
974
|
throw new JsonRpcError('unexpected message');
|
|
952
975
|
};
|
|
953
976
|
|
|
954
|
-
class CommandNotFoundError extends Error {
|
|
955
|
-
constructor(command) {
|
|
956
|
-
super(`Command not found ${command}`);
|
|
957
|
-
this.name = 'CommandNotFoundError';
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
const commands = Object.create(null);
|
|
961
|
-
const register = commandMap => {
|
|
962
|
-
Object.assign(commands, commandMap);
|
|
963
|
-
};
|
|
964
|
-
const getCommand = key => {
|
|
965
|
-
return commands[key];
|
|
966
|
-
};
|
|
967
|
-
const execute = (command, ...args) => {
|
|
968
|
-
const fn = getCommand(command);
|
|
969
|
-
if (!fn) {
|
|
970
|
-
throw new CommandNotFoundError(command);
|
|
971
|
-
}
|
|
972
|
-
return fn(...args);
|
|
973
|
-
};
|
|
974
|
-
|
|
975
977
|
const Two = '2.0';
|
|
976
|
-
|
|
978
|
+
|
|
979
|
+
const create$8 = (method, params) => {
|
|
977
980
|
return {
|
|
978
981
|
jsonrpc: Two,
|
|
979
982
|
method,
|
|
980
983
|
params
|
|
981
984
|
};
|
|
982
985
|
};
|
|
983
|
-
|
|
986
|
+
|
|
987
|
+
const create$7 = (id, method, params) => {
|
|
984
988
|
const message = {
|
|
985
989
|
id,
|
|
986
990
|
jsonrpc: Two,
|
|
@@ -989,15 +993,14 @@ const create$r = (id, method, params) => {
|
|
|
989
993
|
};
|
|
990
994
|
return message;
|
|
991
995
|
};
|
|
996
|
+
|
|
992
997
|
let id = 0;
|
|
993
|
-
const create$
|
|
998
|
+
const create$6 = () => {
|
|
994
999
|
return ++id;
|
|
995
1000
|
};
|
|
996
1001
|
|
|
997
|
-
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
998
|
-
|
|
999
1002
|
const registerPromise = map => {
|
|
1000
|
-
const id = create$
|
|
1003
|
+
const id = create$6();
|
|
1001
1004
|
const {
|
|
1002
1005
|
promise,
|
|
1003
1006
|
resolve
|
|
@@ -1009,13 +1012,12 @@ const registerPromise = map => {
|
|
|
1009
1012
|
};
|
|
1010
1013
|
};
|
|
1011
1014
|
|
|
1012
|
-
// @ts-ignore
|
|
1013
1015
|
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
1014
1016
|
const {
|
|
1015
1017
|
id,
|
|
1016
1018
|
promise
|
|
1017
1019
|
} = registerPromise(callbacks);
|
|
1018
|
-
const message = create$
|
|
1020
|
+
const message = create$7(id, method, params);
|
|
1019
1021
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
1020
1022
|
ipc.sendAndTransfer(message);
|
|
1021
1023
|
} else {
|
|
@@ -1051,12 +1053,13 @@ const createRpc = ipc => {
|
|
|
1051
1053
|
* @deprecated
|
|
1052
1054
|
*/
|
|
1053
1055
|
send(method, ...params) {
|
|
1054
|
-
const message = create$
|
|
1056
|
+
const message = create$8(method, params);
|
|
1055
1057
|
ipc.send(message);
|
|
1056
1058
|
}
|
|
1057
1059
|
};
|
|
1058
1060
|
return rpc;
|
|
1059
1061
|
};
|
|
1062
|
+
|
|
1060
1063
|
const requiresSocket = () => {
|
|
1061
1064
|
return false;
|
|
1062
1065
|
};
|
|
@@ -1071,6 +1074,7 @@ const handleMessage = event => {
|
|
|
1071
1074
|
const actualExecute = event?.target?.execute || execute;
|
|
1072
1075
|
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
1073
1076
|
};
|
|
1077
|
+
|
|
1074
1078
|
const handleIpc = ipc => {
|
|
1075
1079
|
if ('addEventListener' in ipc) {
|
|
1076
1080
|
ipc.addEventListener('message', handleMessage);
|
|
@@ -1079,6 +1083,7 @@ const handleIpc = ipc => {
|
|
|
1079
1083
|
ipc.on('message', handleMessage);
|
|
1080
1084
|
}
|
|
1081
1085
|
};
|
|
1086
|
+
|
|
1082
1087
|
const listen$1 = async (module, options) => {
|
|
1083
1088
|
const rawIpc = await module.listen(options);
|
|
1084
1089
|
if (module.signal) {
|
|
@@ -1088,7 +1093,40 @@ const listen$1 = async (module, options) => {
|
|
|
1088
1093
|
return ipc;
|
|
1089
1094
|
};
|
|
1090
1095
|
|
|
1091
|
-
|
|
1096
|
+
const create$5 = async ({
|
|
1097
|
+
commandMap,
|
|
1098
|
+
isMessagePortOpen = true,
|
|
1099
|
+
messagePort
|
|
1100
|
+
}) => {
|
|
1101
|
+
// TODO create a commandMap per rpc instance
|
|
1102
|
+
register(commandMap);
|
|
1103
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
1104
|
+
isMessagePortOpen,
|
|
1105
|
+
messagePort
|
|
1106
|
+
});
|
|
1107
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
1108
|
+
handleIpc(ipc);
|
|
1109
|
+
const rpc = createRpc(ipc);
|
|
1110
|
+
messagePort.start();
|
|
1111
|
+
return rpc;
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
const create$4 = async ({
|
|
1115
|
+
commandMap,
|
|
1116
|
+
isMessagePortOpen,
|
|
1117
|
+
send
|
|
1118
|
+
}) => {
|
|
1119
|
+
const {
|
|
1120
|
+
port1,
|
|
1121
|
+
port2
|
|
1122
|
+
} = new MessageChannel();
|
|
1123
|
+
await send(port1);
|
|
1124
|
+
return create$5({
|
|
1125
|
+
commandMap,
|
|
1126
|
+
isMessagePortOpen,
|
|
1127
|
+
messagePort: port2
|
|
1128
|
+
});
|
|
1129
|
+
};
|
|
1092
1130
|
|
|
1093
1131
|
const createSharedLazyRpc = factory => {
|
|
1094
1132
|
let rpcPromise;
|
|
@@ -1117,57 +1155,22 @@ const createSharedLazyRpc = factory => {
|
|
|
1117
1155
|
}
|
|
1118
1156
|
};
|
|
1119
1157
|
};
|
|
1120
|
-
|
|
1158
|
+
|
|
1159
|
+
const create$3 = async ({
|
|
1121
1160
|
commandMap,
|
|
1122
1161
|
isMessagePortOpen,
|
|
1123
1162
|
send
|
|
1124
1163
|
}) => {
|
|
1125
1164
|
return createSharedLazyRpc(() => {
|
|
1126
|
-
return create$
|
|
1165
|
+
return create$4({
|
|
1127
1166
|
commandMap,
|
|
1128
1167
|
isMessagePortOpen,
|
|
1129
1168
|
send
|
|
1130
1169
|
});
|
|
1131
1170
|
});
|
|
1132
1171
|
};
|
|
1133
|
-
|
|
1134
|
-
__proto__: null,
|
|
1135
|
-
create: create$i
|
|
1136
|
-
};
|
|
1137
|
-
const create$4 = async ({
|
|
1138
|
-
commandMap,
|
|
1139
|
-
isMessagePortOpen = true,
|
|
1140
|
-
messagePort
|
|
1141
|
-
}) => {
|
|
1142
|
-
// TODO create a commandMap per rpc instance
|
|
1143
|
-
register(commandMap);
|
|
1144
|
-
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
1145
|
-
isMessagePortOpen,
|
|
1146
|
-
messagePort
|
|
1147
|
-
});
|
|
1148
|
-
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
1149
|
-
handleIpc(ipc);
|
|
1150
|
-
const rpc = createRpc(ipc);
|
|
1151
|
-
messagePort.start();
|
|
1152
|
-
return rpc;
|
|
1153
|
-
};
|
|
1172
|
+
|
|
1154
1173
|
const create$2 = async ({
|
|
1155
|
-
commandMap,
|
|
1156
|
-
isMessagePortOpen,
|
|
1157
|
-
send
|
|
1158
|
-
}) => {
|
|
1159
|
-
const {
|
|
1160
|
-
port1,
|
|
1161
|
-
port2
|
|
1162
|
-
} = new MessageChannel();
|
|
1163
|
-
await send(port1);
|
|
1164
|
-
return create$4({
|
|
1165
|
-
commandMap,
|
|
1166
|
-
isMessagePortOpen,
|
|
1167
|
-
messagePort: port2
|
|
1168
|
-
});
|
|
1169
|
-
};
|
|
1170
|
-
const create$1$1 = async ({
|
|
1171
1174
|
commandMap
|
|
1172
1175
|
}) => {
|
|
1173
1176
|
// TODO create a commandMap per rpc instance
|
|
@@ -1177,10 +1180,7 @@ const create$1$1 = async ({
|
|
|
1177
1180
|
const rpc = createRpc(ipc);
|
|
1178
1181
|
return rpc;
|
|
1179
1182
|
};
|
|
1180
|
-
|
|
1181
|
-
__proto__: null,
|
|
1182
|
-
create: create$1$1
|
|
1183
|
-
};
|
|
1183
|
+
|
|
1184
1184
|
const createMockRpc = ({
|
|
1185
1185
|
commandMap
|
|
1186
1186
|
}) => {
|
|
@@ -1249,81 +1249,41 @@ const create$1 = rpcId => {
|
|
|
1249
1249
|
};
|
|
1250
1250
|
};
|
|
1251
1251
|
|
|
1252
|
+
const None$1 = 'none';
|
|
1253
|
+
const ToolBar = 'toolbar';
|
|
1254
|
+
const Tree = 'tree';
|
|
1255
|
+
const TreeItem = 'treeitem';
|
|
1256
|
+
|
|
1257
|
+
const Button$1 = 1;
|
|
1258
|
+
const Div = 4;
|
|
1259
|
+
const Input = 6;
|
|
1260
|
+
const Span = 8;
|
|
1261
|
+
const Text = 12;
|
|
1262
|
+
const Img = 17;
|
|
1263
|
+
const A = 53;
|
|
1264
|
+
|
|
1265
|
+
const Space = 9;
|
|
1266
|
+
const PageUp = 10;
|
|
1267
|
+
const PageDown = 11;
|
|
1268
|
+
const End = 255;
|
|
1269
|
+
const Home = 12;
|
|
1270
|
+
const LeftArrow = 13;
|
|
1271
|
+
const UpArrow = 14;
|
|
1272
|
+
const RightArrow = 15;
|
|
1273
|
+
const DownArrow = 16;
|
|
1274
|
+
|
|
1275
|
+
const ProblemsFilter$1 = 25;
|
|
1276
|
+
|
|
1277
|
+
const Checked = 2;
|
|
1278
|
+
const Unchecked = 3;
|
|
1279
|
+
|
|
1280
|
+
const EditorWorker$1 = 99;
|
|
1281
|
+
const RendererWorker$1 = 1;
|
|
1282
|
+
|
|
1252
1283
|
const {
|
|
1253
|
-
dispose: dispose$1,
|
|
1254
1284
|
invoke: invoke$1,
|
|
1255
|
-
invokeAndTransfer: invokeAndTransfer$1,
|
|
1256
|
-
registerMockRpc: registerMockRpc$1,
|
|
1257
1285
|
set: set$3
|
|
1258
1286
|
} = create$1(EditorWorker$1);
|
|
1259
|
-
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1260
|
-
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1261
|
-
await invokeAndTransfer$1(
|
|
1262
|
-
// @ts-ignore
|
|
1263
|
-
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, 0);
|
|
1264
|
-
};
|
|
1265
|
-
// TODO add tests for this
|
|
1266
|
-
const activateByEvent$1 = async event => {
|
|
1267
|
-
// @ts-ignore
|
|
1268
|
-
await invoke$1('ActivateByEvent.activateByEvent', event);
|
|
1269
|
-
};
|
|
1270
|
-
const applyEdit = async (editorUid, changes) => {
|
|
1271
|
-
// @ts-ignore
|
|
1272
|
-
await invoke$1('Editor.applyEdit2', editorUid, changes);
|
|
1273
|
-
};
|
|
1274
|
-
const applyDocumentEdits = async (editorUid, changes) => {
|
|
1275
|
-
// @ts-ignore
|
|
1276
|
-
await invoke$1('Editor.applyDocumentEdits', editorUid, changes);
|
|
1277
|
-
};
|
|
1278
|
-
const applyWorkspaceEdit = async (editorUid, changes) => {
|
|
1279
|
-
// @ts-ignore
|
|
1280
|
-
await invoke$1('Editor.applyWorkspaceEdit', editorUid, changes);
|
|
1281
|
-
};
|
|
1282
|
-
const closeWidget$1 = async (editorUid, widgetId, widgetName, focusId) => {
|
|
1283
|
-
// @ts-ignore
|
|
1284
|
-
await invoke$1('Editor.closeWidget2', editorUid, widgetId, widgetName, focusId);
|
|
1285
|
-
};
|
|
1286
|
-
const getWordAt = async (uid, rowIndex, columnIndex) => {
|
|
1287
|
-
// @ts-ignore
|
|
1288
|
-
const word = await invoke$1('Editor.getWordAt2', uid, rowIndex, columnIndex);
|
|
1289
|
-
return word;
|
|
1290
|
-
};
|
|
1291
|
-
const getLines = async editorUid => {
|
|
1292
|
-
const lines = await invoke$1('Editor.getLines2', editorUid);
|
|
1293
|
-
return lines;
|
|
1294
|
-
};
|
|
1295
|
-
const getPositionAtCursor = async parentUid => {
|
|
1296
|
-
const position = await invoke$1('Editor.getPositionAtCursor', parentUid);
|
|
1297
|
-
return position;
|
|
1298
|
-
};
|
|
1299
|
-
const getOffsetAtCursor = async editorId => {
|
|
1300
|
-
// @ts-ignore
|
|
1301
|
-
return await invoke$1('Editor.getOffsetAtCursor', editorId);
|
|
1302
|
-
};
|
|
1303
|
-
const getSelections = async editorUid => {
|
|
1304
|
-
const selections = await invoke$1('Editor.getSelections2', editorUid);
|
|
1305
|
-
return selections;
|
|
1306
|
-
};
|
|
1307
|
-
const getWordAtOffset2 = async editorUid => {
|
|
1308
|
-
return invoke$1('Editor.getWordAtOffset2', editorUid);
|
|
1309
|
-
};
|
|
1310
|
-
const closeFind2 = async editorUid => {
|
|
1311
|
-
return invoke$1('Editor.closeFind2', editorUid);
|
|
1312
|
-
};
|
|
1313
|
-
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
1314
|
-
return invoke$1('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
|
|
1315
|
-
};
|
|
1316
|
-
const updateDebugInfo = async info => {
|
|
1317
|
-
await invoke$1('Editor.updateDebugInfo', info);
|
|
1318
|
-
};
|
|
1319
|
-
const getUri = async editorUid => {
|
|
1320
|
-
// @ts-ignore
|
|
1321
|
-
return invoke$1('Editor.getUri', editorUid);
|
|
1322
|
-
};
|
|
1323
|
-
const getLanguageId = async editorUid => {
|
|
1324
|
-
// @ts-ignore
|
|
1325
|
-
return invoke$1('Editor.getLanguageId', editorUid);
|
|
1326
|
-
};
|
|
1327
1287
|
const getProblems$2 = async () => {
|
|
1328
1288
|
// @ts-ignore
|
|
1329
1289
|
return invoke$1('Editor.getProblems');
|
|
@@ -1331,463 +1291,38 @@ const getProblems$2 = async () => {
|
|
|
1331
1291
|
|
|
1332
1292
|
const EditorWorker = {
|
|
1333
1293
|
__proto__: null,
|
|
1334
|
-
activateByEvent: activateByEvent$1,
|
|
1335
|
-
applyDocumentEdits,
|
|
1336
|
-
applyEdit,
|
|
1337
|
-
applyWorkspaceEdit,
|
|
1338
|
-
closeFind2,
|
|
1339
|
-
closeWidget: closeWidget$1,
|
|
1340
|
-
dispose: dispose$1,
|
|
1341
|
-
getLanguageId,
|
|
1342
|
-
getLines,
|
|
1343
|
-
getOffsetAtCursor,
|
|
1344
|
-
getPositionAtCursor,
|
|
1345
1294
|
getProblems: getProblems$2,
|
|
1346
|
-
getSelections,
|
|
1347
|
-
getUri,
|
|
1348
|
-
getWordAt,
|
|
1349
|
-
getWordAtOffset2,
|
|
1350
|
-
getWordBefore,
|
|
1351
1295
|
invoke: invoke$1,
|
|
1352
|
-
|
|
1353
|
-
registerMockRpc: registerMockRpc$1,
|
|
1354
|
-
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1355
|
-
set: set$3,
|
|
1356
|
-
updateDebugInfo
|
|
1296
|
+
set: set$3
|
|
1357
1297
|
};
|
|
1358
1298
|
|
|
1359
1299
|
const {
|
|
1360
|
-
dispose,
|
|
1361
1300
|
invoke,
|
|
1362
1301
|
invokeAndTransfer,
|
|
1363
|
-
registerMockRpc,
|
|
1364
1302
|
set: set$2
|
|
1365
1303
|
} = create$1(RendererWorker$1);
|
|
1366
|
-
const searchFileHtml = async uri => {
|
|
1367
|
-
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
1368
|
-
};
|
|
1369
|
-
const getFilePathElectron = async file => {
|
|
1370
|
-
return invoke('FileSystemHandle.getFilePathElectron', file);
|
|
1371
|
-
};
|
|
1372
|
-
/**
|
|
1373
|
-
* @deprecated
|
|
1374
|
-
*/
|
|
1375
|
-
const showContextMenu = async (x, y, id, ...args) => {
|
|
1376
|
-
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
1377
|
-
};
|
|
1378
1304
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1379
1305
|
number(uid);
|
|
1380
1306
|
number(menuId);
|
|
1381
1307
|
number(x);
|
|
1382
1308
|
number(y);
|
|
1383
|
-
// @ts-ignore
|
|
1384
1309
|
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1385
1310
|
};
|
|
1386
|
-
const getElectronVersion = async () => {
|
|
1387
|
-
return invoke('Process.getElectronVersion');
|
|
1388
|
-
};
|
|
1389
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1390
|
-
await invoke('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1391
|
-
};
|
|
1392
|
-
const setColorTheme = async id => {
|
|
1393
|
-
// @ts-ignore
|
|
1394
|
-
return invoke(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1395
|
-
};
|
|
1396
|
-
const getNodeVersion = async () => {
|
|
1397
|
-
return invoke('Process.getNodeVersion');
|
|
1398
|
-
};
|
|
1399
|
-
const getChromeVersion = async () => {
|
|
1400
|
-
return invoke('Process.getChromeVersion');
|
|
1401
|
-
};
|
|
1402
|
-
const getV8Version = async () => {
|
|
1403
|
-
return invoke('Process.getV8Version');
|
|
1404
|
-
};
|
|
1405
|
-
const getFileHandles = async fileIds => {
|
|
1406
|
-
const files = await invoke('FileSystemHandle.getFileHandles', fileIds);
|
|
1407
|
-
return files;
|
|
1408
|
-
};
|
|
1409
|
-
const setWorkspacePath = async path => {
|
|
1410
|
-
await invoke('Workspace.setPath', path);
|
|
1411
|
-
};
|
|
1412
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1413
|
-
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1414
|
-
};
|
|
1415
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1416
|
-
await invoke('WebView.unregisterInterceptor', id);
|
|
1417
|
-
};
|
|
1418
1311
|
const sendMessagePortToEditorWorker$1 = async (port, rpcId) => {
|
|
1419
1312
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1420
|
-
// @ts-ignore
|
|
1421
1313
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1422
1314
|
};
|
|
1423
|
-
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1424
|
-
const command = 'Errors.handleMessagePort';
|
|
1425
|
-
// @ts-ignore
|
|
1426
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1427
|
-
};
|
|
1428
|
-
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1429
|
-
const command = 'Markdown.handleMessagePort';
|
|
1430
|
-
// @ts-ignore
|
|
1431
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1432
|
-
};
|
|
1433
|
-
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1434
|
-
const command = 'IconTheme.handleMessagePort';
|
|
1435
|
-
// @ts-ignore
|
|
1436
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1437
|
-
};
|
|
1438
|
-
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1439
|
-
const command = 'FileSystem.handleMessagePort';
|
|
1440
|
-
// @ts-ignore
|
|
1441
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1442
|
-
};
|
|
1443
|
-
const readFile = async uri => {
|
|
1444
|
-
return invoke('FileSystem.readFile', uri);
|
|
1445
|
-
};
|
|
1446
|
-
const getWebViewSecret = async key => {
|
|
1447
|
-
// @ts-ignore
|
|
1448
|
-
return invoke('WebView.getSecret', key);
|
|
1449
|
-
};
|
|
1450
|
-
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1451
|
-
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1452
|
-
};
|
|
1453
|
-
const setFocus = key => {
|
|
1454
|
-
return invoke('Focus.setFocus', key);
|
|
1455
|
-
};
|
|
1456
|
-
const getFileIcon = async options => {
|
|
1457
|
-
return invoke('IconTheme.getFileIcon', options);
|
|
1458
|
-
};
|
|
1459
|
-
const getColorThemeNames = async () => {
|
|
1460
|
-
return invoke('ColorTheme.getColorThemeNames');
|
|
1461
|
-
};
|
|
1462
|
-
const disableExtension = async id => {
|
|
1463
|
-
// @ts-ignore
|
|
1464
|
-
return invoke('ExtensionManagement.disable', id);
|
|
1465
|
-
};
|
|
1466
|
-
const enableExtension = async id => {
|
|
1467
|
-
// @ts-ignore
|
|
1468
|
-
return invoke('ExtensionManagement.enable', id);
|
|
1469
|
-
};
|
|
1470
|
-
const handleDebugChange = async params => {
|
|
1471
|
-
// @ts-ignore
|
|
1472
|
-
return invoke('Run And Debug.handleChange', params);
|
|
1473
|
-
};
|
|
1474
|
-
const getFolderIcon = async options => {
|
|
1475
|
-
return invoke('IconTheme.getFolderIcon', options);
|
|
1476
|
-
};
|
|
1477
|
-
const handleWorkspaceRefresh = async () => {
|
|
1478
|
-
return invoke('Layout.handleWorkspaceRefresh');
|
|
1479
|
-
};
|
|
1480
|
-
const closeWidget = async widgetId => {
|
|
1481
|
-
return invoke('Viewlet.closeWidget', widgetId);
|
|
1482
|
-
};
|
|
1483
|
-
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1484
|
-
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1485
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1486
|
-
};
|
|
1487
|
-
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1488
|
-
const command = 'QuickPick.handleMessagePort';
|
|
1489
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1490
|
-
};
|
|
1491
|
-
const sendMessagePortToSearchProcess = async port => {
|
|
1492
|
-
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1493
|
-
};
|
|
1494
|
-
const confirm = async (message, options) => {
|
|
1495
|
-
// @ts-ignore
|
|
1496
|
-
const result = await invoke('ConfirmPrompt.prompt', message, options);
|
|
1497
|
-
return result;
|
|
1498
|
-
};
|
|
1499
|
-
const getRecentlyOpened = async () => {
|
|
1500
|
-
return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1501
|
-
};
|
|
1502
|
-
const getKeyBindings$1 = async () => {
|
|
1503
|
-
return invoke('KeyBindingsInitial.getKeyBindings');
|
|
1504
|
-
};
|
|
1505
1315
|
const writeClipBoardText$1 = async text => {
|
|
1506
1316
|
await invoke('ClipBoard.writeText', /* text */text);
|
|
1507
1317
|
};
|
|
1508
|
-
const readClipBoardText = async () => {
|
|
1509
|
-
return invoke('ClipBoard.readText');
|
|
1510
|
-
};
|
|
1511
|
-
const writeClipBoardImage = async blob => {
|
|
1512
|
-
// @ts-ignore
|
|
1513
|
-
await invoke('ClipBoard.writeImage', /* text */blob);
|
|
1514
|
-
};
|
|
1515
|
-
const searchFileMemory = async uri => {
|
|
1516
|
-
// @ts-ignore
|
|
1517
|
-
return invoke('ExtensionHost.searchFileWithMemory', uri);
|
|
1518
|
-
};
|
|
1519
|
-
const searchFileFetch = async uri => {
|
|
1520
|
-
return invoke('ExtensionHost.searchFileWithFetch', uri);
|
|
1521
|
-
};
|
|
1522
|
-
const showMessageBox = async options => {
|
|
1523
|
-
return invoke('ElectronDialog.showMessageBox', options);
|
|
1524
|
-
};
|
|
1525
|
-
const handleDebugResumed = async params => {
|
|
1526
|
-
await invoke('Run And Debug.handleResumed', params);
|
|
1527
|
-
};
|
|
1528
|
-
const openWidget = async name => {
|
|
1529
|
-
await invoke('Viewlet.openWidget', name);
|
|
1530
|
-
};
|
|
1531
|
-
const getIcons = async requests => {
|
|
1532
|
-
const icons = await invoke('IconTheme.getIcons', requests);
|
|
1533
|
-
return icons;
|
|
1534
|
-
};
|
|
1535
|
-
const activateByEvent = (event, assetDir, platform) => {
|
|
1536
|
-
return invoke('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1537
|
-
};
|
|
1538
|
-
const setAdditionalFocus = focusKey => {
|
|
1539
|
-
// @ts-ignore
|
|
1540
|
-
return invoke('Focus.setAdditionalFocus', focusKey);
|
|
1541
|
-
};
|
|
1542
|
-
const getActiveEditorId = () => {
|
|
1543
|
-
// @ts-ignore
|
|
1544
|
-
return invoke('GetActiveEditor.getActiveEditorId');
|
|
1545
|
-
};
|
|
1546
|
-
const getWorkspacePath = () => {
|
|
1547
|
-
return invoke('Workspace.getPath');
|
|
1548
|
-
};
|
|
1549
|
-
const sendMessagePortToRendererProcess = async port => {
|
|
1550
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1551
|
-
// @ts-ignore
|
|
1552
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1553
|
-
};
|
|
1554
|
-
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1555
|
-
const command = 'TextMeasurement.handleMessagePort';
|
|
1556
|
-
// @ts-ignore
|
|
1557
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1558
|
-
};
|
|
1559
|
-
const sendMessagePortToSourceControlWorker = async port => {
|
|
1560
|
-
const command = 'SourceControl.handleMessagePort';
|
|
1561
|
-
// @ts-ignore
|
|
1562
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1563
|
-
};
|
|
1564
|
-
const sendMessagePortToSharedProcess = async port => {
|
|
1565
|
-
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1566
|
-
// @ts-ignore
|
|
1567
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1568
|
-
};
|
|
1569
|
-
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1570
|
-
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1571
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1572
|
-
};
|
|
1573
|
-
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1574
|
-
const command = 'Iframes.handleMessagePort';
|
|
1575
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1576
|
-
};
|
|
1577
|
-
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1578
|
-
const command = 'Extensions.handleMessagePort';
|
|
1579
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1580
|
-
};
|
|
1581
|
-
const getPreference = async key => {
|
|
1582
|
-
return await invoke('Preferences.get', key);
|
|
1583
|
-
};
|
|
1584
|
-
const getAllExtensions = async () => {
|
|
1585
|
-
return invoke('ExtensionManagement.getAllExtensions');
|
|
1586
|
-
};
|
|
1587
|
-
const rerenderEditor = async key => {
|
|
1588
|
-
// @ts-ignore
|
|
1589
|
-
return invoke('Editor.rerender', key);
|
|
1590
|
-
};
|
|
1591
|
-
const handleDebugPaused = async params => {
|
|
1592
|
-
await invoke('Run And Debug.handlePaused', params);
|
|
1593
|
-
};
|
|
1594
|
-
const openUri = async (uri, focus, options) => {
|
|
1595
|
-
await invoke('Main.openUri', uri, focus, options);
|
|
1596
|
-
};
|
|
1597
|
-
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1598
|
-
await invokeAndTransfer(
|
|
1599
|
-
// @ts-ignore
|
|
1600
|
-
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1601
|
-
};
|
|
1602
|
-
const handleDebugScriptParsed = async script => {
|
|
1603
|
-
await invoke('Run And Debug.handleScriptParsed', script);
|
|
1604
|
-
};
|
|
1605
|
-
const getWindowId = async () => {
|
|
1606
|
-
return invoke('GetWindowId.getWindowId');
|
|
1607
|
-
};
|
|
1608
|
-
const getBlob = async uri => {
|
|
1609
|
-
// @ts-ignore
|
|
1610
|
-
return invoke('FileSystem.getBlob', uri);
|
|
1611
|
-
};
|
|
1612
|
-
const getExtensionCommands = async () => {
|
|
1613
|
-
return invoke('ExtensionHost.getCommands');
|
|
1614
|
-
};
|
|
1615
|
-
const showErrorDialog = async errorInfo => {
|
|
1616
|
-
// @ts-ignore
|
|
1617
|
-
await invoke('ErrorHandling.showErrorDialog', errorInfo);
|
|
1618
|
-
};
|
|
1619
|
-
const getFolderSize = async uri => {
|
|
1620
|
-
// @ts-ignore
|
|
1621
|
-
return await invoke('FileSystem.getFolderSize', uri);
|
|
1622
|
-
};
|
|
1623
|
-
const getExtension = async id => {
|
|
1624
|
-
// @ts-ignore
|
|
1625
|
-
return invoke('ExtensionManagement.getExtension', id);
|
|
1626
|
-
};
|
|
1627
|
-
const getMarkdownDom = async html => {
|
|
1628
|
-
// @ts-ignore
|
|
1629
|
-
return invoke('Markdown.getVirtualDom', html);
|
|
1630
|
-
};
|
|
1631
|
-
const renderMarkdown = async (markdown, options) => {
|
|
1632
|
-
// @ts-ignore
|
|
1633
|
-
return invoke('Markdown.renderMarkdown', markdown, options);
|
|
1634
|
-
};
|
|
1635
|
-
const openNativeFolder = async uri => {
|
|
1636
|
-
// @ts-ignore
|
|
1637
|
-
await invoke('OpenNativeFolder.openNativeFolder', uri);
|
|
1638
|
-
};
|
|
1639
|
-
const uninstallExtension = async id => {
|
|
1640
|
-
return invoke('ExtensionManagement.uninstall', id);
|
|
1641
|
-
};
|
|
1642
|
-
const installExtension = async id => {
|
|
1643
|
-
// @ts-ignore
|
|
1644
|
-
return invoke('ExtensionManagement.install', id);
|
|
1645
|
-
};
|
|
1646
|
-
const minimizeWindow = async () => {
|
|
1647
|
-
// @ts-ignore
|
|
1648
|
-
return invoke('ElectronWindow.minimize');
|
|
1649
|
-
};
|
|
1650
|
-
const unmaximizeWindow = async () => {
|
|
1651
|
-
// @ts-ignore
|
|
1652
|
-
return invoke('ElectronWindow.unmaximize');
|
|
1653
|
-
};
|
|
1654
|
-
const maximizeWindow = async () => {
|
|
1655
|
-
// @ts-ignore
|
|
1656
|
-
return invoke('ElectronWindow.maximize');
|
|
1657
|
-
};
|
|
1658
|
-
const closeWindow = async () => {
|
|
1659
|
-
// @ts-ignore
|
|
1660
|
-
return invoke('ElectronWindow.close');
|
|
1661
|
-
};
|
|
1662
|
-
const openExtensionSearch = async () => {
|
|
1663
|
-
// @ts-ignore
|
|
1664
|
-
return invoke('SideBar.openViewlet', 'Extensions');
|
|
1665
|
-
};
|
|
1666
|
-
const setExtensionsSearchValue = async searchValue => {
|
|
1667
|
-
// @ts-ignore
|
|
1668
|
-
return invoke('Extensions.handleInput', searchValue, Script$1);
|
|
1669
|
-
};
|
|
1670
|
-
const openExternal = async uri => {
|
|
1671
|
-
// @ts-ignore
|
|
1672
|
-
await invoke('Open.openExternal', uri);
|
|
1673
|
-
};
|
|
1674
|
-
const openUrl = async uri => {
|
|
1675
|
-
// @ts-ignore
|
|
1676
|
-
await invoke('Open.openUrl', uri);
|
|
1677
|
-
};
|
|
1678
|
-
const getAllPreferences = async () => {
|
|
1679
|
-
// @ts-ignore
|
|
1680
|
-
return invoke('Preferences.getAll');
|
|
1681
|
-
};
|
|
1682
|
-
const showSaveFilePicker = async () => {
|
|
1683
|
-
// @ts-ignore
|
|
1684
|
-
return invoke('FilePicker.showSaveFilePicker');
|
|
1685
|
-
};
|
|
1686
|
-
const getLogsDir = async () => {
|
|
1687
|
-
// @ts-ignore
|
|
1688
|
-
return invoke('PlatformPaths.getLogsDir');
|
|
1689
|
-
};
|
|
1690
|
-
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1691
|
-
return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1692
|
-
};
|
|
1693
|
-
const refreshOutput = async () => {
|
|
1694
|
-
await invoke('Output.refresh');
|
|
1695
|
-
};
|
|
1696
1318
|
|
|
1697
1319
|
const RendererWorker = {
|
|
1698
1320
|
__proto__: null,
|
|
1699
|
-
activateByEvent,
|
|
1700
|
-
applyBulkReplacement,
|
|
1701
|
-
closeWidget,
|
|
1702
|
-
closeWindow,
|
|
1703
|
-
confirm,
|
|
1704
|
-
disableExtension,
|
|
1705
|
-
dispose,
|
|
1706
|
-
enableExtension,
|
|
1707
|
-
getActiveEditorId,
|
|
1708
|
-
getAllExtensions,
|
|
1709
|
-
getAllPreferences,
|
|
1710
|
-
getBlob,
|
|
1711
|
-
getChromeVersion,
|
|
1712
|
-
getColorThemeNames,
|
|
1713
|
-
getElectronVersion,
|
|
1714
|
-
getExtension,
|
|
1715
|
-
getExtensionCommands,
|
|
1716
|
-
getFileHandles,
|
|
1717
|
-
getFileIcon,
|
|
1718
|
-
getFilePathElectron,
|
|
1719
|
-
getFolderIcon,
|
|
1720
|
-
getFolderSize,
|
|
1721
|
-
getIcons,
|
|
1722
|
-
getKeyBindings: getKeyBindings$1,
|
|
1723
|
-
getLogsDir,
|
|
1724
|
-
getMarkdownDom,
|
|
1725
|
-
getNodeVersion,
|
|
1726
|
-
getPreference,
|
|
1727
|
-
getRecentlyOpened,
|
|
1728
|
-
getV8Version,
|
|
1729
|
-
getWebViewSecret,
|
|
1730
|
-
getWindowId,
|
|
1731
|
-
getWorkspacePath,
|
|
1732
|
-
handleDebugChange,
|
|
1733
|
-
handleDebugPaused,
|
|
1734
|
-
handleDebugResumed,
|
|
1735
|
-
handleDebugScriptParsed,
|
|
1736
|
-
handleWorkspaceRefresh,
|
|
1737
|
-
installExtension,
|
|
1738
1321
|
invoke,
|
|
1739
1322
|
invokeAndTransfer,
|
|
1740
|
-
maximizeWindow,
|
|
1741
|
-
measureTextBlockHeight,
|
|
1742
|
-
minimizeWindow,
|
|
1743
|
-
openExtensionSearch,
|
|
1744
|
-
openExternal,
|
|
1745
|
-
openNativeFolder,
|
|
1746
|
-
openUri,
|
|
1747
|
-
openUrl,
|
|
1748
|
-
openWidget,
|
|
1749
|
-
readClipBoardText,
|
|
1750
|
-
readFile,
|
|
1751
|
-
refreshOutput,
|
|
1752
|
-
registerMockRpc,
|
|
1753
|
-
registerWebViewInterceptor,
|
|
1754
|
-
renderMarkdown,
|
|
1755
|
-
rerenderEditor,
|
|
1756
|
-
searchFileFetch,
|
|
1757
|
-
searchFileHtml,
|
|
1758
|
-
searchFileMemory,
|
|
1759
1323
|
sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
|
|
1760
|
-
sendMessagePortToErrorWorker,
|
|
1761
|
-
sendMessagePortToExtensionHostWorker,
|
|
1762
|
-
sendMessagePortToExtensionManagementWorker,
|
|
1763
|
-
sendMessagePortToFileSearchWorker,
|
|
1764
|
-
sendMessagePortToFileSystemProcess,
|
|
1765
|
-
sendMessagePortToFileSystemWorker,
|
|
1766
|
-
sendMessagePortToIconThemeWorker,
|
|
1767
|
-
sendMessagePortToIframeWorker,
|
|
1768
|
-
sendMessagePortToMarkdownWorker,
|
|
1769
|
-
sendMessagePortToRendererProcess,
|
|
1770
|
-
sendMessagePortToSearchProcess,
|
|
1771
|
-
sendMessagePortToSharedProcess,
|
|
1772
|
-
sendMessagePortToSourceControlWorker,
|
|
1773
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
1774
|
-
sendMessagePortToTextMeasurementWorker,
|
|
1775
1324
|
set: set$2,
|
|
1776
|
-
setAdditionalFocus,
|
|
1777
|
-
setColorTheme,
|
|
1778
|
-
setExtensionsSearchValue,
|
|
1779
|
-
setFocus,
|
|
1780
|
-
setWebViewPort,
|
|
1781
|
-
setWorkspacePath,
|
|
1782
|
-
showContextMenu,
|
|
1783
1325
|
showContextMenu2,
|
|
1784
|
-
showErrorDialog,
|
|
1785
|
-
showMessageBox,
|
|
1786
|
-
showSaveFilePicker,
|
|
1787
|
-
uninstallExtension,
|
|
1788
|
-
unmaximizeWindow,
|
|
1789
|
-
unregisterWebViewInterceptor,
|
|
1790
|
-
writeClipBoardImage,
|
|
1791
1326
|
writeClipBoardText: writeClipBoardText$1
|
|
1792
1327
|
};
|
|
1793
1328
|
|
|
@@ -1821,7 +1356,7 @@ const {
|
|
|
1821
1356
|
set,
|
|
1822
1357
|
wrapCommand,
|
|
1823
1358
|
wrapGetter
|
|
1824
|
-
} = create$
|
|
1359
|
+
} = create$a();
|
|
1825
1360
|
|
|
1826
1361
|
const None = 0;
|
|
1827
1362
|
const Table = 1;
|
|
@@ -1841,6 +1376,9 @@ const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
|
1841
1376
|
message: '',
|
|
1842
1377
|
minLineY: 0,
|
|
1843
1378
|
problems: [],
|
|
1379
|
+
showErrors: true,
|
|
1380
|
+
showInfos: true,
|
|
1381
|
+
showWarnings: true,
|
|
1844
1382
|
smallWidthBreakPoint: 650,
|
|
1845
1383
|
uid: id,
|
|
1846
1384
|
viewMode: None,
|
|
@@ -2046,19 +1584,19 @@ const showInfos = () => {
|
|
|
2046
1584
|
return i18nString(ShowInfos);
|
|
2047
1585
|
};
|
|
2048
1586
|
|
|
2049
|
-
const getMenuEntriesFilter =
|
|
1587
|
+
const getMenuEntriesFilter = state => [{
|
|
2050
1588
|
command: '-1',
|
|
2051
|
-
flags:
|
|
1589
|
+
flags: state.showErrors ? Checked : Unchecked,
|
|
2052
1590
|
id: 'show-errors',
|
|
2053
1591
|
label: showErrors()
|
|
2054
1592
|
}, {
|
|
2055
1593
|
command: '-1',
|
|
2056
|
-
flags:
|
|
1594
|
+
flags: state.showWarnings ? Checked : Unchecked,
|
|
2057
1595
|
id: 'show-warnings',
|
|
2058
1596
|
label: showWarnings()
|
|
2059
1597
|
}, {
|
|
2060
1598
|
command: '-1',
|
|
2061
|
-
flags:
|
|
1599
|
+
flags: state.showInfos ? Checked : Unchecked,
|
|
2062
1600
|
id: 'show-infos',
|
|
2063
1601
|
label: showInfos()
|
|
2064
1602
|
}];
|
|
@@ -2069,7 +1607,7 @@ const getMenuEntries2 = (state, props) => {
|
|
|
2069
1607
|
} = props;
|
|
2070
1608
|
switch (menuId) {
|
|
2071
1609
|
case ProblemsFilter$1:
|
|
2072
|
-
return getMenuEntriesFilter();
|
|
1610
|
+
return getMenuEntriesFilter(state);
|
|
2073
1611
|
default:
|
|
2074
1612
|
return [];
|
|
2075
1613
|
}
|
|
@@ -2148,6 +1686,13 @@ const handleArrowRight = state => {
|
|
|
2148
1686
|
};
|
|
2149
1687
|
};
|
|
2150
1688
|
|
|
1689
|
+
const handleBlur = state => {
|
|
1690
|
+
return {
|
|
1691
|
+
...state,
|
|
1692
|
+
focusedIndex: -2
|
|
1693
|
+
};
|
|
1694
|
+
};
|
|
1695
|
+
|
|
2151
1696
|
const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight) => {
|
|
2152
1697
|
const relativeY = eventY - y + deltaY;
|
|
2153
1698
|
const index = Math.floor(relativeY / itemHeight);
|
|
@@ -2424,18 +1969,18 @@ const ProblemsTableRowOdd = 'ProblemsTableRowOdd';
|
|
|
2424
1969
|
const ProblemsWarningIcon = 'ProblemsWarningIcon';
|
|
2425
1970
|
const Viewlet = 'Viewlet';
|
|
2426
1971
|
|
|
2427
|
-
const HandleBlur =
|
|
2428
|
-
const HandleClearFilterClick =
|
|
2429
|
-
const HandleContextMenu =
|
|
2430
|
-
const HandleFilterInput =
|
|
2431
|
-
const HandlePointerDown =
|
|
2432
|
-
const HandleClickMoreFilters =
|
|
1972
|
+
const HandleBlur = 1;
|
|
1973
|
+
const HandleClearFilterClick = 2;
|
|
1974
|
+
const HandleContextMenu = 3;
|
|
1975
|
+
const HandleFilterInput = 4;
|
|
1976
|
+
const HandlePointerDown = 5;
|
|
1977
|
+
const HandleClickMoreFilters = 6;
|
|
2433
1978
|
|
|
2434
1979
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2435
1980
|
return {
|
|
2436
1981
|
childCount: 0,
|
|
2437
1982
|
className: mergeClassNames('MaskIcon', `MaskIcon${icon}`),
|
|
2438
|
-
role: None$
|
|
1983
|
+
role: None$1,
|
|
2439
1984
|
type
|
|
2440
1985
|
};
|
|
2441
1986
|
};
|
|
@@ -2455,14 +2000,25 @@ const getActionButtonVirtualDom = action => {
|
|
|
2455
2000
|
}, getIconVirtualDom(icon)];
|
|
2456
2001
|
};
|
|
2457
2002
|
|
|
2003
|
+
const getFilterBadgeDom = badgeText => {
|
|
2004
|
+
if (!badgeText) {
|
|
2005
|
+
return [];
|
|
2006
|
+
}
|
|
2007
|
+
return [{
|
|
2008
|
+
childCount: 1,
|
|
2009
|
+
className: FilterBadge,
|
|
2010
|
+
type: Div
|
|
2011
|
+
}, text(badgeText)];
|
|
2012
|
+
};
|
|
2013
|
+
|
|
2458
2014
|
const getInputBoxVirtualDom = (name, onInput, placeholder) => {
|
|
2459
2015
|
return {
|
|
2460
2016
|
autocapitalize: 'off',
|
|
2461
2017
|
autocorrect: 'off',
|
|
2462
2018
|
className: InputBox,
|
|
2463
2019
|
name,
|
|
2464
|
-
onInput
|
|
2465
|
-
placeholder
|
|
2020
|
+
onInput,
|
|
2021
|
+
placeholder,
|
|
2466
2022
|
spellcheck: false,
|
|
2467
2023
|
type: Input
|
|
2468
2024
|
};
|
|
@@ -2482,22 +2038,12 @@ const getChildCount = badgeText => {
|
|
|
2482
2038
|
childCount++; // action button
|
|
2483
2039
|
return childCount;
|
|
2484
2040
|
};
|
|
2485
|
-
const getBadgeDom = badgeText => {
|
|
2486
|
-
if (!badgeText) {
|
|
2487
|
-
return [];
|
|
2488
|
-
}
|
|
2489
|
-
return [{
|
|
2490
|
-
childCount: 1,
|
|
2491
|
-
className: FilterBadge,
|
|
2492
|
-
type: Div
|
|
2493
|
-
}, text(badgeText)];
|
|
2494
|
-
};
|
|
2495
2041
|
const getProblemsFilterVirtualDom = action => {
|
|
2496
2042
|
return [{
|
|
2497
2043
|
childCount: getChildCount(action.badgeText),
|
|
2498
2044
|
className: Filter$1,
|
|
2499
2045
|
type: Div
|
|
2500
|
-
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...
|
|
2046
|
+
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getFilterBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
|
|
2501
2047
|
command: 'more filters',
|
|
2502
2048
|
icon: Filter,
|
|
2503
2049
|
id: 'more filters'})];
|
|
@@ -2546,7 +2092,7 @@ const getFileIconVirtualDom = icon => {
|
|
|
2546
2092
|
return {
|
|
2547
2093
|
childCount: 0,
|
|
2548
2094
|
className: FileIcon,
|
|
2549
|
-
role: None$
|
|
2095
|
+
role: None$1,
|
|
2550
2096
|
src: icon,
|
|
2551
2097
|
type: Img
|
|
2552
2098
|
};
|
|
@@ -2814,9 +2360,7 @@ const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
|
|
|
2814
2360
|
};
|
|
2815
2361
|
|
|
2816
2362
|
const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message) => {
|
|
2817
|
-
|
|
2818
|
-
const dom = [];
|
|
2819
|
-
dom.push({
|
|
2363
|
+
const baseDom = {
|
|
2820
2364
|
childCount: 1,
|
|
2821
2365
|
className: mergeClassNames(Viewlet, Problems),
|
|
2822
2366
|
onBlur: HandleBlur,
|
|
@@ -2824,16 +2368,13 @@ const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message
|
|
|
2824
2368
|
onPointerDown: HandlePointerDown,
|
|
2825
2369
|
tabIndex: 0,
|
|
2826
2370
|
type: Div
|
|
2827
|
-
}
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
}
|
|
2835
|
-
dom.push(...getProblemsVirtualDom$1(viewMode, problems, filterValue, message));
|
|
2836
|
-
return dom;
|
|
2371
|
+
};
|
|
2372
|
+
const filterDom = isSmall ? getProblemsFilterVirtualDom({
|
|
2373
|
+
badgeText: '',
|
|
2374
|
+
command: HandleFilterInput,
|
|
2375
|
+
placeholder: filter()}) : [];
|
|
2376
|
+
const itemsDom = getProblemsVirtualDom$1(viewMode, problems, filterValue, message);
|
|
2377
|
+
return [baseDom, ...filterDom, ...itemsDom];
|
|
2837
2378
|
};
|
|
2838
2379
|
|
|
2839
2380
|
const matchesFilterValue = (string, filterValueLower) => {
|
|
@@ -2842,6 +2383,7 @@ const matchesFilterValue = (string, filterValueLower) => {
|
|
|
2842
2383
|
}
|
|
2843
2384
|
return 0;
|
|
2844
2385
|
};
|
|
2386
|
+
|
|
2845
2387
|
const getListItemType = (listItemType, isCollapsed) => {
|
|
2846
2388
|
if (listItemType === Item) {
|
|
2847
2389
|
return Item;
|
|
@@ -2887,6 +2429,7 @@ const getIcon = uri => {
|
|
|
2887
2429
|
}
|
|
2888
2430
|
return getFileNameIcon();
|
|
2889
2431
|
};
|
|
2432
|
+
|
|
2890
2433
|
const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue) => {
|
|
2891
2434
|
array(problems);
|
|
2892
2435
|
array(collapsedUris);
|
|
@@ -3101,6 +2644,7 @@ const commandMap = {
|
|
|
3101
2644
|
'Problems.getMenuIds': getMenuIds,
|
|
3102
2645
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
3103
2646
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
2647
|
+
'Problems.handleBlur': wrapCommand(handleBlur),
|
|
3104
2648
|
'Problems.handleClickAt': wrapCommand(handleClickAt),
|
|
3105
2649
|
'Problems.handleClickButton': wrapCommand(handleClickButton),
|
|
3106
2650
|
'Problems.handleClickMoreFilters': wrapCommand(handleClickMoreFilters),
|
|
@@ -3126,7 +2670,7 @@ const send = port => {
|
|
|
3126
2670
|
};
|
|
3127
2671
|
const initializeEditorWorkerRpc = async () => {
|
|
3128
2672
|
try {
|
|
3129
|
-
const rpc = await
|
|
2673
|
+
const rpc = await create$3({
|
|
3130
2674
|
commandMap: {},
|
|
3131
2675
|
send
|
|
3132
2676
|
});
|
|
@@ -3138,7 +2682,7 @@ const initializeEditorWorkerRpc = async () => {
|
|
|
3138
2682
|
};
|
|
3139
2683
|
|
|
3140
2684
|
const initializeRendererWorker = async () => {
|
|
3141
|
-
const rpc = await
|
|
2685
|
+
const rpc = await create$2({
|
|
3142
2686
|
commandMap: commandMapRef
|
|
3143
2687
|
});
|
|
3144
2688
|
set$1(rpc);
|