@lvce-editor/source-control-worker 2.8.0 → 2.10.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 +62 -461
- 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,31 @@ 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);
|
|
1114
|
+
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
1330
1115
|
};
|
|
1331
1116
|
const getPreference = async key => {
|
|
1332
|
-
return await invoke
|
|
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);
|
|
1117
|
+
return await invoke('Preferences.get', key);
|
|
1343
1118
|
};
|
|
1344
1119
|
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
|
|
1120
|
+
await invoke('Main.openUri', uri, focus, options);
|
|
1514
1121
|
};
|
|
1515
1122
|
|
|
1516
1123
|
const toCommandId = key => {
|
|
@@ -1600,7 +1207,7 @@ const terminate = () => {
|
|
|
1600
1207
|
|
|
1601
1208
|
const {
|
|
1602
1209
|
get: get$1,
|
|
1603
|
-
set
|
|
1210
|
+
set,
|
|
1604
1211
|
wrapCommand,
|
|
1605
1212
|
getCommandIds,
|
|
1606
1213
|
registerCommands,
|
|
@@ -1657,21 +1264,21 @@ const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
|
1657
1264
|
iconDefinitions: [],
|
|
1658
1265
|
decorationIcons: []
|
|
1659
1266
|
};
|
|
1660
|
-
set
|
|
1267
|
+
set(id, state, state);
|
|
1661
1268
|
};
|
|
1662
1269
|
|
|
1663
1270
|
const isEqual$2 = (oldState, newState) => {
|
|
1664
1271
|
return oldState.inputBoxHeight === newState.inputBoxHeight;
|
|
1665
1272
|
};
|
|
1666
1273
|
|
|
1274
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1275
|
+
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;
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1667
1278
|
const RenderItems = 4;
|
|
1668
1279
|
const RenderValue = 8;
|
|
1669
1280
|
const RenderCss = 10;
|
|
1670
1281
|
|
|
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
1282
|
const isEqual = (oldState, newState) => {
|
|
1676
1283
|
return newState.inputSource === User || oldState.inputValue === newState.inputValue;
|
|
1677
1284
|
};
|
|
@@ -1710,10 +1317,6 @@ const activateByEvent = event => {
|
|
|
1710
1317
|
return activateByEvent$1(event);
|
|
1711
1318
|
};
|
|
1712
1319
|
|
|
1713
|
-
const {
|
|
1714
|
-
invoke: invoke$1,
|
|
1715
|
-
set} = ExtensionHost;
|
|
1716
|
-
|
|
1717
1320
|
const executeProvider = async ({
|
|
1718
1321
|
event,
|
|
1719
1322
|
method,
|
|
@@ -1739,10 +1342,6 @@ const executeCommand = (id, ...args) => {
|
|
|
1739
1342
|
});
|
|
1740
1343
|
};
|
|
1741
1344
|
|
|
1742
|
-
const Directory = 3;
|
|
1743
|
-
const DirectoryExpanded = 4;
|
|
1744
|
-
const File = 7;
|
|
1745
|
-
|
|
1746
1345
|
const getActualDecorationIcon = (iconDefinitions, icon) => {
|
|
1747
1346
|
if (typeof icon === 'number') {
|
|
1748
1347
|
const value = iconDefinitions[icon];
|
|
@@ -1846,6 +1445,7 @@ const getIconType = direntType => {
|
|
|
1846
1445
|
return 1;
|
|
1847
1446
|
}
|
|
1848
1447
|
};
|
|
1448
|
+
|
|
1849
1449
|
const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
1850
1450
|
const missingRequests = [];
|
|
1851
1451
|
for (const dirent of dirents) {
|
|
@@ -1859,9 +1459,6 @@ const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
|
1859
1459
|
return missingRequests;
|
|
1860
1460
|
};
|
|
1861
1461
|
|
|
1862
|
-
const {
|
|
1863
|
-
invoke} = RendererWorker;
|
|
1864
|
-
|
|
1865
1462
|
const requestFileIcons = async requests => {
|
|
1866
1463
|
const results = await invoke('IconTheme.getIcons', requests);
|
|
1867
1464
|
return results;
|
|
@@ -1976,7 +1573,7 @@ const getTextHeight = async (input, width, fontFamily, fontSize, fontWeight, let
|
|
|
1976
1573
|
// TODO line height could also be like 1.5
|
|
1977
1574
|
const lineHeightPx = `${lineHeight}px`;
|
|
1978
1575
|
// @ts-ignore
|
|
1979
|
-
const height = await invoke
|
|
1576
|
+
const height = await invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1980
1577
|
return height;
|
|
1981
1578
|
} catch {
|
|
1982
1579
|
// fallback
|
|
@@ -2050,7 +1647,7 @@ const getVisibleSourceControlItems = (items, minLineY, maxLineY, actionsCache, f
|
|
|
2050
1647
|
};
|
|
2051
1648
|
|
|
2052
1649
|
const get = key => {
|
|
2053
|
-
return
|
|
1650
|
+
return getPreference(key);
|
|
2054
1651
|
};
|
|
2055
1652
|
|
|
2056
1653
|
const getExtensions = async () => {
|
|
@@ -2152,7 +1749,7 @@ const loadContent = async (state, savedState) => {
|
|
|
2152
1749
|
const actionsCache = await requestSourceActions();
|
|
2153
1750
|
|
|
2154
1751
|
// TODO make preferences async and more functional
|
|
2155
|
-
const splitButtonEnabled = get();
|
|
1752
|
+
const splitButtonEnabled = await get('sourceControl.splitButtonEnabled');
|
|
2156
1753
|
const total = displayItems.length;
|
|
2157
1754
|
const contentHeight = total * itemHeight;
|
|
2158
1755
|
const listHeight = getListHeight(total, itemHeight, height);
|
|
@@ -2274,7 +1871,9 @@ const handleClickSourceControlButtons = async (state, index, name) => {
|
|
|
2274
1871
|
warn(`[source-control-worker] Button not found ${name}`);
|
|
2275
1872
|
return state;
|
|
2276
1873
|
}
|
|
2277
|
-
const
|
|
1874
|
+
const {
|
|
1875
|
+
file
|
|
1876
|
+
} = item;
|
|
2278
1877
|
await executeCommand(button.command, file);
|
|
2279
1878
|
const newState = await refresh(state);
|
|
2280
1879
|
return newState;
|
|
@@ -2354,6 +1953,8 @@ const handleClickFile = async (state, item) => {
|
|
|
2354
1953
|
const absolutePath = `${root}/${item.file}`;
|
|
2355
1954
|
// TODO handle error
|
|
2356
1955
|
const [fileBefore] = await Promise.all([getFileBefore(providerId, item.file), readFile(absolutePath)]);
|
|
1956
|
+
|
|
1957
|
+
// TODO diff editor should determine width by itself
|
|
2357
1958
|
await openDiffEditor(fileBefore, absolutePath);
|
|
2358
1959
|
return state;
|
|
2359
1960
|
};
|
|
@@ -2391,8 +1992,6 @@ const show = async (x, y, id, ...args) => {
|
|
|
2391
1992
|
return showContextMenu(x, y, id, ...args);
|
|
2392
1993
|
};
|
|
2393
1994
|
|
|
2394
|
-
const SourceControl$1 = 22;
|
|
2395
|
-
|
|
2396
1995
|
const handleContextMenu = async (state, button, x, y) => {
|
|
2397
1996
|
await show(x, y, SourceControl$1);
|
|
2398
1997
|
return state;
|
|
@@ -2509,7 +2108,7 @@ const createExtensionHostRpc = async () => {
|
|
|
2509
2108
|
|
|
2510
2109
|
const initialize = async () => {
|
|
2511
2110
|
const extensionHostRpc = await createExtensionHostRpc();
|
|
2512
|
-
set(extensionHostRpc);
|
|
2111
|
+
set$2(extensionHostRpc);
|
|
2513
2112
|
};
|
|
2514
2113
|
|
|
2515
2114
|
const renderCss = (oldState, newState) => {
|
|
@@ -2550,7 +2149,6 @@ const LabelDetail = 'LabelDetail';
|
|
|
2550
2149
|
const MaskIcon = 'MaskIcon';
|
|
2551
2150
|
const MaskIconChevronDown = 'MaskIconChevronDown';
|
|
2552
2151
|
const SourceControl = 'SourceControl';
|
|
2553
|
-
const SourceControlBadge = 'SourceControlBadge';
|
|
2554
2152
|
const SourceControlButton = 'SourceControlButton';
|
|
2555
2153
|
const SourceControlHeader = 'SourceControlHeader';
|
|
2556
2154
|
const SourceControlItems = 'SourceControlItems';
|
|
@@ -2600,12 +2198,14 @@ const getSourceControlHeaderVirtualDom = inputPlaceholder => {
|
|
|
2600
2198
|
}, ...getSourceControlInputDom(inputPlaceholder)];
|
|
2601
2199
|
};
|
|
2602
2200
|
|
|
2603
|
-
const
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2201
|
+
const className$1 = mergeClassNames(Badge, SourceControlBadge);
|
|
2202
|
+
const parentNode = {
|
|
2203
|
+
type: Div,
|
|
2204
|
+
className: className$1,
|
|
2205
|
+
childCount: 1
|
|
2206
|
+
};
|
|
2207
|
+
const getBadgeVirtualDom = count => {
|
|
2208
|
+
return [parentNode, text(`${count}`)];
|
|
2609
2209
|
};
|
|
2610
2210
|
|
|
2611
2211
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
@@ -2688,7 +2288,7 @@ const createItemDirectory = item => {
|
|
|
2688
2288
|
type: Div,
|
|
2689
2289
|
className: labelClassName,
|
|
2690
2290
|
childCount: 1
|
|
2691
|
-
}, text(label), ...buttonsDom, ...getBadgeVirtualDom(
|
|
2291
|
+
}, text(label), ...buttonsDom, ...getBadgeVirtualDom(badgeCount)];
|
|
2692
2292
|
};
|
|
2693
2293
|
|
|
2694
2294
|
const getFileIconVirtualDom = icon => {
|
|
@@ -2780,7 +2380,7 @@ const getSourceControlListVirtualDom = items => {
|
|
|
2780
2380
|
return [{
|
|
2781
2381
|
type: Div,
|
|
2782
2382
|
className: SourceControlItems,
|
|
2783
|
-
role: Tree,
|
|
2383
|
+
role: Tree$1,
|
|
2784
2384
|
childCount: items.length,
|
|
2785
2385
|
onClick: HandleClickAt,
|
|
2786
2386
|
onPointerOver: HandleMouseOverAt,
|
|
@@ -2882,7 +2482,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2882
2482
|
oldState,
|
|
2883
2483
|
newState
|
|
2884
2484
|
} = get$1(uid);
|
|
2885
|
-
set
|
|
2485
|
+
set(uid, newState, newState);
|
|
2886
2486
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2887
2487
|
return commands;
|
|
2888
2488
|
};
|
|
@@ -2900,6 +2500,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2900
2500
|
className: IconButton,
|
|
2901
2501
|
title: id,
|
|
2902
2502
|
'data-command': command,
|
|
2503
|
+
// TODO remove this
|
|
2903
2504
|
childCount: 1
|
|
2904
2505
|
}, getIconVirtualDom(icon)];
|
|
2905
2506
|
};
|
|
@@ -3002,14 +2603,14 @@ const updateIcons = async state => {
|
|
|
3002
2603
|
const viewAsList = state => {
|
|
3003
2604
|
return {
|
|
3004
2605
|
...state,
|
|
3005
|
-
viewMode:
|
|
2606
|
+
viewMode: List
|
|
3006
2607
|
};
|
|
3007
2608
|
};
|
|
3008
2609
|
|
|
3009
2610
|
const viewAsTree = state => {
|
|
3010
2611
|
return {
|
|
3011
2612
|
...state,
|
|
3012
|
-
viewMode:
|
|
2613
|
+
viewMode: Tree
|
|
3013
2614
|
};
|
|
3014
2615
|
};
|
|
3015
2616
|
|
|
@@ -3053,7 +2654,7 @@ const listen = async () => {
|
|
|
3053
2654
|
const rpc = await WebWorkerRpcClient.create({
|
|
3054
2655
|
commandMap: commandMap
|
|
3055
2656
|
});
|
|
3056
|
-
set$
|
|
2657
|
+
set$1(rpc);
|
|
3057
2658
|
};
|
|
3058
2659
|
|
|
3059
2660
|
const main = async () => {
|