@lvce-editor/problems-view 1.16.0 → 1.18.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 +345 -258
- package/package.json +1 -1
|
@@ -1,3 +1,122 @@
|
|
|
1
|
+
const toCommandId = key => {
|
|
2
|
+
const dotIndex = key.indexOf('.');
|
|
3
|
+
return key.slice(dotIndex + 1);
|
|
4
|
+
};
|
|
5
|
+
const create$6 = () => {
|
|
6
|
+
const states = Object.create(null);
|
|
7
|
+
const commandMapRef = {};
|
|
8
|
+
return {
|
|
9
|
+
get(uid) {
|
|
10
|
+
return states[uid];
|
|
11
|
+
},
|
|
12
|
+
set(uid, oldState, newState) {
|
|
13
|
+
states[uid] = {
|
|
14
|
+
oldState,
|
|
15
|
+
newState
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
dispose(uid) {
|
|
19
|
+
delete states[uid];
|
|
20
|
+
},
|
|
21
|
+
getKeys() {
|
|
22
|
+
return Object.keys(states).map(key => {
|
|
23
|
+
return Number.parseInt(key);
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
clear() {
|
|
27
|
+
for (const key of Object.keys(states)) {
|
|
28
|
+
delete states[key];
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
wrapCommand(fn) {
|
|
32
|
+
const wrapped = async (uid, ...args) => {
|
|
33
|
+
const {
|
|
34
|
+
oldState,
|
|
35
|
+
newState
|
|
36
|
+
} = states[uid];
|
|
37
|
+
const newerState = await fn(newState, ...args);
|
|
38
|
+
if (oldState === newerState || newState === newerState) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const latest = states[uid];
|
|
42
|
+
states[uid] = {
|
|
43
|
+
oldState: latest.oldState,
|
|
44
|
+
newState: newerState
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return wrapped;
|
|
48
|
+
},
|
|
49
|
+
wrapGetter(fn) {
|
|
50
|
+
const wrapped = (uid, ...args) => {
|
|
51
|
+
const {
|
|
52
|
+
newState
|
|
53
|
+
} = states[uid];
|
|
54
|
+
return fn(newState, ...args);
|
|
55
|
+
};
|
|
56
|
+
return wrapped;
|
|
57
|
+
},
|
|
58
|
+
diff(uid, modules, numbers) {
|
|
59
|
+
const {
|
|
60
|
+
oldState,
|
|
61
|
+
newState
|
|
62
|
+
} = states[uid];
|
|
63
|
+
const diffResult = [];
|
|
64
|
+
for (let i = 0; i < modules.length; i++) {
|
|
65
|
+
const fn = modules[i];
|
|
66
|
+
if (!fn(oldState, newState)) {
|
|
67
|
+
diffResult.push(numbers[i]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return diffResult;
|
|
71
|
+
},
|
|
72
|
+
getCommandIds() {
|
|
73
|
+
const keys = Object.keys(commandMapRef);
|
|
74
|
+
const ids = keys.map(toCommandId);
|
|
75
|
+
return ids;
|
|
76
|
+
},
|
|
77
|
+
registerCommands(commandMap) {
|
|
78
|
+
Object.assign(commandMapRef, commandMap);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const terminate = () => {
|
|
83
|
+
globalThis.close();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const None$1 = '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 Checked = 2;
|
|
114
|
+
const Unchecked = 3;
|
|
115
|
+
|
|
116
|
+
const DebugWorker = 55;
|
|
117
|
+
const EditorWorker$1 = 99;
|
|
118
|
+
const RendererWorker$1 = 1;
|
|
119
|
+
|
|
1
120
|
const normalizeLine = line => {
|
|
2
121
|
if (line.startsWith('Error: ')) {
|
|
3
122
|
return line.slice('Error: '.length);
|
|
@@ -969,6 +1088,53 @@ const listen$1 = async (module, options) => {
|
|
|
969
1088
|
const ipc = module.wrap(rawIpc);
|
|
970
1089
|
return ipc;
|
|
971
1090
|
};
|
|
1091
|
+
|
|
1092
|
+
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
1093
|
+
|
|
1094
|
+
const createSharedLazyRpc = factory => {
|
|
1095
|
+
let rpcPromise;
|
|
1096
|
+
const getOrCreate = () => {
|
|
1097
|
+
if (!rpcPromise) {
|
|
1098
|
+
rpcPromise = factory();
|
|
1099
|
+
}
|
|
1100
|
+
return rpcPromise;
|
|
1101
|
+
};
|
|
1102
|
+
return {
|
|
1103
|
+
async dispose() {
|
|
1104
|
+
const rpc = await getOrCreate();
|
|
1105
|
+
await rpc.dispose();
|
|
1106
|
+
},
|
|
1107
|
+
async invoke(method, ...params) {
|
|
1108
|
+
const rpc = await getOrCreate();
|
|
1109
|
+
return rpc.invoke(method, ...params);
|
|
1110
|
+
},
|
|
1111
|
+
async invokeAndTransfer(method, ...params) {
|
|
1112
|
+
const rpc = await getOrCreate();
|
|
1113
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1114
|
+
},
|
|
1115
|
+
async send(method, ...params) {
|
|
1116
|
+
const rpc = await getOrCreate();
|
|
1117
|
+
rpc.send(method, ...params);
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
const create$i = async ({
|
|
1122
|
+
commandMap,
|
|
1123
|
+
isMessagePortOpen,
|
|
1124
|
+
send
|
|
1125
|
+
}) => {
|
|
1126
|
+
return createSharedLazyRpc(() => {
|
|
1127
|
+
return create$2({
|
|
1128
|
+
commandMap,
|
|
1129
|
+
isMessagePortOpen,
|
|
1130
|
+
send
|
|
1131
|
+
});
|
|
1132
|
+
});
|
|
1133
|
+
};
|
|
1134
|
+
const LazyTransferMessagePortRpcParent = {
|
|
1135
|
+
__proto__: null,
|
|
1136
|
+
create: create$i
|
|
1137
|
+
};
|
|
972
1138
|
const create$4 = async ({
|
|
973
1139
|
commandMap,
|
|
974
1140
|
isMessagePortOpen = true,
|
|
@@ -986,7 +1152,7 @@ const create$4 = async ({
|
|
|
986
1152
|
messagePort.start();
|
|
987
1153
|
return rpc;
|
|
988
1154
|
};
|
|
989
|
-
const create$2
|
|
1155
|
+
const create$2 = async ({
|
|
990
1156
|
commandMap,
|
|
991
1157
|
isMessagePortOpen,
|
|
992
1158
|
send
|
|
@@ -1002,10 +1168,6 @@ const create$2$1 = async ({
|
|
|
1002
1168
|
messagePort: port2
|
|
1003
1169
|
});
|
|
1004
1170
|
};
|
|
1005
|
-
const TransferMessagePortRpcParent = {
|
|
1006
|
-
__proto__: null,
|
|
1007
|
-
create: create$2$1
|
|
1008
|
-
};
|
|
1009
1171
|
const create$1$1 = async ({
|
|
1010
1172
|
commandMap
|
|
1011
1173
|
}) => {
|
|
@@ -1040,124 +1202,8 @@ const createMockRpc = ({
|
|
|
1040
1202
|
return mockRpc;
|
|
1041
1203
|
};
|
|
1042
1204
|
|
|
1043
|
-
const toCommandId$1 = key => {
|
|
1044
|
-
const dotIndex = key.indexOf('.');
|
|
1045
|
-
return key.slice(dotIndex + 1);
|
|
1046
|
-
};
|
|
1047
|
-
const create$2 = () => {
|
|
1048
|
-
const states = Object.create(null);
|
|
1049
|
-
const commandMapRef = {};
|
|
1050
|
-
return {
|
|
1051
|
-
get(uid) {
|
|
1052
|
-
return states[uid];
|
|
1053
|
-
},
|
|
1054
|
-
set(uid, oldState, newState) {
|
|
1055
|
-
states[uid] = {
|
|
1056
|
-
oldState,
|
|
1057
|
-
newState
|
|
1058
|
-
};
|
|
1059
|
-
},
|
|
1060
|
-
dispose(uid) {
|
|
1061
|
-
delete states[uid];
|
|
1062
|
-
},
|
|
1063
|
-
getKeys() {
|
|
1064
|
-
return Object.keys(states).map(key => {
|
|
1065
|
-
return Number.parseInt(key);
|
|
1066
|
-
});
|
|
1067
|
-
},
|
|
1068
|
-
clear() {
|
|
1069
|
-
for (const key of Object.keys(states)) {
|
|
1070
|
-
delete states[key];
|
|
1071
|
-
}
|
|
1072
|
-
},
|
|
1073
|
-
wrapCommand(fn) {
|
|
1074
|
-
const wrapped = async (uid, ...args) => {
|
|
1075
|
-
const {
|
|
1076
|
-
oldState,
|
|
1077
|
-
newState
|
|
1078
|
-
} = states[uid];
|
|
1079
|
-
const newerState = await fn(newState, ...args);
|
|
1080
|
-
if (oldState === newerState || newState === newerState) {
|
|
1081
|
-
return;
|
|
1082
|
-
}
|
|
1083
|
-
const latest = states[uid];
|
|
1084
|
-
states[uid] = {
|
|
1085
|
-
oldState: latest.oldState,
|
|
1086
|
-
newState: newerState
|
|
1087
|
-
};
|
|
1088
|
-
};
|
|
1089
|
-
return wrapped;
|
|
1090
|
-
},
|
|
1091
|
-
wrapGetter(fn) {
|
|
1092
|
-
const wrapped = (uid, ...args) => {
|
|
1093
|
-
const {
|
|
1094
|
-
newState
|
|
1095
|
-
} = states[uid];
|
|
1096
|
-
return fn(newState, ...args);
|
|
1097
|
-
};
|
|
1098
|
-
return wrapped;
|
|
1099
|
-
},
|
|
1100
|
-
diff(uid, modules, numbers) {
|
|
1101
|
-
const {
|
|
1102
|
-
oldState,
|
|
1103
|
-
newState
|
|
1104
|
-
} = states[uid];
|
|
1105
|
-
const diffResult = [];
|
|
1106
|
-
for (let i = 0; i < modules.length; i++) {
|
|
1107
|
-
const fn = modules[i];
|
|
1108
|
-
if (!fn(oldState, newState)) {
|
|
1109
|
-
diffResult.push(numbers[i]);
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
return diffResult;
|
|
1113
|
-
},
|
|
1114
|
-
getCommandIds() {
|
|
1115
|
-
const keys = Object.keys(commandMapRef);
|
|
1116
|
-
const ids = keys.map(toCommandId$1);
|
|
1117
|
-
return ids;
|
|
1118
|
-
},
|
|
1119
|
-
registerCommands(commandMap) {
|
|
1120
|
-
Object.assign(commandMapRef, commandMap);
|
|
1121
|
-
}
|
|
1122
|
-
};
|
|
1123
|
-
};
|
|
1124
|
-
const terminate = () => {
|
|
1125
|
-
globalThis.close();
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
|
-
const None$1 = 'none';
|
|
1129
|
-
const ToolBar = 'toolbar';
|
|
1130
|
-
const Tree = 'tree';
|
|
1131
|
-
const TreeItem = 'treeitem';
|
|
1132
|
-
|
|
1133
|
-
const Button$1 = 1;
|
|
1134
|
-
const Div = 4;
|
|
1135
|
-
const Input = 6;
|
|
1136
|
-
const Span = 8;
|
|
1137
|
-
const Text = 12;
|
|
1138
|
-
const Img = 17;
|
|
1139
|
-
const A = 53;
|
|
1140
|
-
|
|
1141
|
-
const Space = 9;
|
|
1142
|
-
const PageUp = 10;
|
|
1143
|
-
const PageDown = 11;
|
|
1144
|
-
const End = 255;
|
|
1145
|
-
const Home = 12;
|
|
1146
|
-
const LeftArrow = 13;
|
|
1147
|
-
const UpArrow = 14;
|
|
1148
|
-
const RightArrow = 15;
|
|
1149
|
-
const DownArrow = 16;
|
|
1150
|
-
|
|
1151
|
-
const Script$1 = 2;
|
|
1152
|
-
|
|
1153
|
-
const ProblemsFilter$1 = 25;
|
|
1154
|
-
|
|
1155
|
-
const DebugWorker = 55;
|
|
1156
|
-
const EditorWorker$1 = 99;
|
|
1157
|
-
const RendererWorker$1 = 1;
|
|
1158
|
-
|
|
1159
1205
|
const rpcs = Object.create(null);
|
|
1160
|
-
const set$
|
|
1206
|
+
const set$4 = (id, rpc) => {
|
|
1161
1207
|
rpcs[id] = rpc;
|
|
1162
1208
|
};
|
|
1163
1209
|
const get$1 = id => {
|
|
@@ -1190,7 +1236,7 @@ const create$1 = rpcId => {
|
|
|
1190
1236
|
const mockRpc = createMockRpc({
|
|
1191
1237
|
commandMap
|
|
1192
1238
|
});
|
|
1193
|
-
set$
|
|
1239
|
+
set$4(rpcId, mockRpc);
|
|
1194
1240
|
// @ts-ignore
|
|
1195
1241
|
mockRpc[Symbol.dispose] = () => {
|
|
1196
1242
|
remove(rpcId);
|
|
@@ -1199,7 +1245,7 @@ const create$1 = rpcId => {
|
|
|
1199
1245
|
return mockRpc;
|
|
1200
1246
|
},
|
|
1201
1247
|
set(rpc) {
|
|
1202
|
-
set$
|
|
1248
|
+
set$4(rpcId, rpc);
|
|
1203
1249
|
}
|
|
1204
1250
|
};
|
|
1205
1251
|
};
|
|
@@ -1209,7 +1255,7 @@ const {
|
|
|
1209
1255
|
invoke: invoke$1,
|
|
1210
1256
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1211
1257
|
registerMockRpc: registerMockRpc$1,
|
|
1212
|
-
set: set$
|
|
1258
|
+
set: set$3
|
|
1213
1259
|
} = create$1(EditorWorker$1);
|
|
1214
1260
|
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1215
1261
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
@@ -1307,7 +1353,7 @@ const EditorWorker = {
|
|
|
1307
1353
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1308
1354
|
registerMockRpc: registerMockRpc$1,
|
|
1309
1355
|
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1310
|
-
set: set$
|
|
1356
|
+
set: set$3,
|
|
1311
1357
|
updateDebugInfo
|
|
1312
1358
|
};
|
|
1313
1359
|
|
|
@@ -1316,7 +1362,7 @@ const {
|
|
|
1316
1362
|
invoke,
|
|
1317
1363
|
invokeAndTransfer,
|
|
1318
1364
|
registerMockRpc,
|
|
1319
|
-
set: set$
|
|
1365
|
+
set: set$2
|
|
1320
1366
|
} = create$1(RendererWorker$1);
|
|
1321
1367
|
const searchFileHtml = async uri => {
|
|
1322
1368
|
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
@@ -1727,7 +1773,7 @@ const RendererWorker = {
|
|
|
1727
1773
|
sendMessagePortToSourceControlWorker,
|
|
1728
1774
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1729
1775
|
sendMessagePortToTextMeasurementWorker,
|
|
1730
|
-
set: set$
|
|
1776
|
+
set: set$2,
|
|
1731
1777
|
setAdditionalFocus,
|
|
1732
1778
|
setColorTheme,
|
|
1733
1779
|
setExtensionsSearchValue,
|
|
@@ -1748,7 +1794,7 @@ const RendererWorker = {
|
|
|
1748
1794
|
|
|
1749
1795
|
const {
|
|
1750
1796
|
sendMessagePortToEditorWorker,
|
|
1751
|
-
set: set$
|
|
1797
|
+
set: set$1,
|
|
1752
1798
|
writeClipBoardText
|
|
1753
1799
|
} = RendererWorker;
|
|
1754
1800
|
|
|
@@ -1771,9 +1817,12 @@ const Script = 2;
|
|
|
1771
1817
|
|
|
1772
1818
|
const {
|
|
1773
1819
|
get,
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1820
|
+
getCommandIds,
|
|
1821
|
+
registerCommands,
|
|
1822
|
+
set,
|
|
1823
|
+
wrapCommand,
|
|
1824
|
+
wrapGetter
|
|
1825
|
+
} = create$6();
|
|
1777
1826
|
|
|
1778
1827
|
const None = 0;
|
|
1779
1828
|
const Table = 1;
|
|
@@ -1793,6 +1842,9 @@ const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
|
1793
1842
|
message: '',
|
|
1794
1843
|
minLineY: 0,
|
|
1795
1844
|
problems: [],
|
|
1845
|
+
showErrors: true,
|
|
1846
|
+
showInfos: true,
|
|
1847
|
+
showWarnings: true,
|
|
1796
1848
|
smallWidthBreakPoint: 650,
|
|
1797
1849
|
uid: id,
|
|
1798
1850
|
viewMode: None,
|
|
@@ -1801,7 +1853,7 @@ const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
|
1801
1853
|
x,
|
|
1802
1854
|
y
|
|
1803
1855
|
};
|
|
1804
|
-
set
|
|
1856
|
+
set(id, state, state);
|
|
1805
1857
|
};
|
|
1806
1858
|
|
|
1807
1859
|
const isEqual$1 = (oldState, newState) => {
|
|
@@ -1845,18 +1897,6 @@ const focusIndex = (state, index) => {
|
|
|
1845
1897
|
};
|
|
1846
1898
|
};
|
|
1847
1899
|
|
|
1848
|
-
const commandMapRef = {};
|
|
1849
|
-
|
|
1850
|
-
const toCommandId = key => {
|
|
1851
|
-
const dotIndex = key.indexOf('.');
|
|
1852
|
-
return key.slice(dotIndex + 1);
|
|
1853
|
-
};
|
|
1854
|
-
const getCommandIds = () => {
|
|
1855
|
-
const keys = Object.keys(commandMapRef);
|
|
1856
|
-
const ids = keys.map(toCommandId);
|
|
1857
|
-
return ids;
|
|
1858
|
-
};
|
|
1859
|
-
|
|
1860
1900
|
const mergeClassNames = (...classNames) => {
|
|
1861
1901
|
return classNames.filter(Boolean).join(' ');
|
|
1862
1902
|
};
|
|
@@ -1919,6 +1959,126 @@ const getKeyBindings = () => {
|
|
|
1919
1959
|
}];
|
|
1920
1960
|
};
|
|
1921
1961
|
|
|
1962
|
+
const emptyObject = {};
|
|
1963
|
+
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
1964
|
+
const i18nString = (key, placeholders = emptyObject) => {
|
|
1965
|
+
if (placeholders === emptyObject) {
|
|
1966
|
+
return key;
|
|
1967
|
+
}
|
|
1968
|
+
const replacer = (match, rest) => {
|
|
1969
|
+
return placeholders[rest];
|
|
1970
|
+
};
|
|
1971
|
+
return key.replaceAll(RE_PLACEHOLDER, replacer);
|
|
1972
|
+
};
|
|
1973
|
+
|
|
1974
|
+
const ClearFilters = 'Clear Filters';
|
|
1975
|
+
const Code = 'Code';
|
|
1976
|
+
const File = 'File';
|
|
1977
|
+
const Filter$3 = 'Filter';
|
|
1978
|
+
const LineColumn = '[Ln {PH1}, Col {PH2}]';
|
|
1979
|
+
const Message$1 = 'Message';
|
|
1980
|
+
const NoProblemsDetected = 'No problems have been detected in the workspace.';
|
|
1981
|
+
const NoResultsFoundWithProvidedFilterCriteria = 'No results found with provided filter criteria.';
|
|
1982
|
+
const ProblemsDetected = 'Some problems have been detected in the workspace.';
|
|
1983
|
+
const ShowingOfItems = 'Showing {PH1} of {PH2} ';
|
|
1984
|
+
const Source = 'Source';
|
|
1985
|
+
const CollapseAll$1 = 'Collapse All';
|
|
1986
|
+
const ViewAsTable = 'View as Table';
|
|
1987
|
+
const ViewAsList = 'View as List';
|
|
1988
|
+
const ShowErrors = 'Show Errors';
|
|
1989
|
+
const ShowWarnings = 'Show Warnings';
|
|
1990
|
+
const ShowInfos = 'Show Infos';
|
|
1991
|
+
|
|
1992
|
+
const noProblemsDetected = () => {
|
|
1993
|
+
return i18nString(NoProblemsDetected);
|
|
1994
|
+
};
|
|
1995
|
+
const getMessage = problemsCount => {
|
|
1996
|
+
if (problemsCount === 0) {
|
|
1997
|
+
return i18nString(NoProblemsDetected);
|
|
1998
|
+
}
|
|
1999
|
+
return i18nString(ProblemsDetected);
|
|
2000
|
+
};
|
|
2001
|
+
const atLineColumn = (line, column) => {
|
|
2002
|
+
return i18nString(LineColumn, {
|
|
2003
|
+
PH1: line,
|
|
2004
|
+
PH2: column
|
|
2005
|
+
});
|
|
2006
|
+
};
|
|
2007
|
+
const clearFilter = () => {
|
|
2008
|
+
return i18nString(ClearFilters);
|
|
2009
|
+
};
|
|
2010
|
+
const code = () => {
|
|
2011
|
+
return i18nString(Code);
|
|
2012
|
+
};
|
|
2013
|
+
const message = () => {
|
|
2014
|
+
return i18nString(Message$1);
|
|
2015
|
+
};
|
|
2016
|
+
const file = () => {
|
|
2017
|
+
return i18nString(File);
|
|
2018
|
+
};
|
|
2019
|
+
const filter = () => {
|
|
2020
|
+
return i18nString(Filter$3);
|
|
2021
|
+
};
|
|
2022
|
+
const showingOf = (visibleCount, totalCount) => {
|
|
2023
|
+
return i18nString(ShowingOfItems, {
|
|
2024
|
+
PH1: visibleCount,
|
|
2025
|
+
PH2: totalCount
|
|
2026
|
+
});
|
|
2027
|
+
};
|
|
2028
|
+
const source = () => {
|
|
2029
|
+
return i18nString(Source);
|
|
2030
|
+
};
|
|
2031
|
+
const noResultsFoundWithProvidedFilterCriteria = () => {
|
|
2032
|
+
return i18nString(NoResultsFoundWithProvidedFilterCriteria);
|
|
2033
|
+
};
|
|
2034
|
+
const collapseAll = () => {
|
|
2035
|
+
return i18nString(CollapseAll$1);
|
|
2036
|
+
};
|
|
2037
|
+
const viewAsList$1 = () => {
|
|
2038
|
+
return i18nString(ViewAsList);
|
|
2039
|
+
};
|
|
2040
|
+
const viewAsTable$1 = () => {
|
|
2041
|
+
return i18nString(ViewAsTable);
|
|
2042
|
+
};
|
|
2043
|
+
const showErrors = () => {
|
|
2044
|
+
return i18nString(ShowErrors);
|
|
2045
|
+
};
|
|
2046
|
+
const showWarnings = () => {
|
|
2047
|
+
return i18nString(ShowWarnings);
|
|
2048
|
+
};
|
|
2049
|
+
const showInfos = () => {
|
|
2050
|
+
return i18nString(ShowInfos);
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
const getMenuEntriesFilter = state => [{
|
|
2054
|
+
command: '-1',
|
|
2055
|
+
flags: state.showErrors ? Checked : Unchecked,
|
|
2056
|
+
id: 'show-errors',
|
|
2057
|
+
label: showErrors()
|
|
2058
|
+
}, {
|
|
2059
|
+
command: '-1',
|
|
2060
|
+
flags: state.showWarnings ? Checked : Unchecked,
|
|
2061
|
+
id: 'show-warnings',
|
|
2062
|
+
label: showWarnings()
|
|
2063
|
+
}, {
|
|
2064
|
+
command: '-1',
|
|
2065
|
+
flags: state.showInfos ? Checked : Unchecked,
|
|
2066
|
+
id: 'show-infos',
|
|
2067
|
+
label: showInfos()
|
|
2068
|
+
}];
|
|
2069
|
+
|
|
2070
|
+
const getMenuEntries2 = (state, props) => {
|
|
2071
|
+
const {
|
|
2072
|
+
menuId
|
|
2073
|
+
} = props;
|
|
2074
|
+
switch (menuId) {
|
|
2075
|
+
case ProblemsFilter$1:
|
|
2076
|
+
return getMenuEntriesFilter(state);
|
|
2077
|
+
default:
|
|
2078
|
+
return [];
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
|
|
1922
2082
|
const getMenuIds = () => {
|
|
1923
2083
|
return [ProblemsFilter$1];
|
|
1924
2084
|
};
|
|
@@ -2064,30 +2224,12 @@ const handleIconThemeChange = state => {
|
|
|
2064
2224
|
};
|
|
2065
2225
|
};
|
|
2066
2226
|
|
|
2067
|
-
const
|
|
2068
|
-
|
|
2069
|
-
};
|
|
2070
|
-
const createEditorWorkerRpc = async () => {
|
|
2071
|
-
try {
|
|
2072
|
-
const rpc = await TransferMessagePortRpcParent.create({
|
|
2073
|
-
commandMap: {},
|
|
2074
|
-
send
|
|
2075
|
-
});
|
|
2076
|
-
return rpc;
|
|
2077
|
-
} catch (error) {
|
|
2078
|
-
throw new VError(error, `Failed to create editor worker rpc`);
|
|
2079
|
-
}
|
|
2227
|
+
const initialize = async () => {
|
|
2228
|
+
// function is not needed anymore
|
|
2080
2229
|
};
|
|
2081
2230
|
|
|
2082
2231
|
const {
|
|
2083
|
-
getProblems: getProblems$1
|
|
2084
|
-
set
|
|
2085
|
-
} = EditorWorker;
|
|
2086
|
-
|
|
2087
|
-
const initialize = async () => {
|
|
2088
|
-
const rpc = await createEditorWorkerRpc();
|
|
2089
|
-
set(rpc);
|
|
2090
|
-
};
|
|
2232
|
+
getProblems: getProblems$1} = EditorWorker;
|
|
2091
2233
|
|
|
2092
2234
|
const toProblem = (diagnostic, index) => {
|
|
2093
2235
|
const {
|
|
@@ -2199,85 +2341,6 @@ const getProblems = async workspaceUri => {
|
|
|
2199
2341
|
}
|
|
2200
2342
|
};
|
|
2201
2343
|
|
|
2202
|
-
const emptyObject = {};
|
|
2203
|
-
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
2204
|
-
const i18nString = (key, placeholders = emptyObject) => {
|
|
2205
|
-
if (placeholders === emptyObject) {
|
|
2206
|
-
return key;
|
|
2207
|
-
}
|
|
2208
|
-
const replacer = (match, rest) => {
|
|
2209
|
-
return placeholders[rest];
|
|
2210
|
-
};
|
|
2211
|
-
return key.replaceAll(RE_PLACEHOLDER, replacer);
|
|
2212
|
-
};
|
|
2213
|
-
|
|
2214
|
-
const ClearFilters = 'Clear Filters';
|
|
2215
|
-
const Code = 'Code';
|
|
2216
|
-
const File = 'File';
|
|
2217
|
-
const Filter$3 = 'Filter';
|
|
2218
|
-
const LineColumn = '[Ln {PH1}, Col {PH2}]';
|
|
2219
|
-
const Message$1 = 'Message';
|
|
2220
|
-
const NoProblemsDetected = 'No problems have been detected in the workspace.';
|
|
2221
|
-
const NoResultsFoundWithProvidedFilterCriteria = 'No results found with provided filter criteria.';
|
|
2222
|
-
const ProblemsDetected = 'Some problems have been detected in the workspace.';
|
|
2223
|
-
const ShowingOfItems = 'Showing {PH1} of {PH2} ';
|
|
2224
|
-
const Source = 'Source';
|
|
2225
|
-
const CollapseAll$1 = 'Collapse All';
|
|
2226
|
-
const ViewAsTable = 'View as Table';
|
|
2227
|
-
const ViewAsList = 'View as List';
|
|
2228
|
-
|
|
2229
|
-
const noProblemsDetected = () => {
|
|
2230
|
-
return i18nString(NoProblemsDetected);
|
|
2231
|
-
};
|
|
2232
|
-
const getMessage = problemsCount => {
|
|
2233
|
-
if (problemsCount === 0) {
|
|
2234
|
-
return i18nString(NoProblemsDetected);
|
|
2235
|
-
}
|
|
2236
|
-
return i18nString(ProblemsDetected);
|
|
2237
|
-
};
|
|
2238
|
-
const atLineColumn = (line, column) => {
|
|
2239
|
-
return i18nString(LineColumn, {
|
|
2240
|
-
PH1: line,
|
|
2241
|
-
PH2: column
|
|
2242
|
-
});
|
|
2243
|
-
};
|
|
2244
|
-
const clearFilter = () => {
|
|
2245
|
-
return i18nString(ClearFilters);
|
|
2246
|
-
};
|
|
2247
|
-
const code = () => {
|
|
2248
|
-
return i18nString(Code);
|
|
2249
|
-
};
|
|
2250
|
-
const message = () => {
|
|
2251
|
-
return i18nString(Message$1);
|
|
2252
|
-
};
|
|
2253
|
-
const file = () => {
|
|
2254
|
-
return i18nString(File);
|
|
2255
|
-
};
|
|
2256
|
-
const filter = () => {
|
|
2257
|
-
return i18nString(Filter$3);
|
|
2258
|
-
};
|
|
2259
|
-
const showingOf = (visibleCount, totalCount) => {
|
|
2260
|
-
return i18nString(ShowingOfItems, {
|
|
2261
|
-
PH1: visibleCount,
|
|
2262
|
-
PH2: totalCount
|
|
2263
|
-
});
|
|
2264
|
-
};
|
|
2265
|
-
const source = () => {
|
|
2266
|
-
return i18nString(Source);
|
|
2267
|
-
};
|
|
2268
|
-
const noResultsFoundWithProvidedFilterCriteria = () => {
|
|
2269
|
-
return i18nString(NoResultsFoundWithProvidedFilterCriteria);
|
|
2270
|
-
};
|
|
2271
|
-
const collapseAll = () => {
|
|
2272
|
-
return i18nString(CollapseAll$1);
|
|
2273
|
-
};
|
|
2274
|
-
const viewAsList$1 = () => {
|
|
2275
|
-
return i18nString(ViewAsList);
|
|
2276
|
-
};
|
|
2277
|
-
const viewAsTable$1 = () => {
|
|
2278
|
-
return i18nString(ViewAsTable);
|
|
2279
|
-
};
|
|
2280
|
-
|
|
2281
2344
|
const getSavedViewMode = savedState => {
|
|
2282
2345
|
if (savedState && typeof savedState.viewMode === 'number') {
|
|
2283
2346
|
return savedState.viewMode;
|
|
@@ -2365,12 +2428,12 @@ const ProblemsTableRowOdd = 'ProblemsTableRowOdd';
|
|
|
2365
2428
|
const ProblemsWarningIcon = 'ProblemsWarningIcon';
|
|
2366
2429
|
const Viewlet = 'Viewlet';
|
|
2367
2430
|
|
|
2368
|
-
const HandleBlur =
|
|
2369
|
-
const HandleClearFilterClick =
|
|
2370
|
-
const HandleContextMenu =
|
|
2371
|
-
const HandleFilterInput =
|
|
2372
|
-
const HandlePointerDown =
|
|
2373
|
-
const HandleClickMoreFilters =
|
|
2431
|
+
const HandleBlur = 1;
|
|
2432
|
+
const HandleClearFilterClick = 2;
|
|
2433
|
+
const HandleContextMenu = 3;
|
|
2434
|
+
const HandleFilterInput = 4;
|
|
2435
|
+
const HandlePointerDown = 5;
|
|
2436
|
+
const HandleClickMoreFilters = 6;
|
|
2374
2437
|
|
|
2375
2438
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2376
2439
|
return {
|
|
@@ -2402,8 +2465,8 @@ const getInputBoxVirtualDom = (name, onInput, placeholder) => {
|
|
|
2402
2465
|
autocorrect: 'off',
|
|
2403
2466
|
className: InputBox,
|
|
2404
2467
|
name,
|
|
2405
|
-
onInput
|
|
2406
|
-
placeholder
|
|
2468
|
+
onInput,
|
|
2469
|
+
placeholder,
|
|
2407
2470
|
spellcheck: false,
|
|
2408
2471
|
type: Input
|
|
2409
2472
|
};
|
|
@@ -2891,7 +2954,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2891
2954
|
newState,
|
|
2892
2955
|
oldState
|
|
2893
2956
|
} = get(uid);
|
|
2894
|
-
set
|
|
2957
|
+
set(uid, newState, newState);
|
|
2895
2958
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2896
2959
|
return commands;
|
|
2897
2960
|
};
|
|
@@ -3038,6 +3101,7 @@ const commandMap = {
|
|
|
3038
3101
|
'Problems.focusIndex': wrapCommand(focusIndex),
|
|
3039
3102
|
'Problems.getCommandIds': getCommandIds,
|
|
3040
3103
|
'Problems.getKeyBindings': getKeyBindings,
|
|
3104
|
+
'Problems.getMenuEntries2': wrapGetter(getMenuEntries2),
|
|
3041
3105
|
'Problems.getMenuIds': getMenuIds,
|
|
3042
3106
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
3043
3107
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
@@ -3053,18 +3117,41 @@ const commandMap = {
|
|
|
3053
3117
|
'Problems.renderActions': renderActions,
|
|
3054
3118
|
'Problems.renderEventListeners': renderEventListeners,
|
|
3055
3119
|
'Problems.resize': resize,
|
|
3056
|
-
'Problems.saveState': saveState,
|
|
3120
|
+
'Problems.saveState': wrapGetter(saveState),
|
|
3057
3121
|
'Problems.terminate': terminate,
|
|
3058
3122
|
'Problems.viewAsList': wrapCommand(viewAsList),
|
|
3059
3123
|
'Problems.viewAsTable': wrapCommand(viewAsTable)
|
|
3060
3124
|
};
|
|
3061
3125
|
|
|
3062
|
-
const
|
|
3063
|
-
|
|
3126
|
+
const commandMapRef = {};
|
|
3127
|
+
|
|
3128
|
+
const send = port => {
|
|
3129
|
+
return sendMessagePortToEditorWorker(port, 0);
|
|
3130
|
+
};
|
|
3131
|
+
const initializeEditorWorkerRpc = async () => {
|
|
3132
|
+
try {
|
|
3133
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
3134
|
+
commandMap: {},
|
|
3135
|
+
send
|
|
3136
|
+
});
|
|
3137
|
+
set$3(rpc);
|
|
3138
|
+
return rpc;
|
|
3139
|
+
} catch (error) {
|
|
3140
|
+
throw new VError(error, `Failed to create editor worker rpc`);
|
|
3141
|
+
}
|
|
3142
|
+
};
|
|
3143
|
+
|
|
3144
|
+
const initializeRendererWorker = async () => {
|
|
3064
3145
|
const rpc = await WebWorkerRpcClient.create({
|
|
3065
3146
|
commandMap: commandMapRef
|
|
3066
3147
|
});
|
|
3067
|
-
set$
|
|
3148
|
+
set$1(rpc);
|
|
3149
|
+
};
|
|
3150
|
+
|
|
3151
|
+
const listen = async () => {
|
|
3152
|
+
Object.assign(commandMapRef, commandMap);
|
|
3153
|
+
registerCommands(commandMap);
|
|
3154
|
+
await Promise.all([initializeRendererWorker(), initializeEditorWorkerRpc()]);
|
|
3068
3155
|
};
|
|
3069
3156
|
|
|
3070
3157
|
const main = async () => {
|