@lvce-editor/problems-view 1.12.0 → 1.14.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 +805 -308
- package/package.json +1 -1
|
@@ -527,7 +527,7 @@ const create$4$1 = (method, params) => {
|
|
|
527
527
|
};
|
|
528
528
|
};
|
|
529
529
|
const callbacks = Object.create(null);
|
|
530
|
-
const set$
|
|
530
|
+
const set$6 = (id, fn) => {
|
|
531
531
|
callbacks[id] = fn;
|
|
532
532
|
};
|
|
533
533
|
const get$2 = id => {
|
|
@@ -546,7 +546,7 @@ const registerPromise = () => {
|
|
|
546
546
|
resolve,
|
|
547
547
|
promise
|
|
548
548
|
} = Promise.withResolvers();
|
|
549
|
-
set$
|
|
549
|
+
set$6(id, resolve);
|
|
550
550
|
return {
|
|
551
551
|
id,
|
|
552
552
|
promise
|
|
@@ -626,7 +626,8 @@ const splitLines = lines => {
|
|
|
626
626
|
return lines.split(NewLine);
|
|
627
627
|
};
|
|
628
628
|
const getCurrentStack = () => {
|
|
629
|
-
const
|
|
629
|
+
const stackLinesToSkip = 3;
|
|
630
|
+
const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
|
|
630
631
|
return currentStack;
|
|
631
632
|
};
|
|
632
633
|
const getNewLineIndex = (string, startIndex = undefined) => {
|
|
@@ -890,13 +891,19 @@ const send$1 = (transport, method, ...params) => {
|
|
|
890
891
|
const message = create$4$1(method, params);
|
|
891
892
|
transport.send(message);
|
|
892
893
|
};
|
|
893
|
-
const invoke = (ipc, method, ...params) => {
|
|
894
|
+
const invoke$2 = (ipc, method, ...params) => {
|
|
894
895
|
return invokeHelper(ipc, method, params, false);
|
|
895
896
|
};
|
|
896
|
-
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
897
|
+
const invokeAndTransfer$2 = (ipc, method, ...params) => {
|
|
897
898
|
return invokeHelper(ipc, method, params, true);
|
|
898
899
|
};
|
|
899
900
|
|
|
901
|
+
class CommandNotFoundError extends Error {
|
|
902
|
+
constructor(command) {
|
|
903
|
+
super(`Command not found ${command}`);
|
|
904
|
+
this.name = 'CommandNotFoundError';
|
|
905
|
+
}
|
|
906
|
+
}
|
|
900
907
|
const commands = Object.create(null);
|
|
901
908
|
const register = commandMap => {
|
|
902
909
|
Object.assign(commands, commandMap);
|
|
@@ -907,7 +914,7 @@ const getCommand = key => {
|
|
|
907
914
|
const execute = (command, ...args) => {
|
|
908
915
|
const fn = getCommand(command);
|
|
909
916
|
if (!fn) {
|
|
910
|
-
throw new
|
|
917
|
+
throw new CommandNotFoundError(command);
|
|
911
918
|
}
|
|
912
919
|
return fn(...args);
|
|
913
920
|
};
|
|
@@ -923,10 +930,10 @@ const createRpc = ipc => {
|
|
|
923
930
|
send$1(ipc, method, ...params);
|
|
924
931
|
},
|
|
925
932
|
invoke(method, ...params) {
|
|
926
|
-
return invoke(ipc, method, ...params);
|
|
933
|
+
return invoke$2(ipc, method, ...params);
|
|
927
934
|
},
|
|
928
935
|
invokeAndTransfer(method, ...params) {
|
|
929
|
-
return invokeAndTransfer(ipc, method, ...params);
|
|
936
|
+
return invokeAndTransfer$2(ipc, method, ...params);
|
|
930
937
|
},
|
|
931
938
|
async dispose() {
|
|
932
939
|
await ipc?.dispose();
|
|
@@ -1012,9 +1019,33 @@ const WebWorkerRpcClient = {
|
|
|
1012
1019
|
__proto__: null,
|
|
1013
1020
|
create: create$4
|
|
1014
1021
|
};
|
|
1022
|
+
const createMockRpc = ({
|
|
1023
|
+
commandMap
|
|
1024
|
+
}) => {
|
|
1025
|
+
const invocations = [];
|
|
1026
|
+
const invoke = (method, ...params) => {
|
|
1027
|
+
invocations.push([method, ...params]);
|
|
1028
|
+
const command = commandMap[method];
|
|
1029
|
+
if (!command) {
|
|
1030
|
+
throw new Error(`command ${method} not found`);
|
|
1031
|
+
}
|
|
1032
|
+
return command(...params);
|
|
1033
|
+
};
|
|
1034
|
+
const mockRpc = {
|
|
1035
|
+
invoke,
|
|
1036
|
+
invokeAndTransfer: invoke,
|
|
1037
|
+
invocations
|
|
1038
|
+
};
|
|
1039
|
+
return mockRpc;
|
|
1040
|
+
};
|
|
1015
1041
|
|
|
1042
|
+
const toCommandId$1 = key => {
|
|
1043
|
+
const dotIndex = key.indexOf('.');
|
|
1044
|
+
return key.slice(dotIndex + 1);
|
|
1045
|
+
};
|
|
1016
1046
|
const create$2 = () => {
|
|
1017
1047
|
const states = Object.create(null);
|
|
1048
|
+
const commandMapRef = {};
|
|
1018
1049
|
return {
|
|
1019
1050
|
get(uid) {
|
|
1020
1051
|
return states[uid];
|
|
@@ -1041,10 +1072,11 @@ const create$2 = () => {
|
|
|
1041
1072
|
wrapCommand(fn) {
|
|
1042
1073
|
const wrapped = async (uid, ...args) => {
|
|
1043
1074
|
const {
|
|
1075
|
+
oldState,
|
|
1044
1076
|
newState
|
|
1045
1077
|
} = states[uid];
|
|
1046
1078
|
const newerState = await fn(newState, ...args);
|
|
1047
|
-
if (newState === newerState) {
|
|
1079
|
+
if (oldState === newerState || newState === newerState) {
|
|
1048
1080
|
return;
|
|
1049
1081
|
}
|
|
1050
1082
|
const latest = states[uid];
|
|
@@ -1055,6 +1087,15 @@ const create$2 = () => {
|
|
|
1055
1087
|
};
|
|
1056
1088
|
return wrapped;
|
|
1057
1089
|
},
|
|
1090
|
+
wrapGetter(fn) {
|
|
1091
|
+
const wrapped = (uid, ...args) => {
|
|
1092
|
+
const {
|
|
1093
|
+
newState
|
|
1094
|
+
} = states[uid];
|
|
1095
|
+
return fn(newState, ...args);
|
|
1096
|
+
};
|
|
1097
|
+
return wrapped;
|
|
1098
|
+
},
|
|
1058
1099
|
diff(uid, modules, numbers) {
|
|
1059
1100
|
const {
|
|
1060
1101
|
oldState,
|
|
@@ -1068,6 +1109,14 @@ const create$2 = () => {
|
|
|
1068
1109
|
}
|
|
1069
1110
|
}
|
|
1070
1111
|
return diffResult;
|
|
1112
|
+
},
|
|
1113
|
+
getCommandIds() {
|
|
1114
|
+
const keys = Object.keys(commandMapRef);
|
|
1115
|
+
const ids = keys.map(toCommandId$1);
|
|
1116
|
+
return ids;
|
|
1117
|
+
},
|
|
1118
|
+
registerCommands(commandMap) {
|
|
1119
|
+
Object.assign(commandMapRef, commandMap);
|
|
1071
1120
|
}
|
|
1072
1121
|
};
|
|
1073
1122
|
};
|
|
@@ -1075,16 +1124,43 @@ const terminate = () => {
|
|
|
1075
1124
|
globalThis.close();
|
|
1076
1125
|
};
|
|
1077
1126
|
|
|
1127
|
+
const None$1 = 'none';
|
|
1128
|
+
const ToolBar = 'toolbar';
|
|
1129
|
+
const Tree = 'tree';
|
|
1130
|
+
const TreeItem = 'treeitem';
|
|
1131
|
+
|
|
1132
|
+
const Button$1 = 1;
|
|
1133
|
+
const Div = 4;
|
|
1134
|
+
const Input = 6;
|
|
1135
|
+
const Span = 8;
|
|
1136
|
+
const Text = 12;
|
|
1137
|
+
const Img = 17;
|
|
1138
|
+
const A = 53;
|
|
1139
|
+
|
|
1140
|
+
const Space = 9;
|
|
1141
|
+
const PageUp = 10;
|
|
1142
|
+
const PageDown = 11;
|
|
1143
|
+
const End = 255;
|
|
1144
|
+
const Home = 12;
|
|
1145
|
+
const LeftArrow = 13;
|
|
1146
|
+
const UpArrow = 14;
|
|
1147
|
+
const RightArrow = 15;
|
|
1148
|
+
const DownArrow = 16;
|
|
1149
|
+
|
|
1150
|
+
const Script$1 = 2;
|
|
1151
|
+
|
|
1152
|
+
const DebugWorker = 55;
|
|
1153
|
+
const EditorWorker$1 = 99;
|
|
1154
|
+
const RendererWorker$1 = 1;
|
|
1155
|
+
|
|
1078
1156
|
const rpcs = Object.create(null);
|
|
1079
|
-
const set$
|
|
1157
|
+
const set$5 = (id, rpc) => {
|
|
1080
1158
|
rpcs[id] = rpc;
|
|
1081
1159
|
};
|
|
1082
1160
|
const get$1 = id => {
|
|
1083
1161
|
return rpcs[id];
|
|
1084
1162
|
};
|
|
1085
1163
|
|
|
1086
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1087
|
-
|
|
1088
1164
|
const create$1 = rpcId => {
|
|
1089
1165
|
return {
|
|
1090
1166
|
// @ts-ignore
|
|
@@ -1100,7 +1176,7 @@ const create$1 = rpcId => {
|
|
|
1100
1176
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1101
1177
|
},
|
|
1102
1178
|
set(rpc) {
|
|
1103
|
-
set$
|
|
1179
|
+
set$5(rpcId, rpc);
|
|
1104
1180
|
},
|
|
1105
1181
|
async dispose() {
|
|
1106
1182
|
const rpc = get$1(rpcId);
|
|
@@ -1108,42 +1184,511 @@ const create$1 = rpcId => {
|
|
|
1108
1184
|
}
|
|
1109
1185
|
};
|
|
1110
1186
|
};
|
|
1111
|
-
|
|
1112
|
-
const RendererWorker$1 = 1;
|
|
1187
|
+
|
|
1113
1188
|
const {
|
|
1114
|
-
invoke: invoke$
|
|
1115
|
-
|
|
1189
|
+
invoke: invoke$1,
|
|
1190
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1191
|
+
set: set$4,
|
|
1192
|
+
dispose: dispose$1
|
|
1193
|
+
} = create$1(EditorWorker$1);
|
|
1194
|
+
const sendMessagePortToExtensionHostWorker$1 = async port => {
|
|
1195
|
+
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1196
|
+
await invokeAndTransfer$1(
|
|
1197
|
+
// @ts-ignore
|
|
1198
|
+
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, 0);
|
|
1199
|
+
};
|
|
1200
|
+
// TODO add tests for this
|
|
1201
|
+
const activateByEvent$1 = async event => {
|
|
1202
|
+
// @ts-ignore
|
|
1203
|
+
await invoke$1('ActivateByEvent.activateByEvent', event);
|
|
1204
|
+
};
|
|
1205
|
+
const applyEdit = async (editorUid, changes) => {
|
|
1206
|
+
// @ts-ignore
|
|
1207
|
+
await invoke$1('Editor.applyEdit2', editorUid, changes);
|
|
1208
|
+
};
|
|
1209
|
+
const applyWorkspaceEdit = async (editorUid, changes) => {
|
|
1210
|
+
// @ts-ignore
|
|
1211
|
+
await invoke$1('Editor.applyWorkspaceEdit', editorUid, changes);
|
|
1212
|
+
};
|
|
1213
|
+
const closeWidget$1 = async (editorUid, widgetId, widgetName, focusId) => {
|
|
1214
|
+
// @ts-ignore
|
|
1215
|
+
await invoke$1('Editor.closeWidget2', editorUid, widgetId, widgetName, focusId);
|
|
1216
|
+
};
|
|
1217
|
+
const getWordAt = async (uid, rowIndex, columnIndex) => {
|
|
1218
|
+
// @ts-ignore
|
|
1219
|
+
const word = await invoke$1('Editor.getWordAt2', uid, rowIndex, columnIndex);
|
|
1220
|
+
return word;
|
|
1221
|
+
};
|
|
1222
|
+
const getLines = async editorUid => {
|
|
1223
|
+
const lines = await invoke$1('Editor.getLines2', editorUid);
|
|
1224
|
+
return lines;
|
|
1225
|
+
};
|
|
1226
|
+
const getPositionAtCursor = async parentUid => {
|
|
1227
|
+
const position = await invoke$1('Editor.getPositionAtCursor', parentUid);
|
|
1228
|
+
return position;
|
|
1229
|
+
};
|
|
1230
|
+
const getOffsetAtCursor = async editorId => {
|
|
1231
|
+
// @ts-ignore
|
|
1232
|
+
return await invoke$1('Editor.getOffsetAtCursor', editorId);
|
|
1233
|
+
};
|
|
1234
|
+
const getSelections = async editorUid => {
|
|
1235
|
+
const selections = await invoke$1('Editor.getSelections2', editorUid);
|
|
1236
|
+
return selections;
|
|
1237
|
+
};
|
|
1238
|
+
const getWordAtOffset2 = async editorUid => {
|
|
1239
|
+
return invoke$1('Editor.getWordAtOffset2', editorUid);
|
|
1240
|
+
};
|
|
1241
|
+
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
1242
|
+
return invoke$1('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
|
|
1243
|
+
};
|
|
1244
|
+
const updateDebugInfo = async info => {
|
|
1245
|
+
await invoke$1('Editor.updateDebugInfo', info);
|
|
1246
|
+
};
|
|
1247
|
+
const getUri = async editorUid => {
|
|
1248
|
+
// @ts-ignore
|
|
1249
|
+
return invoke$1('Editor.getUri', editorUid);
|
|
1250
|
+
};
|
|
1251
|
+
const getLanguageId = async editorUid => {
|
|
1252
|
+
// @ts-ignore
|
|
1253
|
+
return invoke$1('Editor.getLanguageId', editorUid);
|
|
1254
|
+
};
|
|
1116
1255
|
const getProblems$2 = async () => {
|
|
1117
1256
|
// @ts-ignore
|
|
1118
|
-
return invoke$
|
|
1257
|
+
return invoke$1('Editor.getProblems');
|
|
1119
1258
|
};
|
|
1259
|
+
const registerMockRpc$1 = commandMap => {
|
|
1260
|
+
const mockRpc = createMockRpc({
|
|
1261
|
+
commandMap
|
|
1262
|
+
});
|
|
1263
|
+
set$4(mockRpc);
|
|
1264
|
+
return mockRpc;
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1120
1267
|
const EditorWorker = {
|
|
1121
1268
|
__proto__: null,
|
|
1269
|
+
activateByEvent: activateByEvent$1,
|
|
1270
|
+
applyEdit,
|
|
1271
|
+
applyWorkspaceEdit,
|
|
1272
|
+
closeWidget: closeWidget$1,
|
|
1273
|
+
dispose: dispose$1,
|
|
1274
|
+
getLanguageId,
|
|
1275
|
+
getLines,
|
|
1276
|
+
getOffsetAtCursor,
|
|
1277
|
+
getPositionAtCursor,
|
|
1122
1278
|
getProblems: getProblems$2,
|
|
1123
|
-
|
|
1279
|
+
getSelections,
|
|
1280
|
+
getUri,
|
|
1281
|
+
getWordAt,
|
|
1282
|
+
getWordAtOffset2,
|
|
1283
|
+
getWordBefore,
|
|
1284
|
+
invoke: invoke$1,
|
|
1285
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1286
|
+
registerMockRpc: registerMockRpc$1,
|
|
1287
|
+
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1288
|
+
set: set$4,
|
|
1289
|
+
updateDebugInfo
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1124
1292
|
const {
|
|
1125
|
-
invoke
|
|
1126
|
-
invokeAndTransfer
|
|
1127
|
-
set: set$3
|
|
1293
|
+
invoke,
|
|
1294
|
+
invokeAndTransfer,
|
|
1295
|
+
set: set$3,
|
|
1296
|
+
dispose
|
|
1297
|
+
} = create$1(RendererWorker$1);
|
|
1298
|
+
const searchFileHtml = async uri => {
|
|
1299
|
+
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
1300
|
+
};
|
|
1301
|
+
const getFilePathElectron = async file => {
|
|
1302
|
+
return invoke('FileSystemHandle.getFilePathElectron', file);
|
|
1303
|
+
};
|
|
1304
|
+
/**
|
|
1305
|
+
* @deprecated
|
|
1306
|
+
*/
|
|
1307
|
+
const showContextMenu = async (x, y, id, ...args) => {
|
|
1308
|
+
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
1309
|
+
};
|
|
1310
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1311
|
+
number(uid);
|
|
1312
|
+
number(menuId);
|
|
1313
|
+
number(x);
|
|
1314
|
+
number(y);
|
|
1315
|
+
// @ts-ignore
|
|
1316
|
+
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1317
|
+
};
|
|
1318
|
+
const getElectronVersion = async () => {
|
|
1319
|
+
return invoke('Process.getElectronVersion');
|
|
1320
|
+
};
|
|
1321
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
1322
|
+
await invoke('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1323
|
+
};
|
|
1324
|
+
const setColorTheme = async id => {
|
|
1325
|
+
// @ts-ignore
|
|
1326
|
+
return invoke(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1327
|
+
};
|
|
1328
|
+
const getNodeVersion = async () => {
|
|
1329
|
+
return invoke('Process.getNodeVersion');
|
|
1330
|
+
};
|
|
1331
|
+
const getChromeVersion = async () => {
|
|
1332
|
+
return invoke('Process.getChromeVersion');
|
|
1333
|
+
};
|
|
1334
|
+
const getV8Version = async () => {
|
|
1335
|
+
return invoke('Process.getV8Version');
|
|
1336
|
+
};
|
|
1337
|
+
const getFileHandles = async fileIds => {
|
|
1338
|
+
const files = await invoke('FileSystemHandle.getFileHandles', fileIds);
|
|
1339
|
+
return files;
|
|
1340
|
+
};
|
|
1341
|
+
const setWorkspacePath = async path => {
|
|
1342
|
+
await invoke('Workspace.setPath', path);
|
|
1343
|
+
};
|
|
1344
|
+
const registerWebViewInterceptor = async (id, port) => {
|
|
1345
|
+
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1346
|
+
};
|
|
1347
|
+
const unregisterWebViewInterceptor = async id => {
|
|
1348
|
+
await invoke('WebView.unregisterInterceptor', id);
|
|
1349
|
+
};
|
|
1128
1350
|
const sendMessagePortToEditorWorker$1 = async (port, rpcId) => {
|
|
1129
1351
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1130
1352
|
// @ts-ignore
|
|
1131
|
-
await invokeAndTransfer
|
|
1353
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1354
|
+
};
|
|
1355
|
+
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1356
|
+
const command = 'Errors.handleMessagePort';
|
|
1357
|
+
// @ts-ignore
|
|
1358
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1359
|
+
};
|
|
1360
|
+
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1361
|
+
const command = 'Markdown.handleMessagePort';
|
|
1362
|
+
// @ts-ignore
|
|
1363
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1364
|
+
};
|
|
1365
|
+
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1366
|
+
const command = 'IconTheme.handleMessagePort';
|
|
1367
|
+
// @ts-ignore
|
|
1368
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1369
|
+
};
|
|
1370
|
+
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1371
|
+
const command = 'FileSystem.handleMessagePort';
|
|
1372
|
+
// @ts-ignore
|
|
1373
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1374
|
+
};
|
|
1375
|
+
const readFile = async uri => {
|
|
1376
|
+
return invoke('FileSystem.readFile', uri);
|
|
1377
|
+
};
|
|
1378
|
+
const getWebViewSecret = async key => {
|
|
1379
|
+
// @ts-ignore
|
|
1380
|
+
return invoke('WebView.getSecret', key);
|
|
1381
|
+
};
|
|
1382
|
+
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1383
|
+
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1384
|
+
};
|
|
1385
|
+
const setFocus = key => {
|
|
1386
|
+
return invoke('Focus.setFocus', key);
|
|
1387
|
+
};
|
|
1388
|
+
const getFileIcon = async options => {
|
|
1389
|
+
return invoke('IconTheme.getFileIcon', options);
|
|
1390
|
+
};
|
|
1391
|
+
const getColorThemeNames = async () => {
|
|
1392
|
+
return invoke('ColorTheme.getColorThemeNames');
|
|
1393
|
+
};
|
|
1394
|
+
const disableExtension = async id => {
|
|
1395
|
+
// @ts-ignore
|
|
1396
|
+
return invoke('ExtensionManagement.disable', id);
|
|
1397
|
+
};
|
|
1398
|
+
const enableExtension = async id => {
|
|
1399
|
+
// @ts-ignore
|
|
1400
|
+
return invoke('ExtensionManagement.enable', id);
|
|
1401
|
+
};
|
|
1402
|
+
const handleDebugChange = async params => {
|
|
1403
|
+
// @ts-ignore
|
|
1404
|
+
return invoke('Run And Debug.handleChange', params);
|
|
1405
|
+
};
|
|
1406
|
+
const getFolderIcon = async options => {
|
|
1407
|
+
return invoke('IconTheme.getFolderIcon', options);
|
|
1408
|
+
};
|
|
1409
|
+
const handleWorkspaceRefresh = async () => {
|
|
1410
|
+
return invoke('Layout.handleWorkspaceRefresh');
|
|
1411
|
+
};
|
|
1412
|
+
const closeWidget = async widgetId => {
|
|
1413
|
+
return invoke('Viewlet.closeWidget', widgetId);
|
|
1414
|
+
};
|
|
1415
|
+
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1416
|
+
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1417
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1418
|
+
};
|
|
1419
|
+
const sendMessagePortToSearchProcess = async port => {
|
|
1420
|
+
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1421
|
+
};
|
|
1422
|
+
const confirm = async (message, options) => {
|
|
1423
|
+
// @ts-ignore
|
|
1424
|
+
const result = await invoke('ConfirmPrompt.prompt', message, options);
|
|
1425
|
+
return result;
|
|
1426
|
+
};
|
|
1427
|
+
const getRecentlyOpened = async () => {
|
|
1428
|
+
return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1429
|
+
};
|
|
1430
|
+
const getKeyBindings$1 = async () => {
|
|
1431
|
+
return invoke('KeyBindingsInitial.getKeyBindings');
|
|
1132
1432
|
};
|
|
1133
1433
|
const writeClipBoardText$1 = async text => {
|
|
1134
|
-
await invoke
|
|
1434
|
+
await invoke('ClipBoard.writeText', /* text */text);
|
|
1435
|
+
};
|
|
1436
|
+
const readClipBoardText = async () => {
|
|
1437
|
+
return invoke('ClipBoard.readText');
|
|
1438
|
+
};
|
|
1439
|
+
const writeClipBoardImage = async blob => {
|
|
1440
|
+
// @ts-ignore
|
|
1441
|
+
await invoke('ClipBoard.writeImage', /* text */blob);
|
|
1442
|
+
};
|
|
1443
|
+
const searchFileMemory = async uri => {
|
|
1444
|
+
// @ts-ignore
|
|
1445
|
+
return invoke('ExtensionHost.searchFileWithMemory', uri);
|
|
1446
|
+
};
|
|
1447
|
+
const searchFileFetch = async uri => {
|
|
1448
|
+
return invoke('ExtensionHost.searchFileWithFetch', uri);
|
|
1449
|
+
};
|
|
1450
|
+
const showMessageBox = async options => {
|
|
1451
|
+
return invoke('ElectronDialog.showMessageBox', options);
|
|
1452
|
+
};
|
|
1453
|
+
const handleDebugResumed = async params => {
|
|
1454
|
+
await invoke('Run And Debug.handleResumed', params);
|
|
1455
|
+
};
|
|
1456
|
+
const openWidget = async name => {
|
|
1457
|
+
await invoke('Viewlet.openWidget', name);
|
|
1458
|
+
};
|
|
1459
|
+
const getIcons = async requests => {
|
|
1460
|
+
const icons = await invoke('IconTheme.getIcons', requests);
|
|
1461
|
+
return icons;
|
|
1462
|
+
};
|
|
1463
|
+
const activateByEvent = event => {
|
|
1464
|
+
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
1465
|
+
};
|
|
1466
|
+
const setAdditionalFocus = focusKey => {
|
|
1467
|
+
// @ts-ignore
|
|
1468
|
+
return invoke('Focus.setAdditionalFocus', focusKey);
|
|
1469
|
+
};
|
|
1470
|
+
const getActiveEditorId = () => {
|
|
1471
|
+
// @ts-ignore
|
|
1472
|
+
return invoke('GetActiveEditor.getActiveEditorId');
|
|
1473
|
+
};
|
|
1474
|
+
const getWorkspacePath = () => {
|
|
1475
|
+
return invoke('Workspace.getPath');
|
|
1476
|
+
};
|
|
1477
|
+
const sendMessagePortToRendererProcess = async port => {
|
|
1478
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1479
|
+
// @ts-ignore
|
|
1480
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1481
|
+
};
|
|
1482
|
+
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1483
|
+
const command = 'TextMeasurement.handleMessagePort';
|
|
1484
|
+
// @ts-ignore
|
|
1485
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1486
|
+
};
|
|
1487
|
+
const sendMessagePortToSourceControlWorker = async port => {
|
|
1488
|
+
const command = 'SourceControl.handleMessagePort';
|
|
1489
|
+
// @ts-ignore
|
|
1490
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1491
|
+
};
|
|
1492
|
+
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1493
|
+
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1494
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1495
|
+
};
|
|
1496
|
+
const getPreference = async key => {
|
|
1497
|
+
return await invoke('Preferences.get', key);
|
|
1498
|
+
};
|
|
1499
|
+
const getAllExtensions = async () => {
|
|
1500
|
+
return invoke('ExtensionManagement.getAllExtensions');
|
|
1501
|
+
};
|
|
1502
|
+
const rerenderEditor = async key => {
|
|
1503
|
+
// @ts-ignore
|
|
1504
|
+
return invoke('Editor.rerender', key);
|
|
1505
|
+
};
|
|
1506
|
+
const handleDebugPaused = async params => {
|
|
1507
|
+
await invoke('Run And Debug.handlePaused', params);
|
|
1508
|
+
};
|
|
1509
|
+
const openUri = async (uri, focus, options) => {
|
|
1510
|
+
await invoke('Main.openUri', uri, focus, options);
|
|
1511
|
+
};
|
|
1512
|
+
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1513
|
+
await invokeAndTransfer(
|
|
1514
|
+
// @ts-ignore
|
|
1515
|
+
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1516
|
+
};
|
|
1517
|
+
const handleDebugScriptParsed = async script => {
|
|
1518
|
+
await invoke('Run And Debug.handleScriptParsed', script);
|
|
1519
|
+
};
|
|
1520
|
+
const getWindowId = async () => {
|
|
1521
|
+
return invoke('GetWindowId.getWindowId');
|
|
1522
|
+
};
|
|
1523
|
+
const getBlob = async uri => {
|
|
1524
|
+
// @ts-ignore
|
|
1525
|
+
return invoke('FileSystem.getBlob', uri);
|
|
1526
|
+
};
|
|
1527
|
+
const getExtensionCommands = async () => {
|
|
1528
|
+
return invoke('ExtensionHost.getCommands');
|
|
1529
|
+
};
|
|
1530
|
+
const showErrorDialog = async errorInfo => {
|
|
1531
|
+
// @ts-ignore
|
|
1532
|
+
await invoke('ErrorHandling.showErrorDialog', errorInfo);
|
|
1533
|
+
};
|
|
1534
|
+
const getFolderSize = async uri => {
|
|
1535
|
+
// @ts-ignore
|
|
1536
|
+
return await invoke('FileSystem.getFolderSize', uri);
|
|
1537
|
+
};
|
|
1538
|
+
const getExtension = async id => {
|
|
1539
|
+
// @ts-ignore
|
|
1540
|
+
return invoke('ExtensionManagement.getExtension', id);
|
|
1541
|
+
};
|
|
1542
|
+
const getMarkdownDom = async html => {
|
|
1543
|
+
// @ts-ignore
|
|
1544
|
+
return invoke('Markdown.getVirtualDom', html);
|
|
1545
|
+
};
|
|
1546
|
+
const renderMarkdown = async (markdown, options) => {
|
|
1547
|
+
// @ts-ignore
|
|
1548
|
+
return invoke('Markdown.renderMarkdown', markdown, options);
|
|
1549
|
+
};
|
|
1550
|
+
const openNativeFolder = async uri => {
|
|
1551
|
+
// @ts-ignore
|
|
1552
|
+
await invoke('OpenNativeFolder.openNativeFolder', uri);
|
|
1553
|
+
};
|
|
1554
|
+
const uninstallExtension = async id => {
|
|
1555
|
+
return invoke('ExtensionManagement.uninstall', id);
|
|
1556
|
+
};
|
|
1557
|
+
const installExtension = async id => {
|
|
1558
|
+
// @ts-ignore
|
|
1559
|
+
return invoke('ExtensionManagement.install', id);
|
|
1560
|
+
};
|
|
1561
|
+
const openExtensionSearch = async () => {
|
|
1562
|
+
// @ts-ignore
|
|
1563
|
+
return invoke('SideBar.openViewlet', 'Extensions');
|
|
1564
|
+
};
|
|
1565
|
+
const setExtensionsSearchValue = async searchValue => {
|
|
1566
|
+
// @ts-ignore
|
|
1567
|
+
return invoke('Extensions.handleInput', searchValue, Script$1);
|
|
1568
|
+
};
|
|
1569
|
+
const openExternal = async uri => {
|
|
1570
|
+
// @ts-ignore
|
|
1571
|
+
await invoke('Open.openExternal', uri);
|
|
1572
|
+
};
|
|
1573
|
+
const openUrl = async uri => {
|
|
1574
|
+
// @ts-ignore
|
|
1575
|
+
await invoke('Open.openUrl', uri);
|
|
1576
|
+
};
|
|
1577
|
+
const getAllPreferences = async () => {
|
|
1578
|
+
// @ts-ignore
|
|
1579
|
+
return invoke('Preferences.getAll');
|
|
1580
|
+
};
|
|
1581
|
+
const showSaveFilePicker = async () => {
|
|
1582
|
+
// @ts-ignore
|
|
1583
|
+
return invoke('FilePicker.showSaveFilePicker');
|
|
1584
|
+
};
|
|
1585
|
+
const getLogsDir = async () => {
|
|
1586
|
+
// @ts-ignore
|
|
1587
|
+
return invoke('PlatformPaths.getLogsDir');
|
|
1588
|
+
};
|
|
1589
|
+
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1590
|
+
return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1135
1591
|
};
|
|
1592
|
+
const registerMockRpc = commandMap => {
|
|
1593
|
+
const mockRpc = createMockRpc({
|
|
1594
|
+
commandMap
|
|
1595
|
+
});
|
|
1596
|
+
set$3(mockRpc);
|
|
1597
|
+
return mockRpc;
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1136
1600
|
const RendererWorker = {
|
|
1137
1601
|
__proto__: null,
|
|
1602
|
+
activateByEvent,
|
|
1603
|
+
applyBulkReplacement,
|
|
1604
|
+
closeWidget,
|
|
1605
|
+
confirm,
|
|
1606
|
+
disableExtension,
|
|
1607
|
+
dispose,
|
|
1608
|
+
enableExtension,
|
|
1609
|
+
getActiveEditorId,
|
|
1610
|
+
getAllExtensions,
|
|
1611
|
+
getAllPreferences,
|
|
1612
|
+
getBlob,
|
|
1613
|
+
getChromeVersion,
|
|
1614
|
+
getColorThemeNames,
|
|
1615
|
+
getElectronVersion,
|
|
1616
|
+
getExtension,
|
|
1617
|
+
getExtensionCommands,
|
|
1618
|
+
getFileHandles,
|
|
1619
|
+
getFileIcon,
|
|
1620
|
+
getFilePathElectron,
|
|
1621
|
+
getFolderIcon,
|
|
1622
|
+
getFolderSize,
|
|
1623
|
+
getIcons,
|
|
1624
|
+
getKeyBindings: getKeyBindings$1,
|
|
1625
|
+
getLogsDir,
|
|
1626
|
+
getMarkdownDom,
|
|
1627
|
+
getNodeVersion,
|
|
1628
|
+
getPreference,
|
|
1629
|
+
getRecentlyOpened,
|
|
1630
|
+
getV8Version,
|
|
1631
|
+
getWebViewSecret,
|
|
1632
|
+
getWindowId,
|
|
1633
|
+
getWorkspacePath,
|
|
1634
|
+
handleDebugChange,
|
|
1635
|
+
handleDebugPaused,
|
|
1636
|
+
handleDebugResumed,
|
|
1637
|
+
handleDebugScriptParsed,
|
|
1638
|
+
handleWorkspaceRefresh,
|
|
1639
|
+
installExtension,
|
|
1640
|
+
invoke,
|
|
1641
|
+
invokeAndTransfer,
|
|
1642
|
+
measureTextBlockHeight,
|
|
1643
|
+
openExtensionSearch,
|
|
1644
|
+
openExternal,
|
|
1645
|
+
openNativeFolder,
|
|
1646
|
+
openUri,
|
|
1647
|
+
openUrl,
|
|
1648
|
+
openWidget,
|
|
1649
|
+
readClipBoardText,
|
|
1650
|
+
readFile,
|
|
1651
|
+
registerMockRpc,
|
|
1652
|
+
registerWebViewInterceptor,
|
|
1653
|
+
renderMarkdown,
|
|
1654
|
+
rerenderEditor,
|
|
1655
|
+
searchFileFetch,
|
|
1656
|
+
searchFileHtml,
|
|
1657
|
+
searchFileMemory,
|
|
1138
1658
|
sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
|
|
1659
|
+
sendMessagePortToErrorWorker,
|
|
1660
|
+
sendMessagePortToExtensionHostWorker,
|
|
1661
|
+
sendMessagePortToFileSystemProcess,
|
|
1662
|
+
sendMessagePortToFileSystemWorker,
|
|
1663
|
+
sendMessagePortToIconThemeWorker,
|
|
1664
|
+
sendMessagePortToMarkdownWorker,
|
|
1665
|
+
sendMessagePortToRendererProcess,
|
|
1666
|
+
sendMessagePortToSearchProcess,
|
|
1667
|
+
sendMessagePortToSourceControlWorker,
|
|
1668
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
1669
|
+
sendMessagePortToTextMeasurementWorker,
|
|
1139
1670
|
set: set$3,
|
|
1671
|
+
setAdditionalFocus,
|
|
1672
|
+
setColorTheme,
|
|
1673
|
+
setExtensionsSearchValue,
|
|
1674
|
+
setFocus,
|
|
1675
|
+
setWebViewPort,
|
|
1676
|
+
setWorkspacePath,
|
|
1677
|
+
showContextMenu,
|
|
1678
|
+
showContextMenu2,
|
|
1679
|
+
showErrorDialog,
|
|
1680
|
+
showMessageBox,
|
|
1681
|
+
showSaveFilePicker,
|
|
1682
|
+
uninstallExtension,
|
|
1683
|
+
unregisterWebViewInterceptor,
|
|
1684
|
+
writeClipBoardImage,
|
|
1140
1685
|
writeClipBoardText: writeClipBoardText$1
|
|
1141
1686
|
};
|
|
1142
1687
|
|
|
1143
1688
|
const {
|
|
1689
|
+
sendMessagePortToEditorWorker,
|
|
1144
1690
|
set: set$2,
|
|
1145
|
-
writeClipBoardText
|
|
1146
|
-
sendMessagePortToEditorWorker
|
|
1691
|
+
writeClipBoardText
|
|
1147
1692
|
} = RendererWorker;
|
|
1148
1693
|
|
|
1149
1694
|
const writeText = async text => {
|
|
@@ -1152,8 +1697,8 @@ const writeText = async text => {
|
|
|
1152
1697
|
|
|
1153
1698
|
const copyMessage = async state => {
|
|
1154
1699
|
const {
|
|
1155
|
-
|
|
1156
|
-
|
|
1700
|
+
focusedIndex,
|
|
1701
|
+
problems
|
|
1157
1702
|
} = state;
|
|
1158
1703
|
const problem = problems[focusedIndex];
|
|
1159
1704
|
await writeText(problem.message);
|
|
@@ -1169,31 +1714,31 @@ const {
|
|
|
1169
1714
|
wrapCommand
|
|
1170
1715
|
} = create$2();
|
|
1171
1716
|
|
|
1172
|
-
const None
|
|
1717
|
+
const None = 0;
|
|
1173
1718
|
const Table = 1;
|
|
1174
1719
|
const List = 2;
|
|
1175
1720
|
|
|
1176
1721
|
const create = (id, uri, x, y, width, height, workspaceUri) => {
|
|
1177
1722
|
const state = {
|
|
1178
|
-
|
|
1179
|
-
|
|
1723
|
+
collapsedUris: [],
|
|
1724
|
+
filteredProblems: [],
|
|
1725
|
+
filterValue: '',
|
|
1180
1726
|
focusedIndex: -2,
|
|
1181
|
-
message: '',
|
|
1182
|
-
itemHeight: 22,
|
|
1183
|
-
x,
|
|
1184
|
-
y,
|
|
1185
|
-
width,
|
|
1186
1727
|
height,
|
|
1187
|
-
filterValue: '',
|
|
1188
|
-
viewMode: None$1,
|
|
1189
1728
|
inputSource: User,
|
|
1190
|
-
|
|
1191
|
-
maxLineY: 0,
|
|
1729
|
+
itemHeight: 22,
|
|
1192
1730
|
listItems: [],
|
|
1193
|
-
|
|
1731
|
+
maxLineY: 0,
|
|
1732
|
+
message: '',
|
|
1733
|
+
minLineY: 0,
|
|
1734
|
+
problems: [],
|
|
1194
1735
|
smallWidthBreakPoint: 650,
|
|
1195
|
-
|
|
1196
|
-
|
|
1736
|
+
uid: id,
|
|
1737
|
+
viewMode: None,
|
|
1738
|
+
width,
|
|
1739
|
+
workspaceUri,
|
|
1740
|
+
x,
|
|
1741
|
+
y
|
|
1197
1742
|
};
|
|
1198
1743
|
set$1(id, state, state);
|
|
1199
1744
|
};
|
|
@@ -1225,8 +1770,8 @@ const diff = (oldState, newState) => {
|
|
|
1225
1770
|
|
|
1226
1771
|
const diff2 = uid => {
|
|
1227
1772
|
const {
|
|
1228
|
-
|
|
1229
|
-
|
|
1773
|
+
newState,
|
|
1774
|
+
oldState
|
|
1230
1775
|
} = get(uid);
|
|
1231
1776
|
const diffResult = diff(oldState, newState);
|
|
1232
1777
|
return diffResult;
|
|
@@ -1251,56 +1796,10 @@ const getCommandIds = () => {
|
|
|
1251
1796
|
return ids;
|
|
1252
1797
|
};
|
|
1253
1798
|
|
|
1254
|
-
const None = 'none';
|
|
1255
|
-
const ToolBar = 'toolbar';
|
|
1256
|
-
const Tree$1 = 'tree';
|
|
1257
|
-
const TreeItem$1 = 'treeitem';
|
|
1258
|
-
const AriaRoles = {
|
|
1259
|
-
__proto__: null,
|
|
1260
|
-
None,
|
|
1261
|
-
ToolBar,
|
|
1262
|
-
Tree: Tree$1,
|
|
1263
|
-
TreeItem: TreeItem$1
|
|
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
|
-
const KeyCode = {
|
|
1275
|
-
__proto__: null,
|
|
1276
|
-
DownArrow,
|
|
1277
|
-
End,
|
|
1278
|
-
Home,
|
|
1279
|
-
LeftArrow,
|
|
1280
|
-
PageDown,
|
|
1281
|
-
PageUp,
|
|
1282
|
-
RightArrow,
|
|
1283
|
-
Space,
|
|
1284
|
-
UpArrow
|
|
1285
|
-
};
|
|
1286
1799
|
const mergeClassNames = (...classNames) => {
|
|
1287
1800
|
return classNames.filter(Boolean).join(' ');
|
|
1288
1801
|
};
|
|
1289
|
-
|
|
1290
|
-
const Div = 4;
|
|
1291
|
-
const Input = 6;
|
|
1292
|
-
const Span = 8;
|
|
1293
|
-
const Text = 12;
|
|
1294
|
-
const Img = 17;
|
|
1295
|
-
const A = 53;
|
|
1296
|
-
const VirtualDomElements = {
|
|
1297
|
-
__proto__: null,
|
|
1298
|
-
A,
|
|
1299
|
-
Button: Button$1,
|
|
1300
|
-
Div,
|
|
1301
|
-
Img,
|
|
1302
|
-
Input,
|
|
1303
|
-
Span};
|
|
1802
|
+
|
|
1304
1803
|
const text = data => {
|
|
1305
1804
|
return {
|
|
1306
1805
|
type: Text,
|
|
@@ -1313,48 +1812,48 @@ const FocusProblems = 19;
|
|
|
1313
1812
|
|
|
1314
1813
|
const getKeyBindings = () => {
|
|
1315
1814
|
return [{
|
|
1316
|
-
key: KeyCode.DownArrow,
|
|
1317
1815
|
command: 'Problems.focusNext',
|
|
1816
|
+
key: DownArrow,
|
|
1318
1817
|
when: FocusProblems
|
|
1319
1818
|
}, {
|
|
1320
|
-
key: KeyCode.UpArrow,
|
|
1321
1819
|
command: 'Problems.focusPrevious',
|
|
1820
|
+
key: UpArrow,
|
|
1322
1821
|
when: FocusProblems
|
|
1323
1822
|
}, {
|
|
1324
|
-
key: KeyCode.Home,
|
|
1325
1823
|
command: 'Problems.focusFirst',
|
|
1824
|
+
key: Home,
|
|
1326
1825
|
when: FocusProblems
|
|
1327
1826
|
}, {
|
|
1328
|
-
key: KeyCode.PageUp,
|
|
1329
1827
|
command: 'Problems.focusFirst',
|
|
1828
|
+
key: PageUp,
|
|
1330
1829
|
when: FocusProblems
|
|
1331
1830
|
}, {
|
|
1332
|
-
key: KeyCode.PageDown,
|
|
1333
1831
|
command: 'Problems.focusLast',
|
|
1832
|
+
key: PageDown,
|
|
1334
1833
|
when: FocusProblems
|
|
1335
1834
|
}, {
|
|
1336
|
-
key: KeyCode.End,
|
|
1337
1835
|
command: 'Problems.focusLast',
|
|
1836
|
+
key: End,
|
|
1338
1837
|
when: FocusProblems
|
|
1339
1838
|
}, {
|
|
1340
|
-
key: KeyCode.Space,
|
|
1341
1839
|
command: 'Problems.selectCurrent',
|
|
1840
|
+
key: Space,
|
|
1342
1841
|
when: FocusProblems
|
|
1343
1842
|
}, {
|
|
1344
|
-
key: KeyCode.Home,
|
|
1345
1843
|
command: 'Problems.focusFirst',
|
|
1844
|
+
key: Home,
|
|
1346
1845
|
when: FocusProblems
|
|
1347
1846
|
}, {
|
|
1348
|
-
key: KeyCode.End,
|
|
1349
1847
|
command: 'Problems.focusLast',
|
|
1848
|
+
key: End,
|
|
1350
1849
|
when: FocusProblems
|
|
1351
1850
|
}, {
|
|
1352
|
-
key: KeyCode.LeftArrow,
|
|
1353
1851
|
command: 'Problems.handleArrowLeft',
|
|
1852
|
+
key: LeftArrow,
|
|
1354
1853
|
when: FocusProblems
|
|
1355
1854
|
}, {
|
|
1356
|
-
key: KeyCode.RightArrow,
|
|
1357
1855
|
command: 'Problems.handleArrowRight',
|
|
1856
|
+
key: RightArrow,
|
|
1358
1857
|
when: FocusProblems
|
|
1359
1858
|
}];
|
|
1360
1859
|
};
|
|
@@ -1380,9 +1879,9 @@ const getArrowLeftNewFocusedIndex = (problems, collapsedUris, focusedIndex) => {
|
|
|
1380
1879
|
};
|
|
1381
1880
|
const handleArrowLeft = state => {
|
|
1382
1881
|
const {
|
|
1383
|
-
|
|
1882
|
+
collapsedUris,
|
|
1384
1883
|
focusedIndex,
|
|
1385
|
-
|
|
1884
|
+
problems
|
|
1386
1885
|
} = state;
|
|
1387
1886
|
const {
|
|
1388
1887
|
index,
|
|
@@ -1390,8 +1889,8 @@ const handleArrowLeft = state => {
|
|
|
1390
1889
|
} = getArrowLeftNewFocusedIndex(problems, collapsedUris, focusedIndex);
|
|
1391
1890
|
return {
|
|
1392
1891
|
...state,
|
|
1393
|
-
|
|
1394
|
-
|
|
1892
|
+
collapsedUris: newCollapsedUris,
|
|
1893
|
+
focusedIndex: index
|
|
1395
1894
|
};
|
|
1396
1895
|
};
|
|
1397
1896
|
|
|
@@ -1413,9 +1912,9 @@ const getArrowRightNewFocusedIndex = (problems, collapsedUris, focusedIndex) =>
|
|
|
1413
1912
|
};
|
|
1414
1913
|
const handleArrowRight = state => {
|
|
1415
1914
|
const {
|
|
1416
|
-
|
|
1915
|
+
collapsedUris,
|
|
1417
1916
|
focusedIndex,
|
|
1418
|
-
|
|
1917
|
+
problems
|
|
1419
1918
|
} = state;
|
|
1420
1919
|
const {
|
|
1421
1920
|
index,
|
|
@@ -1423,8 +1922,8 @@ const handleArrowRight = state => {
|
|
|
1423
1922
|
} = getArrowRightNewFocusedIndex(problems, collapsedUris, focusedIndex);
|
|
1424
1923
|
return {
|
|
1425
1924
|
...state,
|
|
1426
|
-
|
|
1427
|
-
|
|
1925
|
+
collapsedUris: newCollapsedUris,
|
|
1926
|
+
focusedIndex: index
|
|
1428
1927
|
};
|
|
1429
1928
|
};
|
|
1430
1929
|
|
|
@@ -1436,10 +1935,10 @@ const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight) => {
|
|
|
1436
1935
|
|
|
1437
1936
|
const handleClickAt = (state, eventX, eventY) => {
|
|
1438
1937
|
const {
|
|
1938
|
+
itemHeight,
|
|
1439
1939
|
problems,
|
|
1440
1940
|
x,
|
|
1441
|
-
y
|
|
1442
|
-
itemHeight
|
|
1941
|
+
y
|
|
1443
1942
|
} = state;
|
|
1444
1943
|
|
|
1445
1944
|
// TODO use functional focus rendering
|
|
@@ -1462,8 +1961,6 @@ const handleClickButton = async (state, name) => {
|
|
|
1462
1961
|
};
|
|
1463
1962
|
|
|
1464
1963
|
const handleContextMenu = async (state, eventX, eventY) => {
|
|
1465
|
-
// @ts-ignore
|
|
1466
|
-
// await ContextMenu.show(eventX, eventY, MenuEntryId.Problems)
|
|
1467
1964
|
return state;
|
|
1468
1965
|
};
|
|
1469
1966
|
|
|
@@ -1498,8 +1995,8 @@ const createEditorWorkerRpc = async () => {
|
|
|
1498
1995
|
};
|
|
1499
1996
|
|
|
1500
1997
|
const {
|
|
1501
|
-
|
|
1502
|
-
|
|
1998
|
+
getProblems: getProblems$1,
|
|
1999
|
+
set
|
|
1503
2000
|
} = EditorWorker;
|
|
1504
2001
|
|
|
1505
2002
|
const initialize = async () => {
|
|
@@ -1509,29 +2006,29 @@ const initialize = async () => {
|
|
|
1509
2006
|
|
|
1510
2007
|
const toProblem = (diagnostic, index) => {
|
|
1511
2008
|
const {
|
|
2009
|
+
code,
|
|
2010
|
+
columnIndex,
|
|
1512
2011
|
message,
|
|
1513
2012
|
rowIndex,
|
|
1514
|
-
columnIndex,
|
|
1515
2013
|
source,
|
|
1516
|
-
code,
|
|
1517
2014
|
type,
|
|
1518
2015
|
uri
|
|
1519
2016
|
} = diagnostic;
|
|
1520
2017
|
return {
|
|
1521
|
-
|
|
1522
|
-
rowIndex: rowIndex || 0,
|
|
2018
|
+
code: code || '',
|
|
1523
2019
|
columnIndex: columnIndex || 0,
|
|
1524
|
-
uri,
|
|
1525
|
-
relativePath: '',
|
|
1526
2020
|
count: 0,
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
type: type || 'error',
|
|
2021
|
+
fileName: '',
|
|
2022
|
+
level: 2,
|
|
1530
2023
|
listItemType: Item,
|
|
2024
|
+
message: message || '',
|
|
1531
2025
|
posInSet: index,
|
|
2026
|
+
relativePath: '',
|
|
2027
|
+
rowIndex: rowIndex || 0,
|
|
1532
2028
|
setSize: 1,
|
|
1533
|
-
|
|
1534
|
-
|
|
2029
|
+
source: source || '',
|
|
2030
|
+
type: type || 'error',
|
|
2031
|
+
uri
|
|
1535
2032
|
};
|
|
1536
2033
|
};
|
|
1537
2034
|
const getRelativeParentUri = (uri, workspaceUri) => {
|
|
@@ -1545,20 +2042,20 @@ const getFileName = uri => {
|
|
|
1545
2042
|
const toProblems = (diagnostics, workspaceUri = '') => {
|
|
1546
2043
|
const problems = [];
|
|
1547
2044
|
let problem = {
|
|
1548
|
-
|
|
1549
|
-
rowIndex: 0,
|
|
2045
|
+
code: '',
|
|
1550
2046
|
columnIndex: 0,
|
|
1551
|
-
uri: '',
|
|
1552
|
-
relativePath: '',
|
|
1553
2047
|
count: 0,
|
|
1554
|
-
|
|
1555
|
-
code: '',
|
|
2048
|
+
fileName: '',
|
|
1556
2049
|
level: 0,
|
|
1557
2050
|
listItemType: 0,
|
|
2051
|
+
message: '',
|
|
1558
2052
|
posInSet: 0,
|
|
2053
|
+
relativePath: '',
|
|
2054
|
+
rowIndex: 0,
|
|
1559
2055
|
setSize: 0,
|
|
2056
|
+
source: '',
|
|
1560
2057
|
type: '',
|
|
1561
|
-
|
|
2058
|
+
uri: ''
|
|
1562
2059
|
};
|
|
1563
2060
|
let relativeIndex = 0;
|
|
1564
2061
|
for (const diagnostic of diagnostics) {
|
|
@@ -1568,20 +2065,20 @@ const toProblems = (diagnostics, workspaceUri = '') => {
|
|
|
1568
2065
|
} else {
|
|
1569
2066
|
relativeIndex = 1;
|
|
1570
2067
|
problem = {
|
|
1571
|
-
|
|
1572
|
-
rowIndex: 0,
|
|
2068
|
+
code: '',
|
|
1573
2069
|
columnIndex: 0,
|
|
1574
|
-
uri: diagnostic.uri,
|
|
1575
|
-
relativePath: '',
|
|
1576
2070
|
count: 1,
|
|
1577
|
-
|
|
1578
|
-
|
|
2071
|
+
fileName: '',
|
|
2072
|
+
level: 1,
|
|
1579
2073
|
listItemType: Expanded,
|
|
2074
|
+
message: '',
|
|
1580
2075
|
posInSet: relativeIndex,
|
|
2076
|
+
relativePath: '',
|
|
2077
|
+
rowIndex: 0,
|
|
1581
2078
|
setSize: 123,
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
2079
|
+
source: '',
|
|
2080
|
+
type: '',
|
|
2081
|
+
uri: diagnostic.uri
|
|
1585
2082
|
};
|
|
1586
2083
|
problems.push(problem);
|
|
1587
2084
|
}
|
|
@@ -1606,13 +2103,13 @@ const getProblems = async workspaceUri => {
|
|
|
1606
2103
|
// @ts-ignore
|
|
1607
2104
|
const problems = toProblems(diagnostics, workspaceUri);
|
|
1608
2105
|
return {
|
|
1609
|
-
|
|
1610
|
-
|
|
2106
|
+
error: '',
|
|
2107
|
+
problems
|
|
1611
2108
|
};
|
|
1612
2109
|
} catch (error) {
|
|
1613
2110
|
return {
|
|
1614
|
-
|
|
1615
|
-
|
|
2111
|
+
error: `${error}`,
|
|
2112
|
+
problems: []
|
|
1616
2113
|
};
|
|
1617
2114
|
}
|
|
1618
2115
|
};
|
|
@@ -1719,8 +2216,8 @@ const getSavedCollapsedUris = savedState => {
|
|
|
1719
2216
|
};
|
|
1720
2217
|
const loadContent = async (state, savedState) => {
|
|
1721
2218
|
const {
|
|
1722
|
-
|
|
1723
|
-
|
|
2219
|
+
error,
|
|
2220
|
+
problems
|
|
1724
2221
|
} = await getProblems(state.workspaceUri);
|
|
1725
2222
|
if (error) {
|
|
1726
2223
|
return {
|
|
@@ -1734,14 +2231,14 @@ const loadContent = async (state, savedState) => {
|
|
|
1734
2231
|
const collapsedUris = getSavedCollapsedUris(savedState);
|
|
1735
2232
|
return {
|
|
1736
2233
|
...state,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
viewMode,
|
|
2234
|
+
collapsedUris,
|
|
2235
|
+
filteredProblems: problems,
|
|
1740
2236
|
filterValue,
|
|
1741
2237
|
inputSource: Script,
|
|
1742
|
-
filteredProblems: problems,
|
|
1743
2238
|
listItems: [],
|
|
1744
|
-
|
|
2239
|
+
message,
|
|
2240
|
+
problems,
|
|
2241
|
+
viewMode
|
|
1745
2242
|
};
|
|
1746
2243
|
};
|
|
1747
2244
|
|
|
@@ -1789,40 +2286,40 @@ const HandleContextMenu = 'handleContextMenu';
|
|
|
1789
2286
|
const HandleFilterInput = 'handleFilterInput';
|
|
1790
2287
|
const HandlePointerDown = 'handlePointerDown';
|
|
1791
2288
|
|
|
1792
|
-
const getIconVirtualDom = (icon, type =
|
|
2289
|
+
const getIconVirtualDom = (icon, type = Div) => {
|
|
1793
2290
|
return {
|
|
1794
|
-
|
|
2291
|
+
childCount: 0,
|
|
1795
2292
|
className: mergeClassNames('MaskIcon', `MaskIcon${icon}`),
|
|
1796
|
-
role:
|
|
1797
|
-
|
|
2293
|
+
role: None$1,
|
|
2294
|
+
type
|
|
1798
2295
|
};
|
|
1799
2296
|
};
|
|
1800
2297
|
|
|
1801
2298
|
const getActionButtonVirtualDom = action => {
|
|
1802
2299
|
const {
|
|
1803
|
-
|
|
2300
|
+
command,
|
|
1804
2301
|
icon,
|
|
1805
|
-
|
|
2302
|
+
id
|
|
1806
2303
|
} = action;
|
|
1807
2304
|
return [{
|
|
1808
|
-
|
|
2305
|
+
childCount: 1,
|
|
1809
2306
|
className: IconButton,
|
|
1810
|
-
title: id,
|
|
1811
2307
|
'data-command': command,
|
|
1812
|
-
|
|
2308
|
+
title: id,
|
|
2309
|
+
type: Button$1
|
|
1813
2310
|
}, getIconVirtualDom(icon)];
|
|
1814
2311
|
};
|
|
1815
2312
|
|
|
1816
2313
|
const getInputBoxVirtualDom = (name, onInput, placeholder) => {
|
|
1817
2314
|
return {
|
|
1818
|
-
type: VirtualDomElements.Input,
|
|
1819
|
-
className: InputBox,
|
|
1820
2315
|
autocapitalize: 'off',
|
|
1821
2316
|
autocorrect: 'off',
|
|
2317
|
+
className: InputBox,
|
|
1822
2318
|
name,
|
|
1823
2319
|
onInput: onInput,
|
|
1824
2320
|
placeholder: placeholder,
|
|
1825
|
-
spellcheck: false
|
|
2321
|
+
spellcheck: false,
|
|
2322
|
+
type: Input
|
|
1826
2323
|
};
|
|
1827
2324
|
};
|
|
1828
2325
|
|
|
@@ -1845,70 +2342,69 @@ const getBadgeDom = badgeText => {
|
|
|
1845
2342
|
return [];
|
|
1846
2343
|
}
|
|
1847
2344
|
return [{
|
|
1848
|
-
|
|
2345
|
+
childCount: 1,
|
|
1849
2346
|
className: FilterBadge,
|
|
1850
|
-
|
|
2347
|
+
type: Div
|
|
1851
2348
|
}, text(badgeText)];
|
|
1852
2349
|
};
|
|
1853
2350
|
const getProblemsFilterVirtualDom = action => {
|
|
1854
2351
|
return [{
|
|
1855
|
-
|
|
2352
|
+
childCount: getChildCount(action.badgeText),
|
|
1856
2353
|
className: Filter$1,
|
|
1857
|
-
|
|
2354
|
+
type: Div
|
|
1858
2355
|
}, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
|
|
1859
|
-
|
|
1860
|
-
// TODO use i18n string
|
|
2356
|
+
command: 'more filters',
|
|
1861
2357
|
icon: Filter,
|
|
1862
|
-
|
|
2358
|
+
id: 'more filters' // TODO use i18n string
|
|
1863
2359
|
})];
|
|
1864
2360
|
};
|
|
1865
2361
|
|
|
1866
2362
|
const getNoResultsWithFilterVirtualDom = () => {
|
|
1867
2363
|
return [{
|
|
1868
|
-
|
|
2364
|
+
childCount: 3,
|
|
1869
2365
|
className: Message,
|
|
1870
|
-
|
|
2366
|
+
type: Div
|
|
1871
2367
|
}, {
|
|
1872
|
-
|
|
1873
|
-
|
|
2368
|
+
childCount: 1,
|
|
2369
|
+
type: Span
|
|
1874
2370
|
}, text(noResultsFoundWithProvidedFilterCriteria()), {
|
|
1875
|
-
type: VirtualDomElements.A,
|
|
1876
|
-
className: MessageAction,
|
|
1877
2371
|
childCount: 1,
|
|
1878
|
-
|
|
2372
|
+
className: MessageAction,
|
|
2373
|
+
onClick: HandleClearFilterClick,
|
|
2374
|
+
type: A
|
|
1879
2375
|
}, text(clearFilter()), text('.')];
|
|
1880
2376
|
};
|
|
1881
2377
|
|
|
1882
2378
|
const getBadgeVirtualDom = (className, count) => {
|
|
1883
2379
|
return [{
|
|
1884
|
-
|
|
2380
|
+
childCount: 1,
|
|
1885
2381
|
className: mergeClassNames('Badge', className) + (''),
|
|
1886
|
-
|
|
2382
|
+
type: Div
|
|
1887
2383
|
}, text(`${count}`)];
|
|
1888
2384
|
};
|
|
1889
2385
|
|
|
1890
2386
|
const getChevronDownVirtualDom = (extraClassName = '') => {
|
|
1891
2387
|
return {
|
|
1892
|
-
|
|
2388
|
+
childCount: 0,
|
|
1893
2389
|
className: mergeClassNames(Chevron, 'MaskIconChevronDown', extraClassName) + (extraClassName === '' ? ' ' : ''),
|
|
1894
|
-
|
|
2390
|
+
type: Div
|
|
1895
2391
|
};
|
|
1896
2392
|
};
|
|
1897
2393
|
const getChevronRightVirtualDom = (extraClassName = '') => {
|
|
1898
2394
|
return {
|
|
1899
|
-
|
|
2395
|
+
childCount: 0,
|
|
1900
2396
|
className: mergeClassNames(Chevron, 'MaskIconChevronRight', extraClassName) + (extraClassName === '' ? ' ' : ''),
|
|
1901
|
-
|
|
2397
|
+
type: Div
|
|
1902
2398
|
};
|
|
1903
2399
|
};
|
|
1904
2400
|
|
|
1905
2401
|
const getFileIconVirtualDom = icon => {
|
|
1906
2402
|
return {
|
|
1907
|
-
|
|
2403
|
+
childCount: 0,
|
|
1908
2404
|
className: FileIcon,
|
|
2405
|
+
role: None$1,
|
|
1909
2406
|
src: icon,
|
|
1910
|
-
|
|
1911
|
-
childCount: 0
|
|
2407
|
+
type: Img
|
|
1912
2408
|
};
|
|
1913
2409
|
};
|
|
1914
2410
|
|
|
@@ -1917,15 +2413,15 @@ const Warning = 'warning';
|
|
|
1917
2413
|
const getProblemsIconVirtualDom = type => {
|
|
1918
2414
|
if (type === Warning) {
|
|
1919
2415
|
return {
|
|
1920
|
-
|
|
2416
|
+
childCount: 0,
|
|
1921
2417
|
className: mergeClassNames(ProblemsIcon, ProblemsWarningIcon),
|
|
1922
|
-
|
|
2418
|
+
type: Div
|
|
1923
2419
|
};
|
|
1924
2420
|
}
|
|
1925
2421
|
return {
|
|
1926
|
-
|
|
2422
|
+
childCount: 0,
|
|
1927
2423
|
className: mergeClassNames(ProblemsIcon, ProblemsErrorIcon),
|
|
1928
|
-
|
|
2424
|
+
type: Div
|
|
1929
2425
|
};
|
|
1930
2426
|
};
|
|
1931
2427
|
|
|
@@ -1951,6 +2447,7 @@ const getProblemVirtualDom = problem => {
|
|
|
1951
2447
|
const {
|
|
1952
2448
|
code,
|
|
1953
2449
|
columnIndex,
|
|
2450
|
+
fileName,
|
|
1954
2451
|
filterValueLength,
|
|
1955
2452
|
icon,
|
|
1956
2453
|
isActive,
|
|
@@ -1964,8 +2461,7 @@ const getProblemVirtualDom = problem => {
|
|
|
1964
2461
|
rowIndex,
|
|
1965
2462
|
setSize,
|
|
1966
2463
|
source,
|
|
1967
|
-
type
|
|
1968
|
-
fileName
|
|
2464
|
+
type
|
|
1969
2465
|
} = problem;
|
|
1970
2466
|
let className = Problem;
|
|
1971
2467
|
if (isActive) {
|
|
@@ -1973,41 +2469,41 @@ const getProblemVirtualDom = problem => {
|
|
|
1973
2469
|
}
|
|
1974
2470
|
if (listItemType === Expanded || listItemType === Collapsed) {
|
|
1975
2471
|
return [{
|
|
1976
|
-
type: VirtualDomElements.Div,
|
|
1977
|
-
className,
|
|
1978
|
-
childCount: 5,
|
|
1979
|
-
paddingLeft: getTreeItemIndent(1),
|
|
1980
|
-
ariaPosInSet: posInSet,
|
|
1981
|
-
ariaSetSize: setSize,
|
|
1982
|
-
ariaLevel: level,
|
|
1983
2472
|
ariaExpanded: !isCollapsed,
|
|
2473
|
+
ariaLevel: level,
|
|
2474
|
+
ariaPosInSet: posInSet,
|
|
1984
2475
|
ariaSelected: isActive,
|
|
1985
|
-
|
|
2476
|
+
ariaSetSize: setSize,
|
|
2477
|
+
childCount: 5,
|
|
2478
|
+
className,
|
|
2479
|
+
paddingLeft: getTreeItemIndent(1),
|
|
2480
|
+
role: TreeItem,
|
|
2481
|
+
type: Div
|
|
1986
2482
|
}, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), text(fileName), {
|
|
1987
|
-
|
|
2483
|
+
childCount: 1,
|
|
1988
2484
|
className: LabelDetail,
|
|
1989
|
-
|
|
2485
|
+
type: Div
|
|
1990
2486
|
}, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
|
|
1991
2487
|
}
|
|
1992
2488
|
const lineColumn = atLineColumn(rowIndex, columnIndex);
|
|
1993
2489
|
const label = {
|
|
1994
|
-
|
|
2490
|
+
childCount: 1,
|
|
1995
2491
|
className: Label,
|
|
1996
|
-
|
|
2492
|
+
type: Div
|
|
1997
2493
|
};
|
|
1998
2494
|
/**
|
|
1999
2495
|
* @type {any}
|
|
2000
2496
|
*/
|
|
2001
2497
|
const dom = [{
|
|
2002
|
-
type: VirtualDomElements.Div,
|
|
2003
|
-
className,
|
|
2004
|
-
childCount: 3,
|
|
2005
|
-
paddingLeft: getTreeItemIndent(2),
|
|
2006
|
-
ariaPosInSet: posInSet,
|
|
2007
|
-
ariaSetSize: setSize,
|
|
2008
2498
|
ariaLevel: level,
|
|
2499
|
+
ariaPosInSet: posInSet,
|
|
2009
2500
|
ariaSelected: isActive,
|
|
2010
|
-
|
|
2501
|
+
ariaSetSize: setSize,
|
|
2502
|
+
childCount: 3,
|
|
2503
|
+
className,
|
|
2504
|
+
paddingLeft: getTreeItemIndent(2),
|
|
2505
|
+
role: TreeItem,
|
|
2506
|
+
type: Div
|
|
2011
2507
|
}, getProblemsIconVirtualDom(type), label];
|
|
2012
2508
|
if (filterValueLength) {
|
|
2013
2509
|
const before = message.slice(0, messageMatchIndex);
|
|
@@ -2015,37 +2511,38 @@ const getProblemVirtualDom = problem => {
|
|
|
2015
2511
|
const after = message.slice(messageMatchIndex + filterValueLength);
|
|
2016
2512
|
label.childCount += 2;
|
|
2017
2513
|
dom.push(text(before), {
|
|
2018
|
-
|
|
2514
|
+
childCount: 1,
|
|
2019
2515
|
className: Highlight,
|
|
2020
|
-
|
|
2516
|
+
type: Div
|
|
2021
2517
|
}, text(middle), text(after));
|
|
2022
2518
|
} else {
|
|
2023
2519
|
dom.push(text(message));
|
|
2024
2520
|
}
|
|
2025
2521
|
dom.push({
|
|
2026
|
-
|
|
2522
|
+
childCount: 2,
|
|
2027
2523
|
className: ProblemAt,
|
|
2028
|
-
|
|
2524
|
+
type: Span
|
|
2029
2525
|
}, text(getProblemSourceDetail(source, code)), text(lineColumn));
|
|
2030
2526
|
return dom;
|
|
2031
2527
|
};
|
|
2032
2528
|
|
|
2033
2529
|
const getProblemsListVirtualDom = problems => {
|
|
2034
2530
|
const dom = [{
|
|
2035
|
-
|
|
2036
|
-
|
|
2531
|
+
ariaLabel: 'Problems Tree',
|
|
2532
|
+
// TODO use i18n string
|
|
2037
2533
|
childCount: problems.length,
|
|
2038
|
-
|
|
2039
|
-
|
|
2534
|
+
className: ProblemsList,
|
|
2535
|
+
role: Tree,
|
|
2536
|
+
type: Div
|
|
2040
2537
|
}, ...problems.flatMap(getProblemVirtualDom)];
|
|
2041
2538
|
return dom;
|
|
2042
2539
|
};
|
|
2043
2540
|
|
|
2044
2541
|
const getProblemsNoProblemsFoundVirtualDom = () => {
|
|
2045
2542
|
return [{
|
|
2046
|
-
|
|
2543
|
+
childCount: 1,
|
|
2047
2544
|
className: Message,
|
|
2048
|
-
|
|
2545
|
+
type: Div
|
|
2049
2546
|
}, text(noProblemsDetected())];
|
|
2050
2547
|
};
|
|
2051
2548
|
|
|
@@ -2058,11 +2555,11 @@ const getClassName = isEven => {
|
|
|
2058
2555
|
const getProblemsTableRowVirtualDom = problem => {
|
|
2059
2556
|
const {
|
|
2060
2557
|
code,
|
|
2061
|
-
source,
|
|
2062
|
-
uri,
|
|
2063
|
-
message,
|
|
2064
2558
|
isEven,
|
|
2065
|
-
|
|
2559
|
+
message,
|
|
2560
|
+
source,
|
|
2561
|
+
type,
|
|
2562
|
+
uri
|
|
2066
2563
|
} = problem;
|
|
2067
2564
|
// TODO problems are grouped by uri, depending
|
|
2068
2565
|
// on which renderer is used the data needs to look different
|
|
@@ -2070,38 +2567,38 @@ const getProblemsTableRowVirtualDom = problem => {
|
|
|
2070
2567
|
return [];
|
|
2071
2568
|
}
|
|
2072
2569
|
const dom = [{
|
|
2073
|
-
|
|
2570
|
+
childCount: 5,
|
|
2074
2571
|
className: getClassName(isEven),
|
|
2075
|
-
|
|
2572
|
+
type: Div
|
|
2076
2573
|
}, {
|
|
2077
|
-
|
|
2574
|
+
childCount: 1,
|
|
2078
2575
|
className: ProblemsTableRowItem,
|
|
2079
|
-
|
|
2576
|
+
type: Div
|
|
2080
2577
|
}, getProblemsIconVirtualDom(type), {
|
|
2081
|
-
|
|
2578
|
+
childCount: 1,
|
|
2082
2579
|
className: ProblemsTableRowItem,
|
|
2083
|
-
|
|
2580
|
+
type: Div
|
|
2084
2581
|
}, text(getProblemSourceDetail(source, code)), {
|
|
2085
|
-
|
|
2582
|
+
childCount: 1,
|
|
2086
2583
|
className: ProblemsTableRowItem,
|
|
2087
|
-
|
|
2584
|
+
type: Div
|
|
2088
2585
|
}, text(message), {
|
|
2089
|
-
|
|
2586
|
+
childCount: 1,
|
|
2090
2587
|
className: ProblemsTableRowItem,
|
|
2091
|
-
|
|
2588
|
+
type: Div
|
|
2092
2589
|
}, text(uri), {
|
|
2093
|
-
|
|
2590
|
+
childCount: 1,
|
|
2094
2591
|
className: ProblemsTableRowItem,
|
|
2095
|
-
|
|
2592
|
+
type: Div
|
|
2096
2593
|
}, text(source)];
|
|
2097
2594
|
return dom;
|
|
2098
2595
|
};
|
|
2099
2596
|
|
|
2100
2597
|
const getProblemsTableBodyVirtualDom = problems => {
|
|
2101
2598
|
const dom = [{
|
|
2102
|
-
|
|
2599
|
+
childCount: problems.length,
|
|
2103
2600
|
className: ProblemsTableBody,
|
|
2104
|
-
|
|
2601
|
+
type: Div
|
|
2105
2602
|
}, ...problems.flatMap(getProblemsTableRowVirtualDom)];
|
|
2106
2603
|
return dom;
|
|
2107
2604
|
};
|
|
@@ -2112,42 +2609,42 @@ const getProblemsTableHeaderVirtualDom = () => {
|
|
|
2112
2609
|
const textMessage = message();
|
|
2113
2610
|
const textFile = file();
|
|
2114
2611
|
const dom = [{
|
|
2115
|
-
|
|
2612
|
+
childCount: 1,
|
|
2116
2613
|
className: ProblemsTableHeader,
|
|
2117
|
-
|
|
2614
|
+
type: Div
|
|
2118
2615
|
}, {
|
|
2119
|
-
|
|
2616
|
+
childCount: 5,
|
|
2120
2617
|
className: ProblemsTableRow,
|
|
2121
|
-
|
|
2618
|
+
type: Div
|
|
2122
2619
|
}, {
|
|
2123
|
-
|
|
2620
|
+
childCount: 0,
|
|
2124
2621
|
className: ProblemsTableRowItem,
|
|
2125
|
-
|
|
2622
|
+
type: Div
|
|
2126
2623
|
}, {
|
|
2127
|
-
|
|
2624
|
+
childCount: 1,
|
|
2128
2625
|
className: ProblemsTableRowItem,
|
|
2129
|
-
|
|
2626
|
+
type: Div
|
|
2130
2627
|
}, text(textCode), {
|
|
2131
|
-
|
|
2628
|
+
childCount: 1,
|
|
2132
2629
|
className: ProblemsTableRowItem,
|
|
2133
|
-
|
|
2630
|
+
type: Div
|
|
2134
2631
|
}, text(textMessage), {
|
|
2135
|
-
|
|
2632
|
+
childCount: 1,
|
|
2136
2633
|
className: ProblemsTableRowItem,
|
|
2137
|
-
|
|
2634
|
+
type: Div
|
|
2138
2635
|
}, text(textFile), {
|
|
2139
|
-
|
|
2636
|
+
childCount: 1,
|
|
2140
2637
|
className: ProblemsTableRowItem,
|
|
2141
|
-
|
|
2638
|
+
type: Div
|
|
2142
2639
|
}, text(textSource)];
|
|
2143
2640
|
return dom;
|
|
2144
2641
|
};
|
|
2145
2642
|
|
|
2146
2643
|
const getProblemsTableVirtualDom = problems => {
|
|
2147
2644
|
const dom = [{
|
|
2148
|
-
|
|
2645
|
+
childCount: 2,
|
|
2149
2646
|
className: ProblemsTable,
|
|
2150
|
-
|
|
2647
|
+
type: Div
|
|
2151
2648
|
}, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
|
|
2152
2649
|
return dom;
|
|
2153
2650
|
};
|
|
@@ -2155,9 +2652,9 @@ const getProblemsTableVirtualDom = problems => {
|
|
|
2155
2652
|
const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
|
|
2156
2653
|
if (problems.length === 0 && message) {
|
|
2157
2654
|
return [{
|
|
2158
|
-
|
|
2655
|
+
childCount: 1,
|
|
2159
2656
|
className: Message,
|
|
2160
|
-
|
|
2657
|
+
type: Div
|
|
2161
2658
|
}, text(message)];
|
|
2162
2659
|
}
|
|
2163
2660
|
if (problems.length === 0 && filterValue) {
|
|
@@ -2176,19 +2673,19 @@ const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message
|
|
|
2176
2673
|
// TODO avoid mutation
|
|
2177
2674
|
const dom = [];
|
|
2178
2675
|
dom.push({
|
|
2179
|
-
|
|
2676
|
+
childCount: 1,
|
|
2180
2677
|
className: mergeClassNames(Viewlet, Problems),
|
|
2181
|
-
tabIndex: 0,
|
|
2182
|
-
onPointerDown: HandlePointerDown,
|
|
2183
|
-
onContextMenu: HandleContextMenu,
|
|
2184
2678
|
onBlur: HandleBlur,
|
|
2185
|
-
|
|
2679
|
+
onContextMenu: HandleContextMenu,
|
|
2680
|
+
onPointerDown: HandlePointerDown,
|
|
2681
|
+
tabIndex: 0,
|
|
2682
|
+
type: Div
|
|
2186
2683
|
});
|
|
2187
2684
|
if (isSmall) {
|
|
2188
2685
|
dom[0].childCount++;
|
|
2189
2686
|
dom.push(...getProblemsFilterVirtualDom({
|
|
2190
|
-
command: HandleFilterInput,
|
|
2191
2687
|
badgeText: '',
|
|
2688
|
+
command: HandleFilterInput,
|
|
2192
2689
|
placeholder: filter()}));
|
|
2193
2690
|
}
|
|
2194
2691
|
dom.push(...getProblemsVirtualDom$1(viewMode, problems, filterValue, message));
|
|
@@ -2226,11 +2723,11 @@ const filterProblems = (problems, collapsedUris, filterValue) => {
|
|
|
2226
2723
|
}
|
|
2227
2724
|
filtered.push({
|
|
2228
2725
|
...problem,
|
|
2229
|
-
|
|
2230
|
-
sourceMatchIndex,
|
|
2231
|
-
messageMatchIndex,
|
|
2726
|
+
isCollapsed,
|
|
2232
2727
|
listItemType: getListItemType(problem.listItemType, isCollapsed),
|
|
2233
|
-
|
|
2728
|
+
messageMatchIndex,
|
|
2729
|
+
sourceMatchIndex,
|
|
2730
|
+
uriMatchIndex
|
|
2234
2731
|
});
|
|
2235
2732
|
}
|
|
2236
2733
|
return filtered;
|
|
@@ -2258,10 +2755,10 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
|
|
|
2258
2755
|
const problem = filtered[i];
|
|
2259
2756
|
visibleItems.push({
|
|
2260
2757
|
...problem,
|
|
2261
|
-
|
|
2262
|
-
isActive: i === focusedIndex,
|
|
2758
|
+
filterValueLength,
|
|
2263
2759
|
icon: getIcon(problem.uri),
|
|
2264
|
-
|
|
2760
|
+
isActive: i === focusedIndex,
|
|
2761
|
+
isEven: i % 2 === 0
|
|
2265
2762
|
});
|
|
2266
2763
|
}
|
|
2267
2764
|
return visibleItems;
|
|
@@ -2269,14 +2766,14 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
|
|
|
2269
2766
|
|
|
2270
2767
|
const renderItems = (oldState, newState) => {
|
|
2271
2768
|
const {
|
|
2272
|
-
problems,
|
|
2273
|
-
width,
|
|
2274
|
-
smallWidthBreakPoint,
|
|
2275
2769
|
collapsedUris,
|
|
2770
|
+
filterValue,
|
|
2276
2771
|
focusedIndex,
|
|
2772
|
+
message,
|
|
2773
|
+
problems,
|
|
2774
|
+
smallWidthBreakPoint,
|
|
2277
2775
|
viewMode,
|
|
2278
|
-
|
|
2279
|
-
message
|
|
2776
|
+
width
|
|
2280
2777
|
} = newState;
|
|
2281
2778
|
const visible = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue);
|
|
2282
2779
|
const isSmall = width <= smallWidthBreakPoint;
|
|
@@ -2286,10 +2783,10 @@ const renderItems = (oldState, newState) => {
|
|
|
2286
2783
|
|
|
2287
2784
|
const getRenderer = diffType => {
|
|
2288
2785
|
switch (diffType) {
|
|
2289
|
-
case RenderItems:
|
|
2290
|
-
return renderItems;
|
|
2291
2786
|
case RenderFilterValue:
|
|
2292
2787
|
return renderFilterValue;
|
|
2788
|
+
case RenderItems:
|
|
2789
|
+
return renderItems;
|
|
2293
2790
|
default:
|
|
2294
2791
|
throw new Error('unknown renderer');
|
|
2295
2792
|
}
|
|
@@ -2306,8 +2803,8 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
2306
2803
|
|
|
2307
2804
|
const render2 = (uid, diffResult) => {
|
|
2308
2805
|
const {
|
|
2309
|
-
|
|
2310
|
-
|
|
2806
|
+
newState,
|
|
2807
|
+
oldState
|
|
2311
2808
|
} = get(uid);
|
|
2312
2809
|
set$1(uid, newState, newState);
|
|
2313
2810
|
const commands = applyRender(oldState, newState, diffResult);
|
|
@@ -2327,23 +2824,23 @@ const getActionVirtualDom = action => {
|
|
|
2327
2824
|
|
|
2328
2825
|
const getActionsVirtualDom = actions => {
|
|
2329
2826
|
return [{
|
|
2330
|
-
|
|
2827
|
+
childCount: actions.length,
|
|
2331
2828
|
className: Actions,
|
|
2332
|
-
role:
|
|
2333
|
-
|
|
2829
|
+
role: ToolBar,
|
|
2830
|
+
type: Div
|
|
2334
2831
|
}, ...actions.flatMap(getActionVirtualDom)];
|
|
2335
2832
|
};
|
|
2336
2833
|
|
|
2337
2834
|
const getActions = state => {
|
|
2338
2835
|
const {
|
|
2339
|
-
problems,
|
|
2340
|
-
width,
|
|
2341
2836
|
collapsedUris,
|
|
2342
|
-
focusedIndex,
|
|
2343
|
-
smallWidthBreakPoint,
|
|
2344
2837
|
filterValue,
|
|
2838
|
+
focusedIndex,
|
|
2345
2839
|
inputSource,
|
|
2346
|
-
|
|
2840
|
+
problems,
|
|
2841
|
+
smallWidthBreakPoint,
|
|
2842
|
+
viewMode,
|
|
2843
|
+
width
|
|
2347
2844
|
} = state;
|
|
2348
2845
|
const visibleCount = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue).length;
|
|
2349
2846
|
const problemsCount = problems.length;
|
|
@@ -2351,32 +2848,32 @@ const getActions = state => {
|
|
|
2351
2848
|
const actions = [];
|
|
2352
2849
|
if (!isSmall) {
|
|
2353
2850
|
actions.push({
|
|
2354
|
-
type: ProblemsFilter,
|
|
2355
|
-
id: 'Filter',
|
|
2356
|
-
command: HandleFilterInput,
|
|
2357
2851
|
badgeText: visibleCount === problemsCount ? '' : showingOf(visibleCount, problemsCount),
|
|
2852
|
+
command: HandleFilterInput,
|
|
2853
|
+
id: 'Filter',
|
|
2358
2854
|
placeholder: filter(),
|
|
2855
|
+
type: ProblemsFilter,
|
|
2359
2856
|
value: inputSource === Script ? filterValue : ''
|
|
2360
2857
|
});
|
|
2361
2858
|
}
|
|
2362
2859
|
if (viewMode === Table) {
|
|
2363
2860
|
actions.push({
|
|
2364
|
-
type: Button,
|
|
2365
|
-
id: viewAsList$1(),
|
|
2366
2861
|
command: 'viewAsList',
|
|
2367
|
-
icon: ListTree
|
|
2862
|
+
icon: ListTree,
|
|
2863
|
+
id: viewAsList$1(),
|
|
2864
|
+
type: Button
|
|
2368
2865
|
});
|
|
2369
2866
|
} else {
|
|
2370
2867
|
actions.push({
|
|
2371
|
-
type: Button,
|
|
2372
|
-
id: collapseAll(),
|
|
2373
2868
|
command: 'collapseAll',
|
|
2374
|
-
icon: CollapseAll
|
|
2869
|
+
icon: CollapseAll,
|
|
2870
|
+
id: collapseAll(),
|
|
2871
|
+
type: Button
|
|
2375
2872
|
}, {
|
|
2376
|
-
type: Button,
|
|
2377
|
-
id: viewAsTable$1(),
|
|
2378
2873
|
command: 'viewAsTable',
|
|
2379
|
-
icon: ListFlat
|
|
2874
|
+
icon: ListFlat,
|
|
2875
|
+
id: viewAsTable$1(),
|
|
2876
|
+
type: Button
|
|
2380
2877
|
});
|
|
2381
2878
|
}
|
|
2382
2879
|
return actions;
|
|
@@ -2421,14 +2918,14 @@ const resize = (state, dimensions) => {
|
|
|
2421
2918
|
|
|
2422
2919
|
const saveState = state => {
|
|
2423
2920
|
const {
|
|
2424
|
-
|
|
2921
|
+
collapsedUris,
|
|
2425
2922
|
filterValue,
|
|
2426
|
-
|
|
2923
|
+
viewMode
|
|
2427
2924
|
} = state;
|
|
2428
2925
|
return {
|
|
2429
|
-
|
|
2926
|
+
collapsedUris,
|
|
2430
2927
|
filterValue,
|
|
2431
|
-
|
|
2928
|
+
viewMode
|
|
2432
2929
|
};
|
|
2433
2930
|
};
|
|
2434
2931
|
|
|
@@ -2456,8 +2953,8 @@ const commandMap = {
|
|
|
2456
2953
|
'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
2457
2954
|
'Problems.handleArrowRight': wrapCommand(handleArrowRight),
|
|
2458
2955
|
'Problems.handleClickAt': wrapCommand(handleClickAt),
|
|
2459
|
-
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2460
2956
|
'Problems.handleClickButton': wrapCommand(handleClickButton),
|
|
2957
|
+
'Problems.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2461
2958
|
'Problems.handleFilterInput': wrapCommand(handleFilterInput),
|
|
2462
2959
|
'Problems.handleIconThemeChange': wrapCommand(handleIconThemeChange),
|
|
2463
2960
|
'Problems.initialize': initialize,
|