@lvce-editor/source-control-worker 2.7.0 → 2.9.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/sourceControlWorkerMain.js +59 -462
- package/package.json +1 -1
|
@@ -521,7 +521,7 @@ const create$4 = (method, params) => {
|
|
|
521
521
|
};
|
|
522
522
|
};
|
|
523
523
|
const callbacks = Object.create(null);
|
|
524
|
-
const set$
|
|
524
|
+
const set$4 = (id, fn) => {
|
|
525
525
|
callbacks[id] = fn;
|
|
526
526
|
};
|
|
527
527
|
const get$3 = id => {
|
|
@@ -540,7 +540,7 @@ const registerPromise = () => {
|
|
|
540
540
|
resolve,
|
|
541
541
|
promise
|
|
542
542
|
} = Promise.withResolvers();
|
|
543
|
-
set$
|
|
543
|
+
set$4(id, resolve);
|
|
544
544
|
return {
|
|
545
545
|
id,
|
|
546
546
|
promise
|
|
@@ -885,10 +885,10 @@ const send = (transport, method, ...params) => {
|
|
|
885
885
|
const message = create$4(method, params);
|
|
886
886
|
transport.send(message);
|
|
887
887
|
};
|
|
888
|
-
const invoke$
|
|
888
|
+
const invoke$2 = (ipc, method, ...params) => {
|
|
889
889
|
return invokeHelper(ipc, method, params, false);
|
|
890
890
|
};
|
|
891
|
-
const invokeAndTransfer$
|
|
891
|
+
const invokeAndTransfer$1 = (ipc, method, ...params) => {
|
|
892
892
|
return invokeHelper(ipc, method, params, true);
|
|
893
893
|
};
|
|
894
894
|
|
|
@@ -924,10 +924,10 @@ const createRpc = ipc => {
|
|
|
924
924
|
send(ipc, method, ...params);
|
|
925
925
|
},
|
|
926
926
|
invoke(method, ...params) {
|
|
927
|
-
return invoke$
|
|
927
|
+
return invoke$2(ipc, method, ...params);
|
|
928
928
|
},
|
|
929
929
|
invokeAndTransfer(method, ...params) {
|
|
930
|
-
return invokeAndTransfer$
|
|
930
|
+
return invokeAndTransfer$1(ipc, method, ...params);
|
|
931
931
|
},
|
|
932
932
|
async dispose() {
|
|
933
933
|
await ipc?.dispose();
|
|
@@ -1017,31 +1017,19 @@ const WebWorkerRpcClient = {
|
|
|
1017
1017
|
__proto__: null,
|
|
1018
1018
|
create: create$2
|
|
1019
1019
|
};
|
|
1020
|
-
const createMockRpc = ({
|
|
1021
|
-
commandMap
|
|
1022
|
-
}) => {
|
|
1023
|
-
const invocations = [];
|
|
1024
|
-
const invoke = (method, ...params) => {
|
|
1025
|
-
invocations.push([method, ...params]);
|
|
1026
|
-
const command = commandMap[method];
|
|
1027
|
-
if (!command) {
|
|
1028
|
-
throw new Error(`command ${method} not found`);
|
|
1029
|
-
}
|
|
1030
|
-
return command(...params);
|
|
1031
|
-
};
|
|
1032
|
-
const mockRpc = {
|
|
1033
|
-
invoke,
|
|
1034
|
-
invokeAndTransfer: invoke,
|
|
1035
|
-
invocations
|
|
1036
|
-
};
|
|
1037
|
-
return mockRpc;
|
|
1038
|
-
};
|
|
1039
1020
|
|
|
1040
1021
|
const None = 'none';
|
|
1041
1022
|
const ToolBar = 'toolbar';
|
|
1042
|
-
const Tree = 'tree';
|
|
1023
|
+
const Tree$1 = 'tree';
|
|
1043
1024
|
const TreeItem$1 = 'treeitem';
|
|
1044
1025
|
|
|
1026
|
+
const Badge = 'Badge';
|
|
1027
|
+
const SourceControlBadge = 'SourceControlBadge';
|
|
1028
|
+
|
|
1029
|
+
const Directory = 3;
|
|
1030
|
+
const DirectoryExpanded = 4;
|
|
1031
|
+
const File = 7;
|
|
1032
|
+
|
|
1045
1033
|
const Button$2 = 1;
|
|
1046
1034
|
const Div = 4;
|
|
1047
1035
|
const Span = 8;
|
|
@@ -1058,19 +1046,22 @@ const TargetName = 'event.target.name';
|
|
|
1058
1046
|
const TargetValue = 'event.target.value';
|
|
1059
1047
|
|
|
1060
1048
|
const User = 1;
|
|
1061
|
-
const Script = 2;
|
|
1062
1049
|
|
|
1063
|
-
const
|
|
1050
|
+
const SourceControl$1 = 22;
|
|
1051
|
+
|
|
1064
1052
|
const ExtensionHostWorker = 44;
|
|
1065
|
-
const RendererWorker
|
|
1053
|
+
const RendererWorker = 1;
|
|
1066
1054
|
const SourceControlWorker = 66;
|
|
1067
1055
|
|
|
1068
1056
|
const SetCss = 'Viewlet.setCss';
|
|
1069
1057
|
const SetDom2 = 'Viewlet.setDom2';
|
|
1070
1058
|
const SetValueByName = 'Viewlet.setValueByName';
|
|
1071
1059
|
|
|
1060
|
+
const List = 1;
|
|
1061
|
+
const Tree = 2;
|
|
1062
|
+
|
|
1072
1063
|
const rpcs = Object.create(null);
|
|
1073
|
-
const set$
|
|
1064
|
+
const set$3 = (id, rpc) => {
|
|
1074
1065
|
rpcs[id] = rpc;
|
|
1075
1066
|
};
|
|
1076
1067
|
const get$2 = id => {
|
|
@@ -1092,7 +1083,7 @@ const create$1 = rpcId => {
|
|
|
1092
1083
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1093
1084
|
},
|
|
1094
1085
|
set(rpc) {
|
|
1095
|
-
set$
|
|
1086
|
+
set$3(rpcId, rpc);
|
|
1096
1087
|
},
|
|
1097
1088
|
async dispose() {
|
|
1098
1089
|
const rpc = get$2(rpcId);
|
|
@@ -1102,415 +1093,28 @@ const create$1 = rpcId => {
|
|
|
1102
1093
|
};
|
|
1103
1094
|
|
|
1104
1095
|
const {
|
|
1105
|
-
invoke: invoke$
|
|
1106
|
-
|
|
1107
|
-
set: set$3,
|
|
1108
|
-
dispose: dispose$1
|
|
1109
|
-
} = create$1(ExtensionHostWorker);
|
|
1110
|
-
const executeReferenceProvider = async (id, offset) => {
|
|
1111
|
-
// @ts-ignore
|
|
1112
|
-
return invoke$3('ExtensionHostReference.executeReferenceProvider', id, offset);
|
|
1113
|
-
};
|
|
1114
|
-
const executeFileReferenceProvider = async id => {
|
|
1115
|
-
// @ts-ignore
|
|
1116
|
-
return invoke$3('ExtensionHostReference.executeFileReferenceProvider', id);
|
|
1117
|
-
};
|
|
1118
|
-
const getRuntimeStatus = async extensionId => {
|
|
1119
|
-
// @ts-ignore
|
|
1120
|
-
return invoke$3('ExtensionHost.getRuntimeStatus', extensionId);
|
|
1121
|
-
};
|
|
1122
|
-
const registerMockRpc$1 = commandMap => {
|
|
1123
|
-
const mockRpc = createMockRpc({
|
|
1124
|
-
commandMap
|
|
1125
|
-
});
|
|
1126
|
-
set$3(mockRpc);
|
|
1127
|
-
return mockRpc;
|
|
1128
|
-
};
|
|
1129
|
-
|
|
1130
|
-
const ExtensionHost = {
|
|
1131
|
-
__proto__: null,
|
|
1132
|
-
dispose: dispose$1,
|
|
1133
|
-
executeFileReferenceProvider,
|
|
1134
|
-
executeReferenceProvider,
|
|
1135
|
-
getRuntimeStatus,
|
|
1136
|
-
invoke: invoke$3,
|
|
1137
|
-
invokeAndTransfer: invokeAndTransfer$1,
|
|
1138
|
-
registerMockRpc: registerMockRpc$1,
|
|
1139
|
-
set: set$3
|
|
1140
|
-
};
|
|
1096
|
+
invoke: invoke$1,
|
|
1097
|
+
set: set$2} = create$1(ExtensionHostWorker);
|
|
1141
1098
|
|
|
1142
1099
|
const {
|
|
1143
|
-
invoke
|
|
1100
|
+
invoke,
|
|
1144
1101
|
invokeAndTransfer,
|
|
1145
|
-
set: set$
|
|
1146
|
-
dispose
|
|
1147
|
-
} = create$1(RendererWorker$1);
|
|
1148
|
-
const searchFileHtml = async uri => {
|
|
1149
|
-
return invoke$2('ExtensionHost.searchFileWithHtml', uri);
|
|
1150
|
-
};
|
|
1151
|
-
const getFilePathElectron = async file => {
|
|
1152
|
-
return invoke$2('FileSystemHandle.getFilePathElectron', file);
|
|
1153
|
-
};
|
|
1102
|
+
set: set$1} = create$1(RendererWorker);
|
|
1154
1103
|
const showContextMenu = async (x, y, id, ...args) => {
|
|
1155
|
-
return invoke
|
|
1156
|
-
};
|
|
1157
|
-
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1158
|
-
number(uid);
|
|
1159
|
-
number(menuId);
|
|
1160
|
-
number(x);
|
|
1161
|
-
number(y);
|
|
1162
|
-
// @ts-ignore
|
|
1163
|
-
await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1164
|
-
};
|
|
1165
|
-
const getElectronVersion = async () => {
|
|
1166
|
-
return invoke$2('Process.getElectronVersion');
|
|
1167
|
-
};
|
|
1168
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1169
|
-
await invoke$2('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1170
|
-
};
|
|
1171
|
-
const setColorTheme = async id => {
|
|
1172
|
-
// @ts-ignore
|
|
1173
|
-
return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1174
|
-
};
|
|
1175
|
-
const getNodeVersion = async () => {
|
|
1176
|
-
return invoke$2('Process.getNodeVersion');
|
|
1177
|
-
};
|
|
1178
|
-
const getChromeVersion = async () => {
|
|
1179
|
-
return invoke$2('Process.getChromeVersion');
|
|
1180
|
-
};
|
|
1181
|
-
const getV8Version = async () => {
|
|
1182
|
-
return invoke$2('Process.getV8Version');
|
|
1183
|
-
};
|
|
1184
|
-
const getFileHandles = async fileIds => {
|
|
1185
|
-
const files = await invoke$2('FileSystemHandle.getFileHandles', fileIds);
|
|
1186
|
-
return files;
|
|
1187
|
-
};
|
|
1188
|
-
const setWorkspacePath = async path => {
|
|
1189
|
-
await invoke$2('Workspace.setPath', path);
|
|
1190
|
-
};
|
|
1191
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1192
|
-
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1193
|
-
};
|
|
1194
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1195
|
-
await invoke$2('WebView.unregisterInterceptor', id);
|
|
1196
|
-
};
|
|
1197
|
-
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1198
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1199
|
-
// @ts-ignore
|
|
1200
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1201
|
-
};
|
|
1202
|
-
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1203
|
-
const command = 'Errors.handleMessagePort';
|
|
1204
|
-
// @ts-ignore
|
|
1205
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1206
|
-
};
|
|
1207
|
-
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1208
|
-
const command = 'Markdown.handleMessagePort';
|
|
1209
|
-
// @ts-ignore
|
|
1210
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1211
|
-
};
|
|
1212
|
-
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1213
|
-
const command = 'IconTheme.handleMessagePort';
|
|
1214
|
-
// @ts-ignore
|
|
1215
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1216
|
-
};
|
|
1217
|
-
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1218
|
-
const command = 'FileSystem.handleMessagePort';
|
|
1219
|
-
// @ts-ignore
|
|
1220
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1104
|
+
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
1221
1105
|
};
|
|
1222
1106
|
const readFile$1 = async uri => {
|
|
1223
|
-
return invoke
|
|
1224
|
-
};
|
|
1225
|
-
const getWebViewSecret = async key => {
|
|
1226
|
-
// @ts-ignore
|
|
1227
|
-
return invoke$2('WebView.getSecret', key);
|
|
1228
|
-
};
|
|
1229
|
-
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1230
|
-
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1231
|
-
};
|
|
1232
|
-
const setFocus = key => {
|
|
1233
|
-
return invoke$2('Focus.setFocus', key);
|
|
1234
|
-
};
|
|
1235
|
-
const getFileIcon$1 = async options => {
|
|
1236
|
-
return invoke$2('IconTheme.getFileIcon', options);
|
|
1237
|
-
};
|
|
1238
|
-
const getColorThemeNames = async () => {
|
|
1239
|
-
return invoke$2('ColorTheme.getColorThemeNames');
|
|
1240
|
-
};
|
|
1241
|
-
const disableExtension = async id => {
|
|
1242
|
-
// @ts-ignore
|
|
1243
|
-
return invoke$2('ExtensionManagement.disable', id);
|
|
1244
|
-
};
|
|
1245
|
-
const enableExtension = async id => {
|
|
1246
|
-
// @ts-ignore
|
|
1247
|
-
return invoke$2('ExtensionManagement.enable', id);
|
|
1248
|
-
};
|
|
1249
|
-
const handleDebugChange = async params => {
|
|
1250
|
-
// @ts-ignore
|
|
1251
|
-
return invoke$2('Run And Debug.handleChange', params);
|
|
1252
|
-
};
|
|
1253
|
-
const getFolderIcon = async options => {
|
|
1254
|
-
return invoke$2('IconTheme.getFolderIcon', options);
|
|
1255
|
-
};
|
|
1256
|
-
const closeWidget = async widgetId => {
|
|
1257
|
-
return invoke$2('Viewlet.closeWidget', widgetId);
|
|
1107
|
+
return invoke('FileSystem.readFile', uri);
|
|
1258
1108
|
};
|
|
1259
1109
|
const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
|
|
1260
1110
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1261
1111
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1262
1112
|
};
|
|
1263
|
-
const sendMessagePortToSearchProcess = async port => {
|
|
1264
|
-
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1265
|
-
};
|
|
1266
|
-
const confirm = async (message, options) => {
|
|
1267
|
-
// @ts-ignore
|
|
1268
|
-
const result = await invoke$2('ConfirmPrompt.prompt', message, options);
|
|
1269
|
-
return result;
|
|
1270
|
-
};
|
|
1271
|
-
const getRecentlyOpened = async () => {
|
|
1272
|
-
return invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1273
|
-
};
|
|
1274
|
-
const getKeyBindings = async () => {
|
|
1275
|
-
return invoke$2('KeyBindingsInitial.getKeyBindings');
|
|
1276
|
-
};
|
|
1277
|
-
const writeClipBoardText = async text => {
|
|
1278
|
-
await invoke$2('ClipBoard.writeText', /* text */text);
|
|
1279
|
-
};
|
|
1280
|
-
const readClipBoardText = async () => {
|
|
1281
|
-
return invoke$2('ClipBoard.readText');
|
|
1282
|
-
};
|
|
1283
|
-
const writeClipBoardImage = async blob => {
|
|
1284
|
-
// @ts-ignore
|
|
1285
|
-
await invoke$2('ClipBoard.writeImage', /* text */blob);
|
|
1286
|
-
};
|
|
1287
|
-
const searchFileMemory = async uri => {
|
|
1288
|
-
// @ts-ignore
|
|
1289
|
-
return invoke$2('ExtensionHost.searchFileWithMemory', uri);
|
|
1290
|
-
};
|
|
1291
|
-
const searchFileFetch = async uri => {
|
|
1292
|
-
return invoke$2('ExtensionHost.searchFileWithFetch', uri);
|
|
1293
|
-
};
|
|
1294
|
-
const showMessageBox = async options => {
|
|
1295
|
-
return invoke$2('ElectronDialog.showMessageBox', options);
|
|
1296
|
-
};
|
|
1297
|
-
const handleDebugResumed = async params => {
|
|
1298
|
-
await invoke$2('Run And Debug.handleResumed', params);
|
|
1299
|
-
};
|
|
1300
|
-
const openWidget = async name => {
|
|
1301
|
-
await invoke$2('Viewlet.openWidget', name);
|
|
1302
|
-
};
|
|
1303
|
-
const getIcons = async requests => {
|
|
1304
|
-
const icons = await invoke$2('IconTheme.getIcons', requests);
|
|
1305
|
-
return icons;
|
|
1306
|
-
};
|
|
1307
1113
|
const activateByEvent$1 = event => {
|
|
1308
|
-
return invoke
|
|
1309
|
-
};
|
|
1310
|
-
const setAdditionalFocus = focusKey => {
|
|
1311
|
-
// @ts-ignore
|
|
1312
|
-
return invoke$2('Focus.setAdditionalFocus', focusKey);
|
|
1313
|
-
};
|
|
1314
|
-
const getActiveEditorId = () => {
|
|
1315
|
-
// @ts-ignore
|
|
1316
|
-
return invoke$2('GetActiveEditor.getActiveEditorId');
|
|
1317
|
-
};
|
|
1318
|
-
const getWorkspacePath = () => {
|
|
1319
|
-
return invoke$2('Workspace.getPath');
|
|
1320
|
-
};
|
|
1321
|
-
const sendMessagePortToRendererProcess = async port => {
|
|
1322
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1323
|
-
// @ts-ignore
|
|
1324
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1325
|
-
};
|
|
1326
|
-
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1327
|
-
const command = 'TextMeasurement.handleMessagePort';
|
|
1328
|
-
// @ts-ignore
|
|
1329
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1330
|
-
};
|
|
1331
|
-
const getPreference = async key => {
|
|
1332
|
-
return await invoke$2('Preferences.get', key);
|
|
1333
|
-
};
|
|
1334
|
-
const getAllExtensions = async () => {
|
|
1335
|
-
return invoke$2('ExtensionManagement.getAllExtensions');
|
|
1336
|
-
};
|
|
1337
|
-
const rerenderEditor = async key => {
|
|
1338
|
-
// @ts-ignore
|
|
1339
|
-
return invoke$2('Editor.rerender', key);
|
|
1340
|
-
};
|
|
1341
|
-
const handleDebugPaused = async params => {
|
|
1342
|
-
await invoke$2('Run And Debug.handlePaused', params);
|
|
1114
|
+
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
1343
1115
|
};
|
|
1344
1116
|
const openUri$1 = async (uri, focus, options) => {
|
|
1345
|
-
await invoke
|
|
1346
|
-
};
|
|
1347
|
-
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1348
|
-
await invokeAndTransfer(
|
|
1349
|
-
// @ts-ignore
|
|
1350
|
-
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1351
|
-
};
|
|
1352
|
-
const handleDebugScriptParsed = async script => {
|
|
1353
|
-
await invoke$2('Run And Debug.handleScriptParsed', script);
|
|
1354
|
-
};
|
|
1355
|
-
const getWindowId = async () => {
|
|
1356
|
-
return invoke$2('GetWindowId.getWindowId');
|
|
1357
|
-
};
|
|
1358
|
-
const getBlob = async uri => {
|
|
1359
|
-
// @ts-ignore
|
|
1360
|
-
return invoke$2('FileSystem.getBlob', uri);
|
|
1361
|
-
};
|
|
1362
|
-
const getExtensionCommands = async () => {
|
|
1363
|
-
return invoke$2('ExtensionHost.getCommands');
|
|
1364
|
-
};
|
|
1365
|
-
const showErrorDialog = async errorInfo => {
|
|
1366
|
-
// @ts-ignore
|
|
1367
|
-
await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
|
|
1368
|
-
};
|
|
1369
|
-
const getFolderSize = async uri => {
|
|
1370
|
-
// @ts-ignore
|
|
1371
|
-
return await invoke$2('FileSystem.getFolderSize', uri);
|
|
1372
|
-
};
|
|
1373
|
-
const getExtension = async id => {
|
|
1374
|
-
// @ts-ignore
|
|
1375
|
-
return invoke$2('ExtensionManagement.getExtension', id);
|
|
1376
|
-
};
|
|
1377
|
-
const getMarkdownDom = async html => {
|
|
1378
|
-
// @ts-ignore
|
|
1379
|
-
return invoke$2('Markdown.getVirtualDom', html);
|
|
1380
|
-
};
|
|
1381
|
-
const renderMarkdown = async (markdown, options) => {
|
|
1382
|
-
// @ts-ignore
|
|
1383
|
-
return invoke$2('Markdown.renderMarkdown', markdown, options);
|
|
1384
|
-
};
|
|
1385
|
-
const openNativeFolder = async uri => {
|
|
1386
|
-
// @ts-ignore
|
|
1387
|
-
await invoke$2('OpenNativeFolder.openNativeFolder', uri);
|
|
1388
|
-
};
|
|
1389
|
-
const uninstallExtension = async id => {
|
|
1390
|
-
return invoke$2('ExtensionManagement.uninstall', id);
|
|
1391
|
-
};
|
|
1392
|
-
const installExtension = async id => {
|
|
1393
|
-
// @ts-ignore
|
|
1394
|
-
return invoke$2('ExtensionManagement.install', id);
|
|
1395
|
-
};
|
|
1396
|
-
const openExtensionSearch = async () => {
|
|
1397
|
-
// @ts-ignore
|
|
1398
|
-
return invoke$2('SideBar.openViewlet', 'Extensions');
|
|
1399
|
-
};
|
|
1400
|
-
const setExtensionsSearchValue = async searchValue => {
|
|
1401
|
-
// @ts-ignore
|
|
1402
|
-
return invoke$2('Extensions.handleInput', searchValue, Script);
|
|
1403
|
-
};
|
|
1404
|
-
const openExternal = async uri => {
|
|
1405
|
-
// @ts-ignore
|
|
1406
|
-
await invoke$2('Open.openExternal', uri);
|
|
1407
|
-
};
|
|
1408
|
-
const openUrl = async uri => {
|
|
1409
|
-
// @ts-ignore
|
|
1410
|
-
await invoke$2('Open.openUrl', uri);
|
|
1411
|
-
};
|
|
1412
|
-
const getAllPreferences = async () => {
|
|
1413
|
-
// @ts-ignore
|
|
1414
|
-
return invoke$2('Preferences.getAll');
|
|
1415
|
-
};
|
|
1416
|
-
const showSaveFilePicker = async () => {
|
|
1417
|
-
// @ts-ignore
|
|
1418
|
-
return invoke$2('FilePicker.showSaveFilePicker');
|
|
1419
|
-
};
|
|
1420
|
-
const getLogsDir = async () => {
|
|
1421
|
-
// @ts-ignore
|
|
1422
|
-
return invoke$2('PlatformPaths.getLogsDir');
|
|
1423
|
-
};
|
|
1424
|
-
const registerMockRpc = commandMap => {
|
|
1425
|
-
const mockRpc = createMockRpc({
|
|
1426
|
-
commandMap
|
|
1427
|
-
});
|
|
1428
|
-
set$2(mockRpc);
|
|
1429
|
-
return mockRpc;
|
|
1430
|
-
};
|
|
1431
|
-
|
|
1432
|
-
const RendererWorker = {
|
|
1433
|
-
__proto__: null,
|
|
1434
|
-
activateByEvent: activateByEvent$1,
|
|
1435
|
-
applyBulkReplacement,
|
|
1436
|
-
closeWidget,
|
|
1437
|
-
confirm,
|
|
1438
|
-
disableExtension,
|
|
1439
|
-
dispose,
|
|
1440
|
-
enableExtension,
|
|
1441
|
-
getActiveEditorId,
|
|
1442
|
-
getAllExtensions,
|
|
1443
|
-
getAllPreferences,
|
|
1444
|
-
getBlob,
|
|
1445
|
-
getChromeVersion,
|
|
1446
|
-
getColorThemeNames,
|
|
1447
|
-
getElectronVersion,
|
|
1448
|
-
getExtension,
|
|
1449
|
-
getExtensionCommands,
|
|
1450
|
-
getFileHandles,
|
|
1451
|
-
getFileIcon: getFileIcon$1,
|
|
1452
|
-
getFilePathElectron,
|
|
1453
|
-
getFolderIcon,
|
|
1454
|
-
getFolderSize,
|
|
1455
|
-
getIcons,
|
|
1456
|
-
getKeyBindings,
|
|
1457
|
-
getLogsDir,
|
|
1458
|
-
getMarkdownDom,
|
|
1459
|
-
getNodeVersion,
|
|
1460
|
-
getPreference,
|
|
1461
|
-
getRecentlyOpened,
|
|
1462
|
-
getV8Version,
|
|
1463
|
-
getWebViewSecret,
|
|
1464
|
-
getWindowId,
|
|
1465
|
-
getWorkspacePath,
|
|
1466
|
-
handleDebugChange,
|
|
1467
|
-
handleDebugPaused,
|
|
1468
|
-
handleDebugResumed,
|
|
1469
|
-
handleDebugScriptParsed,
|
|
1470
|
-
installExtension,
|
|
1471
|
-
invoke: invoke$2,
|
|
1472
|
-
invokeAndTransfer,
|
|
1473
|
-
openExtensionSearch,
|
|
1474
|
-
openExternal,
|
|
1475
|
-
openNativeFolder,
|
|
1476
|
-
openUri: openUri$1,
|
|
1477
|
-
openUrl,
|
|
1478
|
-
openWidget,
|
|
1479
|
-
readClipBoardText,
|
|
1480
|
-
readFile: readFile$1,
|
|
1481
|
-
registerMockRpc,
|
|
1482
|
-
registerWebViewInterceptor,
|
|
1483
|
-
renderMarkdown,
|
|
1484
|
-
rerenderEditor,
|
|
1485
|
-
searchFileFetch,
|
|
1486
|
-
searchFileHtml,
|
|
1487
|
-
searchFileMemory,
|
|
1488
|
-
sendMessagePortToEditorWorker,
|
|
1489
|
-
sendMessagePortToErrorWorker,
|
|
1490
|
-
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1491
|
-
sendMessagePortToFileSystemWorker,
|
|
1492
|
-
sendMessagePortToIconThemeWorker,
|
|
1493
|
-
sendMessagePortToMarkdownWorker,
|
|
1494
|
-
sendMessagePortToRendererProcess,
|
|
1495
|
-
sendMessagePortToSearchProcess,
|
|
1496
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
1497
|
-
sendMessagePortToTextMeasurementWorker,
|
|
1498
|
-
set: set$2,
|
|
1499
|
-
setAdditionalFocus,
|
|
1500
|
-
setColorTheme,
|
|
1501
|
-
setExtensionsSearchValue,
|
|
1502
|
-
setFocus,
|
|
1503
|
-
setWebViewPort,
|
|
1504
|
-
setWorkspacePath,
|
|
1505
|
-
showContextMenu,
|
|
1506
|
-
showContextMenu2,
|
|
1507
|
-
showErrorDialog,
|
|
1508
|
-
showMessageBox,
|
|
1509
|
-
showSaveFilePicker,
|
|
1510
|
-
uninstallExtension,
|
|
1511
|
-
unregisterWebViewInterceptor,
|
|
1512
|
-
writeClipBoardImage,
|
|
1513
|
-
writeClipBoardText
|
|
1117
|
+
await invoke('Main.openUri', uri, focus, options);
|
|
1514
1118
|
};
|
|
1515
1119
|
|
|
1516
1120
|
const toCommandId = key => {
|
|
@@ -1600,7 +1204,7 @@ const terminate = () => {
|
|
|
1600
1204
|
|
|
1601
1205
|
const {
|
|
1602
1206
|
get: get$1,
|
|
1603
|
-
set
|
|
1207
|
+
set,
|
|
1604
1208
|
wrapCommand,
|
|
1605
1209
|
getCommandIds,
|
|
1606
1210
|
registerCommands,
|
|
@@ -1657,21 +1261,21 @@ const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
|
1657
1261
|
iconDefinitions: [],
|
|
1658
1262
|
decorationIcons: []
|
|
1659
1263
|
};
|
|
1660
|
-
set
|
|
1264
|
+
set(id, state, state);
|
|
1661
1265
|
};
|
|
1662
1266
|
|
|
1663
1267
|
const isEqual$2 = (oldState, newState) => {
|
|
1664
1268
|
return oldState.inputBoxHeight === newState.inputBoxHeight;
|
|
1665
1269
|
};
|
|
1666
1270
|
|
|
1271
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1272
|
+
return oldState.allGroups === newState.allGroups && oldState.deltaY === newState.deltaY && oldState.items === newState.items && oldState.maxLineY === newState.maxLineY && oldState.minLineY === newState.minLineY && oldState.visibleItems === newState.visibleItems;
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1667
1275
|
const RenderItems = 4;
|
|
1668
1276
|
const RenderValue = 8;
|
|
1669
1277
|
const RenderCss = 10;
|
|
1670
1278
|
|
|
1671
|
-
const isEqual$1 = (oldState, newState) => {
|
|
1672
|
-
return oldState.allGroups === newState.allGroups && oldState.visibleItems === newState.visibleItems && oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.deltaY === newState.deltaY;
|
|
1673
|
-
};
|
|
1674
|
-
|
|
1675
1279
|
const isEqual = (oldState, newState) => {
|
|
1676
1280
|
return newState.inputSource === User || oldState.inputValue === newState.inputValue;
|
|
1677
1281
|
};
|
|
@@ -1710,10 +1314,6 @@ const activateByEvent = event => {
|
|
|
1710
1314
|
return activateByEvent$1(event);
|
|
1711
1315
|
};
|
|
1712
1316
|
|
|
1713
|
-
const {
|
|
1714
|
-
invoke: invoke$1,
|
|
1715
|
-
set} = ExtensionHost;
|
|
1716
|
-
|
|
1717
1317
|
const executeProvider = async ({
|
|
1718
1318
|
event,
|
|
1719
1319
|
method,
|
|
@@ -1726,7 +1326,7 @@ const executeProvider = async ({
|
|
|
1726
1326
|
};
|
|
1727
1327
|
|
|
1728
1328
|
const CommandExecute = 'ExtensionHostCommand.executeCommand';
|
|
1729
|
-
const SourceControlGetFileDecorations = '
|
|
1329
|
+
const SourceControlGetFileDecorations = 'ExtensionHostSourceControl.getFileDecorations';
|
|
1730
1330
|
const SourceControlGetEnabledProviderIds = 'ExtensionHostSourceControl.getEnabledProviderIds';
|
|
1731
1331
|
const SourceControlGetFileBefore = 'ExtensionHostSourceControl.getFileBefore';
|
|
1732
1332
|
const SourceControlGetGroups = 'ExtensionHostSourceControl.getGroups';
|
|
@@ -1739,10 +1339,6 @@ const executeCommand = (id, ...args) => {
|
|
|
1739
1339
|
});
|
|
1740
1340
|
};
|
|
1741
1341
|
|
|
1742
|
-
const Directory = 3;
|
|
1743
|
-
const DirectoryExpanded = 4;
|
|
1744
|
-
const File = 7;
|
|
1745
|
-
|
|
1746
1342
|
const getActualDecorationIcon = (iconDefinitions, icon) => {
|
|
1747
1343
|
if (typeof icon === 'number') {
|
|
1748
1344
|
const value = iconDefinitions[icon];
|
|
@@ -1846,6 +1442,7 @@ const getIconType = direntType => {
|
|
|
1846
1442
|
return 1;
|
|
1847
1443
|
}
|
|
1848
1444
|
};
|
|
1445
|
+
|
|
1849
1446
|
const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
1850
1447
|
const missingRequests = [];
|
|
1851
1448
|
for (const dirent of dirents) {
|
|
@@ -1859,9 +1456,6 @@ const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
|
1859
1456
|
return missingRequests;
|
|
1860
1457
|
};
|
|
1861
1458
|
|
|
1862
|
-
const {
|
|
1863
|
-
invoke} = RendererWorker;
|
|
1864
|
-
|
|
1865
1459
|
const requestFileIcons = async requests => {
|
|
1866
1460
|
const results = await invoke('IconTheme.getIcons', requests);
|
|
1867
1461
|
return results;
|
|
@@ -1976,7 +1570,7 @@ const getTextHeight = async (input, width, fontFamily, fontSize, fontWeight, let
|
|
|
1976
1570
|
// TODO line height could also be like 1.5
|
|
1977
1571
|
const lineHeightPx = `${lineHeight}px`;
|
|
1978
1572
|
// @ts-ignore
|
|
1979
|
-
const height = await invoke
|
|
1573
|
+
const height = await invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1980
1574
|
return height;
|
|
1981
1575
|
} catch {
|
|
1982
1576
|
// fallback
|
|
@@ -2354,6 +1948,8 @@ const handleClickFile = async (state, item) => {
|
|
|
2354
1948
|
const absolutePath = `${root}/${item.file}`;
|
|
2355
1949
|
// TODO handle error
|
|
2356
1950
|
const [fileBefore] = await Promise.all([getFileBefore(providerId, item.file), readFile(absolutePath)]);
|
|
1951
|
+
|
|
1952
|
+
// TODO diff editor should determine width by itself
|
|
2357
1953
|
await openDiffEditor(fileBefore, absolutePath);
|
|
2358
1954
|
return state;
|
|
2359
1955
|
};
|
|
@@ -2391,8 +1987,6 @@ const show = async (x, y, id, ...args) => {
|
|
|
2391
1987
|
return showContextMenu(x, y, id, ...args);
|
|
2392
1988
|
};
|
|
2393
1989
|
|
|
2394
|
-
const SourceControl$1 = 22;
|
|
2395
|
-
|
|
2396
1990
|
const handleContextMenu = async (state, button, x, y) => {
|
|
2397
1991
|
await show(x, y, SourceControl$1);
|
|
2398
1992
|
return state;
|
|
@@ -2509,7 +2103,7 @@ const createExtensionHostRpc = async () => {
|
|
|
2509
2103
|
|
|
2510
2104
|
const initialize = async () => {
|
|
2511
2105
|
const extensionHostRpc = await createExtensionHostRpc();
|
|
2512
|
-
set(extensionHostRpc);
|
|
2106
|
+
set$2(extensionHostRpc);
|
|
2513
2107
|
};
|
|
2514
2108
|
|
|
2515
2109
|
const renderCss = (oldState, newState) => {
|
|
@@ -2550,7 +2144,6 @@ const LabelDetail = 'LabelDetail';
|
|
|
2550
2144
|
const MaskIcon = 'MaskIcon';
|
|
2551
2145
|
const MaskIconChevronDown = 'MaskIconChevronDown';
|
|
2552
2146
|
const SourceControl = 'SourceControl';
|
|
2553
|
-
const SourceControlBadge = 'SourceControlBadge';
|
|
2554
2147
|
const SourceControlButton = 'SourceControlButton';
|
|
2555
2148
|
const SourceControlHeader = 'SourceControlHeader';
|
|
2556
2149
|
const SourceControlItems = 'SourceControlItems';
|
|
@@ -2600,12 +2193,14 @@ const getSourceControlHeaderVirtualDom = inputPlaceholder => {
|
|
|
2600
2193
|
}, ...getSourceControlInputDom(inputPlaceholder)];
|
|
2601
2194
|
};
|
|
2602
2195
|
|
|
2603
|
-
const
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2196
|
+
const className$1 = mergeClassNames(Badge, SourceControlBadge);
|
|
2197
|
+
const parentNode = {
|
|
2198
|
+
type: Div,
|
|
2199
|
+
className: className$1,
|
|
2200
|
+
childCount: 1
|
|
2201
|
+
};
|
|
2202
|
+
const getBadgeVirtualDom = count => {
|
|
2203
|
+
return [parentNode, text(`${count}`)];
|
|
2609
2204
|
};
|
|
2610
2205
|
|
|
2611
2206
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
@@ -2688,7 +2283,7 @@ const createItemDirectory = item => {
|
|
|
2688
2283
|
type: Div,
|
|
2689
2284
|
className: labelClassName,
|
|
2690
2285
|
childCount: 1
|
|
2691
|
-
}, text(label), ...buttonsDom, ...getBadgeVirtualDom(
|
|
2286
|
+
}, text(label), ...buttonsDom, ...getBadgeVirtualDom(badgeCount)];
|
|
2692
2287
|
};
|
|
2693
2288
|
|
|
2694
2289
|
const getFileIconVirtualDom = icon => {
|
|
@@ -2780,7 +2375,7 @@ const getSourceControlListVirtualDom = items => {
|
|
|
2780
2375
|
return [{
|
|
2781
2376
|
type: Div,
|
|
2782
2377
|
className: SourceControlItems,
|
|
2783
|
-
role: Tree,
|
|
2378
|
+
role: Tree$1,
|
|
2784
2379
|
childCount: items.length,
|
|
2785
2380
|
onClick: HandleClickAt,
|
|
2786
2381
|
onPointerOver: HandleMouseOverAt,
|
|
@@ -2882,7 +2477,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2882
2477
|
oldState,
|
|
2883
2478
|
newState
|
|
2884
2479
|
} = get$1(uid);
|
|
2885
|
-
set
|
|
2480
|
+
set(uid, newState, newState);
|
|
2886
2481
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2887
2482
|
return commands;
|
|
2888
2483
|
};
|
|
@@ -2900,6 +2495,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2900
2495
|
className: IconButton,
|
|
2901
2496
|
title: id,
|
|
2902
2497
|
'data-command': command,
|
|
2498
|
+
// TODO remove this
|
|
2903
2499
|
childCount: 1
|
|
2904
2500
|
}, getIconVirtualDom(icon)];
|
|
2905
2501
|
};
|
|
@@ -3002,23 +2598,23 @@ const updateIcons = async state => {
|
|
|
3002
2598
|
const viewAsList = state => {
|
|
3003
2599
|
return {
|
|
3004
2600
|
...state,
|
|
3005
|
-
viewMode:
|
|
2601
|
+
viewMode: List
|
|
3006
2602
|
};
|
|
3007
2603
|
};
|
|
3008
2604
|
|
|
3009
2605
|
const viewAsTree = state => {
|
|
3010
2606
|
return {
|
|
3011
2607
|
...state,
|
|
3012
|
-
viewMode:
|
|
2608
|
+
viewMode: Tree
|
|
3013
2609
|
};
|
|
3014
2610
|
};
|
|
3015
2611
|
|
|
3016
2612
|
const commandMap = {
|
|
3017
2613
|
'Initialize.initialize': initialize,
|
|
3018
2614
|
'SourceControl.create2': create2,
|
|
3019
|
-
'SourceControl.handleMessagePort': handleMessagePort,
|
|
3020
2615
|
'SourceControl.diff2': diff2,
|
|
3021
2616
|
'SourceControl.getCommandIds': getCommandIds,
|
|
2617
|
+
'SourceControl.getEnabledProviderIds': getEnabledProviderIds,
|
|
3022
2618
|
'SourceControl.getFileDecorations': getFileDecorations,
|
|
3023
2619
|
'SourceControl.getInfo': getInfo,
|
|
3024
2620
|
'SourceControl.handleButtonClick': wrapCommand(handleButtonClick),
|
|
@@ -3027,6 +2623,7 @@ const commandMap = {
|
|
|
3027
2623
|
'SourceControl.handleContextMenu': wrapCommand(handleContextMenu),
|
|
3028
2624
|
'SourceControl.handleFocus': wrapCommand(handleFocus),
|
|
3029
2625
|
'SourceControl.handleInput': wrapCommand(handleInput),
|
|
2626
|
+
'SourceControl.handleMessagePort': handleMessagePort,
|
|
3030
2627
|
'SourceControl.handleMouseOut': wrapCommand(handleMouseOut),
|
|
3031
2628
|
'SourceControl.handleMouseOutAt': wrapCommand(handleMouseOutAt),
|
|
3032
2629
|
'SourceControl.handleMouseOver': wrapCommand(handleMouseOver),
|
|
@@ -3052,7 +2649,7 @@ const listen = async () => {
|
|
|
3052
2649
|
const rpc = await WebWorkerRpcClient.create({
|
|
3053
2650
|
commandMap: commandMap
|
|
3054
2651
|
});
|
|
3055
|
-
set$
|
|
2652
|
+
set$1(rpc);
|
|
3056
2653
|
};
|
|
3057
2654
|
|
|
3058
2655
|
const main = async () => {
|