@lvce-editor/problems-view 1.15.0 → 1.17.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 +336 -254
- package/package.json +1 -1
|
@@ -1,3 +1,121 @@
|
|
|
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$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
|
+
|
|
1
119
|
const normalizeLine = line => {
|
|
2
120
|
if (line.startsWith('Error: ')) {
|
|
3
121
|
return line.slice('Error: '.length);
|
|
@@ -969,6 +1087,53 @@ const listen$1 = async (module, options) => {
|
|
|
969
1087
|
const ipc = module.wrap(rawIpc);
|
|
970
1088
|
return ipc;
|
|
971
1089
|
};
|
|
1090
|
+
|
|
1091
|
+
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
1092
|
+
|
|
1093
|
+
const createSharedLazyRpc = factory => {
|
|
1094
|
+
let rpcPromise;
|
|
1095
|
+
const getOrCreate = () => {
|
|
1096
|
+
if (!rpcPromise) {
|
|
1097
|
+
rpcPromise = factory();
|
|
1098
|
+
}
|
|
1099
|
+
return rpcPromise;
|
|
1100
|
+
};
|
|
1101
|
+
return {
|
|
1102
|
+
async dispose() {
|
|
1103
|
+
const rpc = await getOrCreate();
|
|
1104
|
+
await rpc.dispose();
|
|
1105
|
+
},
|
|
1106
|
+
async invoke(method, ...params) {
|
|
1107
|
+
const rpc = await getOrCreate();
|
|
1108
|
+
return rpc.invoke(method, ...params);
|
|
1109
|
+
},
|
|
1110
|
+
async invokeAndTransfer(method, ...params) {
|
|
1111
|
+
const rpc = await getOrCreate();
|
|
1112
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1113
|
+
},
|
|
1114
|
+
async send(method, ...params) {
|
|
1115
|
+
const rpc = await getOrCreate();
|
|
1116
|
+
rpc.send(method, ...params);
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
};
|
|
1120
|
+
const create$i = async ({
|
|
1121
|
+
commandMap,
|
|
1122
|
+
isMessagePortOpen,
|
|
1123
|
+
send
|
|
1124
|
+
}) => {
|
|
1125
|
+
return createSharedLazyRpc(() => {
|
|
1126
|
+
return create$2({
|
|
1127
|
+
commandMap,
|
|
1128
|
+
isMessagePortOpen,
|
|
1129
|
+
send
|
|
1130
|
+
});
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1133
|
+
const LazyTransferMessagePortRpcParent = {
|
|
1134
|
+
__proto__: null,
|
|
1135
|
+
create: create$i
|
|
1136
|
+
};
|
|
972
1137
|
const create$4 = async ({
|
|
973
1138
|
commandMap,
|
|
974
1139
|
isMessagePortOpen = true,
|
|
@@ -986,7 +1151,7 @@ const create$4 = async ({
|
|
|
986
1151
|
messagePort.start();
|
|
987
1152
|
return rpc;
|
|
988
1153
|
};
|
|
989
|
-
const create$2
|
|
1154
|
+
const create$2 = async ({
|
|
990
1155
|
commandMap,
|
|
991
1156
|
isMessagePortOpen,
|
|
992
1157
|
send
|
|
@@ -1002,10 +1167,6 @@ const create$2$1 = async ({
|
|
|
1002
1167
|
messagePort: port2
|
|
1003
1168
|
});
|
|
1004
1169
|
};
|
|
1005
|
-
const TransferMessagePortRpcParent = {
|
|
1006
|
-
__proto__: null,
|
|
1007
|
-
create: create$2$1
|
|
1008
|
-
};
|
|
1009
1170
|
const create$1$1 = async ({
|
|
1010
1171
|
commandMap
|
|
1011
1172
|
}) => {
|
|
@@ -1040,125 +1201,8 @@ const createMockRpc = ({
|
|
|
1040
1201
|
return mockRpc;
|
|
1041
1202
|
};
|
|
1042
1203
|
|
|
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 ManageExtension = 8;
|
|
1154
|
-
const ProblemsFilter$1 = 25;
|
|
1155
|
-
|
|
1156
|
-
const DebugWorker = 55;
|
|
1157
|
-
const EditorWorker$1 = 99;
|
|
1158
|
-
const RendererWorker$1 = 1;
|
|
1159
|
-
|
|
1160
1204
|
const rpcs = Object.create(null);
|
|
1161
|
-
const set$
|
|
1205
|
+
const set$4 = (id, rpc) => {
|
|
1162
1206
|
rpcs[id] = rpc;
|
|
1163
1207
|
};
|
|
1164
1208
|
const get$1 = id => {
|
|
@@ -1191,7 +1235,7 @@ const create$1 = rpcId => {
|
|
|
1191
1235
|
const mockRpc = createMockRpc({
|
|
1192
1236
|
commandMap
|
|
1193
1237
|
});
|
|
1194
|
-
set$
|
|
1238
|
+
set$4(rpcId, mockRpc);
|
|
1195
1239
|
// @ts-ignore
|
|
1196
1240
|
mockRpc[Symbol.dispose] = () => {
|
|
1197
1241
|
remove(rpcId);
|
|
@@ -1200,7 +1244,7 @@ const create$1 = rpcId => {
|
|
|
1200
1244
|
return mockRpc;
|
|
1201
1245
|
},
|
|
1202
1246
|
set(rpc) {
|
|
1203
|
-
set$
|
|
1247
|
+
set$4(rpcId, rpc);
|
|
1204
1248
|
}
|
|
1205
1249
|
};
|
|
1206
1250
|
};
|
|
@@ -1210,7 +1254,7 @@ const {
|
|
|
1210
1254
|
invoke: invoke$1,
|
|
1211
1255
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1212
1256
|
registerMockRpc: registerMockRpc$1,
|
|
1213
|
-
set: set$
|
|
1257
|
+
set: set$3
|
|
1214
1258
|
} = create$1(EditorWorker$1);
|
|
1215
1259
|
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1216
1260
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
@@ -1308,7 +1352,7 @@ const EditorWorker = {
|
|
|
1308
1352
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1309
1353
|
registerMockRpc: registerMockRpc$1,
|
|
1310
1354
|
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1311
|
-
set: set$
|
|
1355
|
+
set: set$3,
|
|
1312
1356
|
updateDebugInfo
|
|
1313
1357
|
};
|
|
1314
1358
|
|
|
@@ -1317,7 +1361,7 @@ const {
|
|
|
1317
1361
|
invoke,
|
|
1318
1362
|
invokeAndTransfer,
|
|
1319
1363
|
registerMockRpc,
|
|
1320
|
-
set: set$
|
|
1364
|
+
set: set$2
|
|
1321
1365
|
} = create$1(RendererWorker$1);
|
|
1322
1366
|
const searchFileHtml = async uri => {
|
|
1323
1367
|
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
@@ -1728,7 +1772,7 @@ const RendererWorker = {
|
|
|
1728
1772
|
sendMessagePortToSourceControlWorker,
|
|
1729
1773
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1730
1774
|
sendMessagePortToTextMeasurementWorker,
|
|
1731
|
-
set: set$
|
|
1775
|
+
set: set$2,
|
|
1732
1776
|
setAdditionalFocus,
|
|
1733
1777
|
setColorTheme,
|
|
1734
1778
|
setExtensionsSearchValue,
|
|
@@ -1749,7 +1793,7 @@ const RendererWorker = {
|
|
|
1749
1793
|
|
|
1750
1794
|
const {
|
|
1751
1795
|
sendMessagePortToEditorWorker,
|
|
1752
|
-
set: set$
|
|
1796
|
+
set: set$1,
|
|
1753
1797
|
writeClipBoardText
|
|
1754
1798
|
} = RendererWorker;
|
|
1755
1799
|
|
|
@@ -1772,9 +1816,12 @@ const Script = 2;
|
|
|
1772
1816
|
|
|
1773
1817
|
const {
|
|
1774
1818
|
get,
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1819
|
+
getCommandIds,
|
|
1820
|
+
registerCommands,
|
|
1821
|
+
set,
|
|
1822
|
+
wrapCommand,
|
|
1823
|
+
wrapGetter
|
|
1824
|
+
} = create$6();
|
|
1778
1825
|
|
|
1779
1826
|
const None = 0;
|
|
1780
1827
|
const Table = 1;
|
|
@@ -1802,7 +1849,7 @@ const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
|
1802
1849
|
x,
|
|
1803
1850
|
y
|
|
1804
1851
|
};
|
|
1805
|
-
set
|
|
1852
|
+
set(id, state, state);
|
|
1806
1853
|
};
|
|
1807
1854
|
|
|
1808
1855
|
const isEqual$1 = (oldState, newState) => {
|
|
@@ -1846,18 +1893,6 @@ const focusIndex = (state, index) => {
|
|
|
1846
1893
|
};
|
|
1847
1894
|
};
|
|
1848
1895
|
|
|
1849
|
-
const commandMapRef = {};
|
|
1850
|
-
|
|
1851
|
-
const toCommandId = key => {
|
|
1852
|
-
const dotIndex = key.indexOf('.');
|
|
1853
|
-
return key.slice(dotIndex + 1);
|
|
1854
|
-
};
|
|
1855
|
-
const getCommandIds = () => {
|
|
1856
|
-
const keys = Object.keys(commandMapRef);
|
|
1857
|
-
const ids = keys.map(toCommandId);
|
|
1858
|
-
return ids;
|
|
1859
|
-
};
|
|
1860
|
-
|
|
1861
1896
|
const mergeClassNames = (...classNames) => {
|
|
1862
1897
|
return classNames.filter(Boolean).join(' ');
|
|
1863
1898
|
};
|
|
@@ -1920,8 +1955,128 @@ const getKeyBindings = () => {
|
|
|
1920
1955
|
}];
|
|
1921
1956
|
};
|
|
1922
1957
|
|
|
1958
|
+
const emptyObject = {};
|
|
1959
|
+
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
1960
|
+
const i18nString = (key, placeholders = emptyObject) => {
|
|
1961
|
+
if (placeholders === emptyObject) {
|
|
1962
|
+
return key;
|
|
1963
|
+
}
|
|
1964
|
+
const replacer = (match, rest) => {
|
|
1965
|
+
return placeholders[rest];
|
|
1966
|
+
};
|
|
1967
|
+
return key.replaceAll(RE_PLACEHOLDER, replacer);
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
const ClearFilters = 'Clear Filters';
|
|
1971
|
+
const Code = 'Code';
|
|
1972
|
+
const File = 'File';
|
|
1973
|
+
const Filter$3 = 'Filter';
|
|
1974
|
+
const LineColumn = '[Ln {PH1}, Col {PH2}]';
|
|
1975
|
+
const Message$1 = 'Message';
|
|
1976
|
+
const NoProblemsDetected = 'No problems have been detected in the workspace.';
|
|
1977
|
+
const NoResultsFoundWithProvidedFilterCriteria = 'No results found with provided filter criteria.';
|
|
1978
|
+
const ProblemsDetected = 'Some problems have been detected in the workspace.';
|
|
1979
|
+
const ShowingOfItems = 'Showing {PH1} of {PH2} ';
|
|
1980
|
+
const Source = 'Source';
|
|
1981
|
+
const CollapseAll$1 = 'Collapse All';
|
|
1982
|
+
const ViewAsTable = 'View as Table';
|
|
1983
|
+
const ViewAsList = 'View as List';
|
|
1984
|
+
const ShowErrors = 'Show Errors';
|
|
1985
|
+
const ShowWarnings = 'Show Warnings';
|
|
1986
|
+
const ShowInfos = 'Show Infos';
|
|
1987
|
+
|
|
1988
|
+
const noProblemsDetected = () => {
|
|
1989
|
+
return i18nString(NoProblemsDetected);
|
|
1990
|
+
};
|
|
1991
|
+
const getMessage = problemsCount => {
|
|
1992
|
+
if (problemsCount === 0) {
|
|
1993
|
+
return i18nString(NoProblemsDetected);
|
|
1994
|
+
}
|
|
1995
|
+
return i18nString(ProblemsDetected);
|
|
1996
|
+
};
|
|
1997
|
+
const atLineColumn = (line, column) => {
|
|
1998
|
+
return i18nString(LineColumn, {
|
|
1999
|
+
PH1: line,
|
|
2000
|
+
PH2: column
|
|
2001
|
+
});
|
|
2002
|
+
};
|
|
2003
|
+
const clearFilter = () => {
|
|
2004
|
+
return i18nString(ClearFilters);
|
|
2005
|
+
};
|
|
2006
|
+
const code = () => {
|
|
2007
|
+
return i18nString(Code);
|
|
2008
|
+
};
|
|
2009
|
+
const message = () => {
|
|
2010
|
+
return i18nString(Message$1);
|
|
2011
|
+
};
|
|
2012
|
+
const file = () => {
|
|
2013
|
+
return i18nString(File);
|
|
2014
|
+
};
|
|
2015
|
+
const filter = () => {
|
|
2016
|
+
return i18nString(Filter$3);
|
|
2017
|
+
};
|
|
2018
|
+
const showingOf = (visibleCount, totalCount) => {
|
|
2019
|
+
return i18nString(ShowingOfItems, {
|
|
2020
|
+
PH1: visibleCount,
|
|
2021
|
+
PH2: totalCount
|
|
2022
|
+
});
|
|
2023
|
+
};
|
|
2024
|
+
const source = () => {
|
|
2025
|
+
return i18nString(Source);
|
|
2026
|
+
};
|
|
2027
|
+
const noResultsFoundWithProvidedFilterCriteria = () => {
|
|
2028
|
+
return i18nString(NoResultsFoundWithProvidedFilterCriteria);
|
|
2029
|
+
};
|
|
2030
|
+
const collapseAll = () => {
|
|
2031
|
+
return i18nString(CollapseAll$1);
|
|
2032
|
+
};
|
|
2033
|
+
const viewAsList$1 = () => {
|
|
2034
|
+
return i18nString(ViewAsList);
|
|
2035
|
+
};
|
|
2036
|
+
const viewAsTable$1 = () => {
|
|
2037
|
+
return i18nString(ViewAsTable);
|
|
2038
|
+
};
|
|
2039
|
+
const showErrors = () => {
|
|
2040
|
+
return i18nString(ShowErrors);
|
|
2041
|
+
};
|
|
2042
|
+
const showWarnings = () => {
|
|
2043
|
+
return i18nString(ShowWarnings);
|
|
2044
|
+
};
|
|
2045
|
+
const showInfos = () => {
|
|
2046
|
+
return i18nString(ShowInfos);
|
|
2047
|
+
};
|
|
2048
|
+
|
|
2049
|
+
const getMenuEntriesFilter = () => [{
|
|
2050
|
+
command: '-1',
|
|
2051
|
+
flags: None$1,
|
|
2052
|
+
id: 'show-errors',
|
|
2053
|
+
label: showErrors()
|
|
2054
|
+
}, {
|
|
2055
|
+
command: '-1',
|
|
2056
|
+
flags: None$1,
|
|
2057
|
+
id: 'show-warnings',
|
|
2058
|
+
label: showWarnings()
|
|
2059
|
+
}, {
|
|
2060
|
+
command: '-1',
|
|
2061
|
+
flags: None$1,
|
|
2062
|
+
id: 'show-infos',
|
|
2063
|
+
label: showInfos()
|
|
2064
|
+
}];
|
|
2065
|
+
|
|
2066
|
+
const getMenuEntries2 = (state, props) => {
|
|
2067
|
+
const {
|
|
2068
|
+
menuId
|
|
2069
|
+
} = props;
|
|
2070
|
+
switch (menuId) {
|
|
2071
|
+
case ProblemsFilter$1:
|
|
2072
|
+
return getMenuEntriesFilter();
|
|
2073
|
+
default:
|
|
2074
|
+
return [];
|
|
2075
|
+
}
|
|
2076
|
+
};
|
|
2077
|
+
|
|
1923
2078
|
const getMenuIds = () => {
|
|
1924
|
-
return [
|
|
2079
|
+
return [ProblemsFilter$1];
|
|
1925
2080
|
};
|
|
1926
2081
|
|
|
1927
2082
|
const Item = 0;
|
|
@@ -2065,30 +2220,12 @@ const handleIconThemeChange = state => {
|
|
|
2065
2220
|
};
|
|
2066
2221
|
};
|
|
2067
2222
|
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
};
|
|
2071
|
-
const createEditorWorkerRpc = async () => {
|
|
2072
|
-
try {
|
|
2073
|
-
const rpc = await TransferMessagePortRpcParent.create({
|
|
2074
|
-
commandMap: {},
|
|
2075
|
-
send
|
|
2076
|
-
});
|
|
2077
|
-
return rpc;
|
|
2078
|
-
} catch (error) {
|
|
2079
|
-
throw new VError(error, `Failed to create editor worker rpc`);
|
|
2080
|
-
}
|
|
2223
|
+
const initialize = async () => {
|
|
2224
|
+
// function is not needed anymore
|
|
2081
2225
|
};
|
|
2082
2226
|
|
|
2083
2227
|
const {
|
|
2084
|
-
getProblems: getProblems$1
|
|
2085
|
-
set
|
|
2086
|
-
} = EditorWorker;
|
|
2087
|
-
|
|
2088
|
-
const initialize = async () => {
|
|
2089
|
-
const rpc = await createEditorWorkerRpc();
|
|
2090
|
-
set(rpc);
|
|
2091
|
-
};
|
|
2228
|
+
getProblems: getProblems$1} = EditorWorker;
|
|
2092
2229
|
|
|
2093
2230
|
const toProblem = (diagnostic, index) => {
|
|
2094
2231
|
const {
|
|
@@ -2200,85 +2337,6 @@ const getProblems = async workspaceUri => {
|
|
|
2200
2337
|
}
|
|
2201
2338
|
};
|
|
2202
2339
|
|
|
2203
|
-
const emptyObject = {};
|
|
2204
|
-
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
2205
|
-
const i18nString = (key, placeholders = emptyObject) => {
|
|
2206
|
-
if (placeholders === emptyObject) {
|
|
2207
|
-
return key;
|
|
2208
|
-
}
|
|
2209
|
-
const replacer = (match, rest) => {
|
|
2210
|
-
return placeholders[rest];
|
|
2211
|
-
};
|
|
2212
|
-
return key.replaceAll(RE_PLACEHOLDER, replacer);
|
|
2213
|
-
};
|
|
2214
|
-
|
|
2215
|
-
const ClearFilters = 'Clear Filters';
|
|
2216
|
-
const Code = 'Code';
|
|
2217
|
-
const File = 'File';
|
|
2218
|
-
const Filter$3 = 'Filter';
|
|
2219
|
-
const LineColumn = '[Ln {PH1}, Col {PH2}]';
|
|
2220
|
-
const Message$1 = 'Message';
|
|
2221
|
-
const NoProblemsDetected = 'No problems have been detected in the workspace.';
|
|
2222
|
-
const NoResultsFoundWithProvidedFilterCriteria = 'No results found with provided filter criteria.';
|
|
2223
|
-
const ProblemsDetected = 'Some problems have been detected in the workspace.';
|
|
2224
|
-
const ShowingOfItems = 'Showing {PH1} of {PH2} ';
|
|
2225
|
-
const Source = 'Source';
|
|
2226
|
-
const CollapseAll$1 = 'Collapse All';
|
|
2227
|
-
const ViewAsTable = 'View as Table';
|
|
2228
|
-
const ViewAsList = 'View as List';
|
|
2229
|
-
|
|
2230
|
-
const noProblemsDetected = () => {
|
|
2231
|
-
return i18nString(NoProblemsDetected);
|
|
2232
|
-
};
|
|
2233
|
-
const getMessage = problemsCount => {
|
|
2234
|
-
if (problemsCount === 0) {
|
|
2235
|
-
return i18nString(NoProblemsDetected);
|
|
2236
|
-
}
|
|
2237
|
-
return i18nString(ProblemsDetected);
|
|
2238
|
-
};
|
|
2239
|
-
const atLineColumn = (line, column) => {
|
|
2240
|
-
return i18nString(LineColumn, {
|
|
2241
|
-
PH1: line,
|
|
2242
|
-
PH2: column
|
|
2243
|
-
});
|
|
2244
|
-
};
|
|
2245
|
-
const clearFilter = () => {
|
|
2246
|
-
return i18nString(ClearFilters);
|
|
2247
|
-
};
|
|
2248
|
-
const code = () => {
|
|
2249
|
-
return i18nString(Code);
|
|
2250
|
-
};
|
|
2251
|
-
const message = () => {
|
|
2252
|
-
return i18nString(Message$1);
|
|
2253
|
-
};
|
|
2254
|
-
const file = () => {
|
|
2255
|
-
return i18nString(File);
|
|
2256
|
-
};
|
|
2257
|
-
const filter = () => {
|
|
2258
|
-
return i18nString(Filter$3);
|
|
2259
|
-
};
|
|
2260
|
-
const showingOf = (visibleCount, totalCount) => {
|
|
2261
|
-
return i18nString(ShowingOfItems, {
|
|
2262
|
-
PH1: visibleCount,
|
|
2263
|
-
PH2: totalCount
|
|
2264
|
-
});
|
|
2265
|
-
};
|
|
2266
|
-
const source = () => {
|
|
2267
|
-
return i18nString(Source);
|
|
2268
|
-
};
|
|
2269
|
-
const noResultsFoundWithProvidedFilterCriteria = () => {
|
|
2270
|
-
return i18nString(NoResultsFoundWithProvidedFilterCriteria);
|
|
2271
|
-
};
|
|
2272
|
-
const collapseAll = () => {
|
|
2273
|
-
return i18nString(CollapseAll$1);
|
|
2274
|
-
};
|
|
2275
|
-
const viewAsList$1 = () => {
|
|
2276
|
-
return i18nString(ViewAsList);
|
|
2277
|
-
};
|
|
2278
|
-
const viewAsTable$1 = () => {
|
|
2279
|
-
return i18nString(ViewAsTable);
|
|
2280
|
-
};
|
|
2281
|
-
|
|
2282
2340
|
const getSavedViewMode = savedState => {
|
|
2283
2341
|
if (savedState && typeof savedState.viewMode === 'number') {
|
|
2284
2342
|
return savedState.viewMode;
|
|
@@ -2377,7 +2435,7 @@ const getIconVirtualDom = (icon, type = Div) => {
|
|
|
2377
2435
|
return {
|
|
2378
2436
|
childCount: 0,
|
|
2379
2437
|
className: mergeClassNames('MaskIcon', `MaskIcon${icon}`),
|
|
2380
|
-
role: None$
|
|
2438
|
+
role: None$2,
|
|
2381
2439
|
type
|
|
2382
2440
|
};
|
|
2383
2441
|
};
|
|
@@ -2488,7 +2546,7 @@ const getFileIconVirtualDom = icon => {
|
|
|
2488
2546
|
return {
|
|
2489
2547
|
childCount: 0,
|
|
2490
2548
|
className: FileIcon,
|
|
2491
|
-
role: None$
|
|
2549
|
+
role: None$2,
|
|
2492
2550
|
src: icon,
|
|
2493
2551
|
type: Img
|
|
2494
2552
|
};
|
|
@@ -2892,7 +2950,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2892
2950
|
newState,
|
|
2893
2951
|
oldState
|
|
2894
2952
|
} = get(uid);
|
|
2895
|
-
set
|
|
2953
|
+
set(uid, newState, newState);
|
|
2896
2954
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2897
2955
|
return commands;
|
|
2898
2956
|
};
|
|
@@ -3039,6 +3097,7 @@ const commandMap = {
|
|
|
3039
3097
|
'Problems.focusIndex': wrapCommand(focusIndex),
|
|
3040
3098
|
'Problems.getCommandIds': getCommandIds,
|
|
3041
3099
|
'Problems.getKeyBindings': getKeyBindings,
|
|
3100
|
+
'Problems.getMenuEntries2': wrapGetter(getMenuEntries2),
|
|
3042
3101
|
'Problems.getMenuIds': getMenuIds,
|
|
3043
3102
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
3044
3103
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
@@ -3054,18 +3113,41 @@ const commandMap = {
|
|
|
3054
3113
|
'Problems.renderActions': renderActions,
|
|
3055
3114
|
'Problems.renderEventListeners': renderEventListeners,
|
|
3056
3115
|
'Problems.resize': resize,
|
|
3057
|
-
'Problems.saveState': saveState,
|
|
3116
|
+
'Problems.saveState': wrapGetter(saveState),
|
|
3058
3117
|
'Problems.terminate': terminate,
|
|
3059
3118
|
'Problems.viewAsList': wrapCommand(viewAsList),
|
|
3060
3119
|
'Problems.viewAsTable': wrapCommand(viewAsTable)
|
|
3061
3120
|
};
|
|
3062
3121
|
|
|
3063
|
-
const
|
|
3064
|
-
|
|
3122
|
+
const commandMapRef = {};
|
|
3123
|
+
|
|
3124
|
+
const send = port => {
|
|
3125
|
+
return sendMessagePortToEditorWorker(port, 0);
|
|
3126
|
+
};
|
|
3127
|
+
const initializeEditorWorkerRpc = async () => {
|
|
3128
|
+
try {
|
|
3129
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
3130
|
+
commandMap: {},
|
|
3131
|
+
send
|
|
3132
|
+
});
|
|
3133
|
+
set$3(rpc);
|
|
3134
|
+
return rpc;
|
|
3135
|
+
} catch (error) {
|
|
3136
|
+
throw new VError(error, `Failed to create editor worker rpc`);
|
|
3137
|
+
}
|
|
3138
|
+
};
|
|
3139
|
+
|
|
3140
|
+
const initializeRendererWorker = async () => {
|
|
3065
3141
|
const rpc = await WebWorkerRpcClient.create({
|
|
3066
3142
|
commandMap: commandMapRef
|
|
3067
3143
|
});
|
|
3068
|
-
set$
|
|
3144
|
+
set$1(rpc);
|
|
3145
|
+
};
|
|
3146
|
+
|
|
3147
|
+
const listen = async () => {
|
|
3148
|
+
Object.assign(commandMapRef, commandMap);
|
|
3149
|
+
registerCommands(commandMap);
|
|
3150
|
+
await Promise.all([initializeRendererWorker(), initializeEditorWorkerRpc()]);
|
|
3069
3151
|
};
|
|
3070
3152
|
|
|
3071
3153
|
const main = async () => {
|