@lvce-editor/quick-pick-worker 3.2.0 → 4.0.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/quickPickWorkerMain.js +481 -182
- package/package.json +1 -1
|
@@ -546,12 +546,12 @@ const execute = (command, ...args) => {
|
|
|
546
546
|
};
|
|
547
547
|
|
|
548
548
|
const Two$1 = '2.0';
|
|
549
|
-
const callbacks$
|
|
550
|
-
const get$
|
|
551
|
-
return callbacks$
|
|
549
|
+
const callbacks$2 = Object.create(null);
|
|
550
|
+
const get$3 = id => {
|
|
551
|
+
return callbacks$2[id];
|
|
552
552
|
};
|
|
553
|
-
const remove$
|
|
554
|
-
delete callbacks$
|
|
553
|
+
const remove$2 = id => {
|
|
554
|
+
delete callbacks$2[id];
|
|
555
555
|
};
|
|
556
556
|
class JsonRpcError extends Error {
|
|
557
557
|
constructor(message) {
|
|
@@ -696,14 +696,14 @@ const warn$1 = (...args) => {
|
|
|
696
696
|
console.warn(...args);
|
|
697
697
|
};
|
|
698
698
|
const resolve = (id, response) => {
|
|
699
|
-
const fn = get$
|
|
699
|
+
const fn = get$3(id);
|
|
700
700
|
if (!fn) {
|
|
701
701
|
console.log(response);
|
|
702
702
|
warn$1(`callback ${id} may already be disposed`);
|
|
703
703
|
return;
|
|
704
704
|
}
|
|
705
705
|
fn(response);
|
|
706
|
-
remove$
|
|
706
|
+
remove$2(id);
|
|
707
707
|
};
|
|
708
708
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
709
709
|
const getErrorType = prettyError => {
|
|
@@ -759,7 +759,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
759
759
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
760
760
|
return create$1$1(id, errorProperty);
|
|
761
761
|
};
|
|
762
|
-
const create$
|
|
762
|
+
const create$c = (message, result) => {
|
|
763
763
|
return {
|
|
764
764
|
id: message.id,
|
|
765
765
|
jsonrpc: Two$1,
|
|
@@ -768,7 +768,7 @@ const create$b = (message, result) => {
|
|
|
768
768
|
};
|
|
769
769
|
const getSuccessResponse = (message, result) => {
|
|
770
770
|
const resultProperty = result ?? null;
|
|
771
|
-
return create$
|
|
771
|
+
return create$c(message, resultProperty);
|
|
772
772
|
};
|
|
773
773
|
const getErrorResponseSimple = (id, error) => {
|
|
774
774
|
return {
|
|
@@ -862,7 +862,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
862
862
|
|
|
863
863
|
const Two = '2.0';
|
|
864
864
|
|
|
865
|
-
const create$
|
|
865
|
+
const create$b = (method, params) => {
|
|
866
866
|
return {
|
|
867
867
|
jsonrpc: Two,
|
|
868
868
|
method,
|
|
@@ -870,7 +870,7 @@ const create$a = (method, params) => {
|
|
|
870
870
|
};
|
|
871
871
|
};
|
|
872
872
|
|
|
873
|
-
const create$
|
|
873
|
+
const create$a = (id, method, params) => {
|
|
874
874
|
const message = {
|
|
875
875
|
id,
|
|
876
876
|
jsonrpc: Two,
|
|
@@ -880,13 +880,13 @@ const create$9 = (id, method, params) => {
|
|
|
880
880
|
return message;
|
|
881
881
|
};
|
|
882
882
|
|
|
883
|
-
let id = 0;
|
|
884
|
-
const create$
|
|
885
|
-
return ++id;
|
|
883
|
+
let id$2 = 0;
|
|
884
|
+
const create$9 = () => {
|
|
885
|
+
return ++id$2;
|
|
886
886
|
};
|
|
887
887
|
|
|
888
888
|
const registerPromise = map => {
|
|
889
|
-
const id = create$
|
|
889
|
+
const id = create$9();
|
|
890
890
|
const {
|
|
891
891
|
promise,
|
|
892
892
|
resolve
|
|
@@ -903,7 +903,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
|
|
|
903
903
|
id,
|
|
904
904
|
promise
|
|
905
905
|
} = registerPromise(callbacks);
|
|
906
|
-
const message = create$
|
|
906
|
+
const message = create$a(id, method, params);
|
|
907
907
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
908
908
|
ipc.sendAndTransfer(message);
|
|
909
909
|
} else {
|
|
@@ -939,7 +939,7 @@ const createRpc = ipc => {
|
|
|
939
939
|
* @deprecated
|
|
940
940
|
*/
|
|
941
941
|
send(method, ...params) {
|
|
942
|
-
const message = create$
|
|
942
|
+
const message = create$b(method, params);
|
|
943
943
|
ipc.send(message);
|
|
944
944
|
}
|
|
945
945
|
};
|
|
@@ -979,7 +979,7 @@ const listen$1 = async (module, options) => {
|
|
|
979
979
|
return ipc;
|
|
980
980
|
};
|
|
981
981
|
|
|
982
|
-
const create$
|
|
982
|
+
const create$8 = async ({
|
|
983
983
|
commandMap,
|
|
984
984
|
isMessagePortOpen = true,
|
|
985
985
|
messagePort
|
|
@@ -997,7 +997,7 @@ const create$7 = async ({
|
|
|
997
997
|
return rpc;
|
|
998
998
|
};
|
|
999
999
|
|
|
1000
|
-
const create$
|
|
1000
|
+
const create$7 = async ({
|
|
1001
1001
|
commandMap,
|
|
1002
1002
|
isMessagePortOpen,
|
|
1003
1003
|
send
|
|
@@ -1007,7 +1007,7 @@ const create$6 = async ({
|
|
|
1007
1007
|
port2
|
|
1008
1008
|
} = new MessageChannel();
|
|
1009
1009
|
await send(port1);
|
|
1010
|
-
return create$
|
|
1010
|
+
return create$8({
|
|
1011
1011
|
commandMap,
|
|
1012
1012
|
isMessagePortOpen,
|
|
1013
1013
|
messagePort: port2
|
|
@@ -1042,13 +1042,13 @@ const createSharedLazyRpc = factory => {
|
|
|
1042
1042
|
};
|
|
1043
1043
|
};
|
|
1044
1044
|
|
|
1045
|
-
const create$
|
|
1045
|
+
const create$6 = async ({
|
|
1046
1046
|
commandMap,
|
|
1047
1047
|
isMessagePortOpen,
|
|
1048
1048
|
send
|
|
1049
1049
|
}) => {
|
|
1050
1050
|
return createSharedLazyRpc(() => {
|
|
1051
|
-
return create$
|
|
1051
|
+
return create$7({
|
|
1052
1052
|
commandMap,
|
|
1053
1053
|
isMessagePortOpen,
|
|
1054
1054
|
send
|
|
@@ -1056,7 +1056,7 @@ const create$5 = async ({
|
|
|
1056
1056
|
});
|
|
1057
1057
|
};
|
|
1058
1058
|
|
|
1059
|
-
const create$
|
|
1059
|
+
const create$5 = async ({
|
|
1060
1060
|
commandMap
|
|
1061
1061
|
}) => {
|
|
1062
1062
|
// TODO create a commandMap per rpc instance
|
|
@@ -1088,32 +1088,32 @@ const createMockRpc = ({
|
|
|
1088
1088
|
};
|
|
1089
1089
|
|
|
1090
1090
|
const rpcs = Object.create(null);
|
|
1091
|
-
const set$
|
|
1091
|
+
const set$5 = (id, rpc) => {
|
|
1092
1092
|
rpcs[id] = rpc;
|
|
1093
1093
|
};
|
|
1094
|
-
const get$
|
|
1094
|
+
const get$2 = id => {
|
|
1095
1095
|
return rpcs[id];
|
|
1096
1096
|
};
|
|
1097
|
-
const remove = id => {
|
|
1097
|
+
const remove$1 = id => {
|
|
1098
1098
|
delete rpcs[id];
|
|
1099
1099
|
};
|
|
1100
1100
|
|
|
1101
1101
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1102
|
-
const create$
|
|
1102
|
+
const create$4 = rpcId => {
|
|
1103
1103
|
return {
|
|
1104
1104
|
async dispose() {
|
|
1105
|
-
const rpc = get$
|
|
1105
|
+
const rpc = get$2(rpcId);
|
|
1106
1106
|
await rpc.dispose();
|
|
1107
1107
|
},
|
|
1108
1108
|
// @ts-ignore
|
|
1109
1109
|
invoke(method, ...params) {
|
|
1110
|
-
const rpc = get$
|
|
1110
|
+
const rpc = get$2(rpcId);
|
|
1111
1111
|
// @ts-ignore
|
|
1112
1112
|
return rpc.invoke(method, ...params);
|
|
1113
1113
|
},
|
|
1114
1114
|
// @ts-ignore
|
|
1115
1115
|
invokeAndTransfer(method, ...params) {
|
|
1116
|
-
const rpc = get$
|
|
1116
|
+
const rpc = get$2(rpcId);
|
|
1117
1117
|
// @ts-ignore
|
|
1118
1118
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1119
1119
|
},
|
|
@@ -1121,16 +1121,16 @@ const create$3 = rpcId => {
|
|
|
1121
1121
|
const mockRpc = createMockRpc({
|
|
1122
1122
|
commandMap
|
|
1123
1123
|
});
|
|
1124
|
-
set$
|
|
1124
|
+
set$5(rpcId, mockRpc);
|
|
1125
1125
|
// @ts-ignore
|
|
1126
1126
|
mockRpc[Symbol.dispose] = () => {
|
|
1127
|
-
remove(rpcId);
|
|
1127
|
+
remove$1(rpcId);
|
|
1128
1128
|
};
|
|
1129
1129
|
// @ts-ignore
|
|
1130
1130
|
return mockRpc;
|
|
1131
1131
|
},
|
|
1132
1132
|
set(rpc) {
|
|
1133
|
-
set$
|
|
1133
|
+
set$5(rpcId, rpc);
|
|
1134
1134
|
}
|
|
1135
1135
|
};
|
|
1136
1136
|
};
|
|
@@ -1151,52 +1151,52 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1151
1151
|
const FocusQuickPickInput = 20;
|
|
1152
1152
|
|
|
1153
1153
|
const {
|
|
1154
|
-
invoke: invoke$
|
|
1155
|
-
set: set$
|
|
1156
|
-
} = create$
|
|
1154
|
+
invoke: invoke$3,
|
|
1155
|
+
set: set$4
|
|
1156
|
+
} = create$4(EditorWorker);
|
|
1157
1157
|
const getLines = async editorUid => {
|
|
1158
|
-
const lines = await invoke$
|
|
1158
|
+
const lines = await invoke$3('Editor.getLines2', editorUid);
|
|
1159
1159
|
return lines;
|
|
1160
1160
|
};
|
|
1161
1161
|
|
|
1162
1162
|
const {
|
|
1163
|
-
invoke: invoke$
|
|
1164
|
-
set: set$
|
|
1165
|
-
} = create$
|
|
1163
|
+
invoke: invoke$2,
|
|
1164
|
+
set: set$3
|
|
1165
|
+
} = create$4(7013);
|
|
1166
1166
|
|
|
1167
1167
|
const {
|
|
1168
|
-
invoke,
|
|
1168
|
+
invoke: invoke$1,
|
|
1169
1169
|
invokeAndTransfer,
|
|
1170
|
-
set: set$
|
|
1171
|
-
} = create$
|
|
1170
|
+
set: set$2
|
|
1171
|
+
} = create$4(RendererWorker);
|
|
1172
1172
|
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1173
1173
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1174
1174
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1175
1175
|
};
|
|
1176
1176
|
const setFocus = key => {
|
|
1177
|
-
return invoke('Focus.setFocus', key);
|
|
1177
|
+
return invoke$1('Focus.setFocus', key);
|
|
1178
1178
|
};
|
|
1179
1179
|
const getFileIcon = async options => {
|
|
1180
|
-
return invoke('IconTheme.getFileIcon', options);
|
|
1180
|
+
return invoke$1('IconTheme.getFileIcon', options);
|
|
1181
1181
|
};
|
|
1182
1182
|
const getFolderIcon = async options => {
|
|
1183
|
-
return invoke('IconTheme.getFolderIcon', options);
|
|
1183
|
+
return invoke$1('IconTheme.getFolderIcon', options);
|
|
1184
1184
|
};
|
|
1185
1185
|
const closeWidget$1 = async widgetId => {
|
|
1186
|
-
return invoke('Viewlet.closeWidget', widgetId);
|
|
1186
|
+
return invoke$1('Viewlet.closeWidget', widgetId);
|
|
1187
1187
|
};
|
|
1188
1188
|
const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
1189
1189
|
const command = 'FileSearch.handleMessagePort';
|
|
1190
1190
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1191
1191
|
};
|
|
1192
1192
|
const getActiveEditorId = () => {
|
|
1193
|
-
return invoke('GetActiveEditor.getActiveEditorId');
|
|
1193
|
+
return invoke$1('GetActiveEditor.getActiveEditorId');
|
|
1194
1194
|
};
|
|
1195
1195
|
const openUri$1 = async (uri, focus, options) => {
|
|
1196
|
-
await invoke('Main.openUri', uri, focus, options);
|
|
1196
|
+
await invoke$1('Main.openUri', uri, focus, options);
|
|
1197
1197
|
};
|
|
1198
1198
|
const showErrorDialog$1 = async errorInfo => {
|
|
1199
|
-
await invoke('ErrorHandling.showErrorDialog', errorInfo);
|
|
1199
|
+
await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
|
|
1200
1200
|
};
|
|
1201
1201
|
|
|
1202
1202
|
const closeWidget = async id => {
|
|
@@ -1204,7 +1204,73 @@ const closeWidget = async id => {
|
|
|
1204
1204
|
await closeWidget$1(id);
|
|
1205
1205
|
};
|
|
1206
1206
|
|
|
1207
|
+
let id$1 = 0;
|
|
1208
|
+
const create$3 = () => {
|
|
1209
|
+
return ++id$1;
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
const callbacks$1 = Object.create(null);
|
|
1213
|
+
const registerCallback = () => {
|
|
1214
|
+
const id = create$3();
|
|
1215
|
+
const {
|
|
1216
|
+
promise,
|
|
1217
|
+
resolve
|
|
1218
|
+
} = Promise.withResolvers();
|
|
1219
|
+
callbacks$1[id] = resolve;
|
|
1220
|
+
return {
|
|
1221
|
+
id,
|
|
1222
|
+
promise
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
const executeCallback = (id, value) => {
|
|
1226
|
+
const fn = callbacks$1[id];
|
|
1227
|
+
delete callbacks$1[id];
|
|
1228
|
+
fn(value);
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1231
|
+
const ColorTheme$1 = 0;
|
|
1232
|
+
const Commands$1 = 1;
|
|
1233
|
+
const Custom$1 = 2;
|
|
1234
|
+
const File$1 = 3;
|
|
1235
|
+
const GoToColumn$1 = 4;
|
|
1236
|
+
const GoToLine$2 = 5;
|
|
1237
|
+
const Help$2 = 6;
|
|
1238
|
+
const Recent$1 = 7;
|
|
1239
|
+
const Symbol$3 = 8;
|
|
1240
|
+
const View$3 = 9;
|
|
1241
|
+
const WorkspaceSymbol$2 = 10;
|
|
1242
|
+
const EveryThing$1 = 100;
|
|
1243
|
+
|
|
1244
|
+
const getCancelResult$1 = args => {
|
|
1245
|
+
const last = args.at(-1);
|
|
1246
|
+
if (last && typeof last === 'object' &&
|
|
1247
|
+
// @ts-ignore
|
|
1248
|
+
last.mode === 'quickPick') {
|
|
1249
|
+
return undefined;
|
|
1250
|
+
}
|
|
1251
|
+
return {
|
|
1252
|
+
canceled: true,
|
|
1253
|
+
inputValue: ''
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1207
1256
|
const close = async state => {
|
|
1257
|
+
const {
|
|
1258
|
+
args,
|
|
1259
|
+
providerId
|
|
1260
|
+
} = state;
|
|
1261
|
+
if (providerId === Custom$1) {
|
|
1262
|
+
const resolveId = args[2];
|
|
1263
|
+
const options = args.at(-1);
|
|
1264
|
+
const result = getCancelResult$1(args);
|
|
1265
|
+
if (options?.callbackOwner === 'quickPickWorker') {
|
|
1266
|
+
if (typeof resolveId !== 'number') {
|
|
1267
|
+
throw new TypeError('expected resolve id to be a number');
|
|
1268
|
+
}
|
|
1269
|
+
executeCallback(resolveId, result);
|
|
1270
|
+
} else {
|
|
1271
|
+
await invoke$1('QuickPick.executeCallback', resolveId, result);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1208
1274
|
await closeWidget(state.uid);
|
|
1209
1275
|
return state;
|
|
1210
1276
|
};
|
|
@@ -1336,13 +1402,47 @@ const create$2 = () => {
|
|
|
1336
1402
|
|
|
1337
1403
|
const {
|
|
1338
1404
|
dispose: dispose$1,
|
|
1339
|
-
get,
|
|
1405
|
+
get: get$1,
|
|
1340
1406
|
getCommandIds,
|
|
1341
1407
|
registerCommands,
|
|
1342
|
-
set,
|
|
1408
|
+
set: set$1,
|
|
1343
1409
|
wrapCommand
|
|
1344
1410
|
} = create$2();
|
|
1345
1411
|
|
|
1412
|
+
const getListHeight$1 = (itemsLength, itemHeight, maxHeight) => {
|
|
1413
|
+
number(itemsLength);
|
|
1414
|
+
number(itemHeight);
|
|
1415
|
+
number(maxHeight);
|
|
1416
|
+
if (itemsLength === 0) {
|
|
1417
|
+
return itemHeight;
|
|
1418
|
+
}
|
|
1419
|
+
const totalHeight = itemsLength * itemHeight;
|
|
1420
|
+
return Math.min(totalHeight, maxHeight);
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
const getScrollBarSize = (size, contentSize, minimumSliderSize) => {
|
|
1424
|
+
if (size >= contentSize) {
|
|
1425
|
+
return 0;
|
|
1426
|
+
}
|
|
1427
|
+
return Math.max(Math.round(size ** 2 / contentSize), minimumSliderSize);
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
const getScrollBarOffset = (delta, finalDelta, size, scrollBarSize) => {
|
|
1431
|
+
if (finalDelta <= 0) {
|
|
1432
|
+
return 0;
|
|
1433
|
+
}
|
|
1434
|
+
const scrollBarOffset = delta / finalDelta * (size - scrollBarSize);
|
|
1435
|
+
return scrollBarOffset;
|
|
1436
|
+
};
|
|
1437
|
+
const getScrollBarY = getScrollBarOffset;
|
|
1438
|
+
const getDeltaY = (scrollBarY, finalDelta, size, scrollBarSize) => {
|
|
1439
|
+
const scrollBarRange = size - scrollBarSize;
|
|
1440
|
+
if (finalDelta <= 0 || scrollBarRange <= 0) {
|
|
1441
|
+
return 0;
|
|
1442
|
+
}
|
|
1443
|
+
return scrollBarY / scrollBarRange * finalDelta;
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1346
1446
|
const create$1 = ({
|
|
1347
1447
|
headerHeight = 0,
|
|
1348
1448
|
itemHeight,
|
|
@@ -1360,17 +1460,40 @@ const create$1 = ({
|
|
|
1360
1460
|
minLineY: 0,
|
|
1361
1461
|
scrollBarActive: false,
|
|
1362
1462
|
scrollBarHeight: 0,
|
|
1463
|
+
scrollBarPointerId: -1,
|
|
1464
|
+
scrollBarPointerOffsetY: 0,
|
|
1363
1465
|
touchDifference: 0,
|
|
1364
1466
|
touchOffsetY: 0,
|
|
1365
1467
|
touchTimeStamp: 0
|
|
1366
1468
|
};
|
|
1367
1469
|
};
|
|
1368
|
-
const getListHeight
|
|
1470
|
+
const getListHeight = (height, headerHeight) => {
|
|
1369
1471
|
if (headerHeight) {
|
|
1370
1472
|
return height - headerHeight;
|
|
1371
1473
|
}
|
|
1372
1474
|
return headerHeight;
|
|
1373
1475
|
};
|
|
1476
|
+
const clamp = (value, min, max) => {
|
|
1477
|
+
return Math.min(Math.max(value, min), max);
|
|
1478
|
+
};
|
|
1479
|
+
const getScrollBarHeight = state => {
|
|
1480
|
+
const {
|
|
1481
|
+
height,
|
|
1482
|
+
itemHeight,
|
|
1483
|
+
items,
|
|
1484
|
+
minimumSliderSize
|
|
1485
|
+
} = state;
|
|
1486
|
+
const listHeight = getListHeight$1(items.length, itemHeight, height);
|
|
1487
|
+
const contentHeight = items.length * itemHeight;
|
|
1488
|
+
return getScrollBarSize(listHeight, contentHeight, minimumSliderSize);
|
|
1489
|
+
};
|
|
1490
|
+
const getScrollBarTop = (state, scrollBarHeight) => {
|
|
1491
|
+
const scrollBarSize = state.height - state.headerHeight;
|
|
1492
|
+
return getScrollBarY(state.deltaY, state.finalDeltaY, scrollBarSize, scrollBarHeight);
|
|
1493
|
+
};
|
|
1494
|
+
const getRelativePointerY = (state, clientY) => {
|
|
1495
|
+
return clientY - state.top - state.headerHeight;
|
|
1496
|
+
};
|
|
1374
1497
|
const setDeltaY = (state, deltaY) => {
|
|
1375
1498
|
object(state);
|
|
1376
1499
|
number(deltaY);
|
|
@@ -1380,7 +1503,7 @@ const setDeltaY = (state, deltaY) => {
|
|
|
1380
1503
|
itemHeight,
|
|
1381
1504
|
items
|
|
1382
1505
|
} = state;
|
|
1383
|
-
const listHeight = getListHeight
|
|
1506
|
+
const listHeight = getListHeight(height, headerHeight);
|
|
1384
1507
|
const itemsLength = items.length;
|
|
1385
1508
|
const finalDeltaY = itemsLength * itemHeight - listHeight;
|
|
1386
1509
|
if (deltaY < 0) {
|
|
@@ -1408,6 +1531,53 @@ const handleWheel = (state, deltaMode, deltaY) => {
|
|
|
1408
1531
|
number(deltaY);
|
|
1409
1532
|
return setDeltaY(state, state.deltaY + deltaY);
|
|
1410
1533
|
};
|
|
1534
|
+
const handleScrollBarPointerDown = (state, clientY, pointerId) => {
|
|
1535
|
+
object(state);
|
|
1536
|
+
number(clientY);
|
|
1537
|
+
number(pointerId);
|
|
1538
|
+
const scrollBarHeight = getScrollBarHeight(state);
|
|
1539
|
+
if (scrollBarHeight <= 0) {
|
|
1540
|
+
return state;
|
|
1541
|
+
}
|
|
1542
|
+
const scrollBarTop = getScrollBarTop(state, scrollBarHeight);
|
|
1543
|
+
const relativePointerY = getRelativePointerY(state, clientY);
|
|
1544
|
+
const scrollBarPointerOffsetY = clamp(relativePointerY - scrollBarTop, 0, scrollBarHeight);
|
|
1545
|
+
const newState = {
|
|
1546
|
+
...state,
|
|
1547
|
+
scrollBarActive: true,
|
|
1548
|
+
scrollBarPointerId: pointerId,
|
|
1549
|
+
scrollBarPointerOffsetY
|
|
1550
|
+
};
|
|
1551
|
+
return handleScrollBarPointerMove(newState, clientY, pointerId);
|
|
1552
|
+
};
|
|
1553
|
+
const handleScrollBarPointerMove = (state, clientY, pointerId) => {
|
|
1554
|
+
object(state);
|
|
1555
|
+
number(clientY);
|
|
1556
|
+
number(pointerId);
|
|
1557
|
+
if (!state.scrollBarActive || state.scrollBarPointerId !== pointerId) {
|
|
1558
|
+
return state;
|
|
1559
|
+
}
|
|
1560
|
+
const scrollBarHeight = getScrollBarHeight(state);
|
|
1561
|
+
const scrollBarSize = state.height - state.headerHeight;
|
|
1562
|
+
const maxScrollBarTop = Math.max(scrollBarSize - scrollBarHeight, 0);
|
|
1563
|
+
const relativePointerY = getRelativePointerY(state, clientY) - state.scrollBarPointerOffsetY;
|
|
1564
|
+
const scrollBarTop = clamp(relativePointerY, 0, maxScrollBarTop);
|
|
1565
|
+
const deltaY = Math.round(getDeltaY(scrollBarTop, state.finalDeltaY, scrollBarSize, scrollBarHeight));
|
|
1566
|
+
return setDeltaY(state, deltaY);
|
|
1567
|
+
};
|
|
1568
|
+
const handleScrollBarPointerUp = (state, pointerId) => {
|
|
1569
|
+
object(state);
|
|
1570
|
+
number(pointerId);
|
|
1571
|
+
if (!state.scrollBarActive || state.scrollBarPointerId !== pointerId) {
|
|
1572
|
+
return state;
|
|
1573
|
+
}
|
|
1574
|
+
return {
|
|
1575
|
+
...state,
|
|
1576
|
+
scrollBarActive: false,
|
|
1577
|
+
scrollBarPointerId: -1,
|
|
1578
|
+
scrollBarPointerOffsetY: 0
|
|
1579
|
+
};
|
|
1580
|
+
};
|
|
1411
1581
|
|
|
1412
1582
|
const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, workspaceUri, assetDir) => {
|
|
1413
1583
|
const state = {
|
|
@@ -1442,7 +1612,7 @@ const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, w
|
|
|
1442
1612
|
platform,
|
|
1443
1613
|
value: ''
|
|
1444
1614
|
};
|
|
1445
|
-
set(uid, state, state);
|
|
1615
|
+
set$1(uid, state, state);
|
|
1446
1616
|
};
|
|
1447
1617
|
|
|
1448
1618
|
const RenderItems = 1;
|
|
@@ -1492,7 +1662,7 @@ const diff2 = uid => {
|
|
|
1492
1662
|
const {
|
|
1493
1663
|
newState,
|
|
1494
1664
|
oldState
|
|
1495
|
-
} = get(uid);
|
|
1665
|
+
} = get$1(uid);
|
|
1496
1666
|
return diff(oldState, newState);
|
|
1497
1667
|
};
|
|
1498
1668
|
|
|
@@ -1501,7 +1671,7 @@ const dispose = uid => {
|
|
|
1501
1671
|
};
|
|
1502
1672
|
|
|
1503
1673
|
const setColorTheme = id => {
|
|
1504
|
-
return invoke(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1674
|
+
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1505
1675
|
};
|
|
1506
1676
|
|
|
1507
1677
|
const focusPick$1 = async pick => {
|
|
@@ -1511,19 +1681,6 @@ const focusPick$1 = async pick => {
|
|
|
1511
1681
|
await setColorTheme(label);
|
|
1512
1682
|
};
|
|
1513
1683
|
|
|
1514
|
-
const ColorTheme$1 = 0;
|
|
1515
|
-
const Commands$1 = 1;
|
|
1516
|
-
const Custom$1 = 2;
|
|
1517
|
-
const File$1 = 3;
|
|
1518
|
-
const GoToColumn$1 = 4;
|
|
1519
|
-
const GoToLine$2 = 5;
|
|
1520
|
-
const Help$2 = 6;
|
|
1521
|
-
const Recent$1 = 7;
|
|
1522
|
-
const Symbol$3 = 8;
|
|
1523
|
-
const View$3 = 9;
|
|
1524
|
-
const WorkspaceSymbol$2 = 10;
|
|
1525
|
-
const EveryThing$1 = 100;
|
|
1526
|
-
|
|
1527
1684
|
const noop$1 = async () => {};
|
|
1528
1685
|
const getFn$1 = id => {
|
|
1529
1686
|
switch (id) {
|
|
@@ -1559,6 +1716,10 @@ const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
|
1559
1716
|
return missingRequests;
|
|
1560
1717
|
};
|
|
1561
1718
|
|
|
1719
|
+
const getPath$1 = dirent => {
|
|
1720
|
+
return dirent.path;
|
|
1721
|
+
};
|
|
1722
|
+
|
|
1562
1723
|
const None$2 = 0;
|
|
1563
1724
|
const Directory = 3;
|
|
1564
1725
|
const File = 7;
|
|
@@ -1578,6 +1739,15 @@ const requestFileIcons = async requests => {
|
|
|
1578
1739
|
return Promise.all(promises);
|
|
1579
1740
|
};
|
|
1580
1741
|
|
|
1742
|
+
const toDirent = pick => {
|
|
1743
|
+
const dirent = {
|
|
1744
|
+
name: pick.label,
|
|
1745
|
+
path: pick.uri,
|
|
1746
|
+
type: pick.direntType
|
|
1747
|
+
};
|
|
1748
|
+
return dirent;
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1581
1751
|
const updateIconCache = (iconCache, missingRequests, newIcons) => {
|
|
1582
1752
|
if (missingRequests.length === 0) {
|
|
1583
1753
|
return iconCache;
|
|
@@ -1593,17 +1763,6 @@ const updateIconCache = (iconCache, missingRequests, newIcons) => {
|
|
|
1593
1763
|
return newFileIconCache;
|
|
1594
1764
|
};
|
|
1595
1765
|
|
|
1596
|
-
const getPath$1 = dirent => {
|
|
1597
|
-
return dirent.path;
|
|
1598
|
-
};
|
|
1599
|
-
const toDirent = pick => {
|
|
1600
|
-
const dirent = {
|
|
1601
|
-
name: pick.label,
|
|
1602
|
-
path: pick.uri,
|
|
1603
|
-
type: pick.direntType
|
|
1604
|
-
};
|
|
1605
|
-
return dirent;
|
|
1606
|
-
};
|
|
1607
1766
|
const getQuickPickFileIcons = async (items, fileIconCache) => {
|
|
1608
1767
|
const dirents = items.map(toDirent);
|
|
1609
1768
|
const missingRequests = getMissingIconRequests(dirents, fileIconCache);
|
|
@@ -1620,6 +1779,7 @@ const getQuickPickFileIcons = async (items, fileIconCache) => {
|
|
|
1620
1779
|
const focusIndex = async (state, index) => {
|
|
1621
1780
|
const {
|
|
1622
1781
|
fileIconCache,
|
|
1782
|
+
itemHeight,
|
|
1623
1783
|
items,
|
|
1624
1784
|
maxLineY,
|
|
1625
1785
|
maxVisibleItems,
|
|
@@ -1639,6 +1799,7 @@ const focusIndex = async (state, index) => {
|
|
|
1639
1799
|
// TODO need to scroll up
|
|
1640
1800
|
return {
|
|
1641
1801
|
...state,
|
|
1802
|
+
deltaY: minLineY * itemHeight,
|
|
1642
1803
|
fileIconCache: newFileIconCache,
|
|
1643
1804
|
focusedIndex: index,
|
|
1644
1805
|
icons,
|
|
@@ -1657,6 +1818,7 @@ const focusIndex = async (state, index) => {
|
|
|
1657
1818
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
1658
1819
|
return {
|
|
1659
1820
|
...state,
|
|
1821
|
+
deltaY: minLineY * itemHeight,
|
|
1660
1822
|
fileIconCache: newFileIconCache,
|
|
1661
1823
|
focusedIndex: index,
|
|
1662
1824
|
icons,
|
|
@@ -1728,8 +1890,7 @@ const DownArrow = 16;
|
|
|
1728
1890
|
|
|
1729
1891
|
const getKeyBindings = () => {
|
|
1730
1892
|
return [{
|
|
1731
|
-
|
|
1732
|
-
command: 'Viewlet.closeWidget',
|
|
1893
|
+
command: 'QuickPick.close',
|
|
1733
1894
|
key: Escape,
|
|
1734
1895
|
when: FocusQuickPickInput
|
|
1735
1896
|
}, {
|
|
@@ -2156,19 +2317,8 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
|
|
|
2156
2317
|
return finalDeltaY;
|
|
2157
2318
|
};
|
|
2158
2319
|
|
|
2159
|
-
const getListHeight = (itemsLength, itemHeight, maxHeight) => {
|
|
2160
|
-
number(itemsLength);
|
|
2161
|
-
number(itemHeight);
|
|
2162
|
-
number(maxHeight);
|
|
2163
|
-
if (itemsLength === 0) {
|
|
2164
|
-
return itemHeight;
|
|
2165
|
-
}
|
|
2166
|
-
const totalHeight = itemsLength * itemHeight;
|
|
2167
|
-
return Math.min(totalHeight, maxHeight);
|
|
2168
|
-
};
|
|
2169
|
-
|
|
2170
2320
|
const getColorThemeNames = async (assetDir, platform) => {
|
|
2171
|
-
return invoke('ColorTheme.getColorThemeNames', assetDir, platform);
|
|
2321
|
+
return invoke$1('ColorTheme.getColorThemeNames', assetDir, platform);
|
|
2172
2322
|
};
|
|
2173
2323
|
|
|
2174
2324
|
const toProtoVisibleItem$3 = name => {
|
|
@@ -2226,14 +2376,14 @@ const state$1 = {
|
|
|
2226
2376
|
const getAll = async () => {
|
|
2227
2377
|
try {
|
|
2228
2378
|
// @ts-ignore
|
|
2229
|
-
const entries = await invoke('Layout.getAllQuickPickMenuEntries');
|
|
2379
|
+
const entries = await invoke$1('Layout.getAllQuickPickMenuEntries');
|
|
2230
2380
|
return entries || [];
|
|
2231
2381
|
} catch {
|
|
2232
2382
|
// ignore
|
|
2233
2383
|
}
|
|
2234
2384
|
return state$1.menuEntries;
|
|
2235
2385
|
};
|
|
2236
|
-
const add = menuEntries => {
|
|
2386
|
+
const add$1 = menuEntries => {
|
|
2237
2387
|
state$1.menuEntries = [...state$1.menuEntries, ...menuEntries];
|
|
2238
2388
|
};
|
|
2239
2389
|
|
|
@@ -2262,7 +2412,7 @@ const getExtensionPicks = async (assetDir, platform) => {
|
|
|
2262
2412
|
// Assert.number(platform)
|
|
2263
2413
|
// TODO ask extension management worker directly
|
|
2264
2414
|
// TODO don't call this every time, cache the results
|
|
2265
|
-
const extensionPicks = await invoke('ExtensionHost.getCommands', assetDir, platform);
|
|
2415
|
+
const extensionPicks = await invoke$1('ExtensionHost.getCommands', assetDir, platform);
|
|
2266
2416
|
if (!extensionPicks) {
|
|
2267
2417
|
return [];
|
|
2268
2418
|
}
|
|
@@ -2302,22 +2452,53 @@ const getPicks$b = async (value, args, {
|
|
|
2302
2452
|
return converted;
|
|
2303
2453
|
};
|
|
2304
2454
|
|
|
2455
|
+
const state = {
|
|
2456
|
+
args: [],
|
|
2457
|
+
items: Object.create(null)
|
|
2458
|
+
};
|
|
2459
|
+
|
|
2460
|
+
let id = 0;
|
|
2461
|
+
const add = items => {
|
|
2462
|
+
const nextId = ++id;
|
|
2463
|
+
state.items[nextId] = items;
|
|
2464
|
+
return nextId;
|
|
2465
|
+
};
|
|
2466
|
+
const get = id => {
|
|
2467
|
+
return state.items[id] || [];
|
|
2468
|
+
};
|
|
2469
|
+
const remove = id => {
|
|
2470
|
+
delete state.items[id];
|
|
2471
|
+
};
|
|
2472
|
+
|
|
2473
|
+
let rpc;
|
|
2474
|
+
const set = newRpc => {
|
|
2475
|
+
rpc = newRpc;
|
|
2476
|
+
};
|
|
2477
|
+
const invoke = (method, ...args) => {
|
|
2478
|
+
return rpc.invoke(method, ...args);
|
|
2479
|
+
};
|
|
2480
|
+
|
|
2305
2481
|
const toProtoVisibleItem$1 = item => {
|
|
2306
2482
|
const {
|
|
2307
|
-
|
|
2483
|
+
description = '',
|
|
2484
|
+
label,
|
|
2485
|
+
value
|
|
2308
2486
|
} = item;
|
|
2309
2487
|
return {
|
|
2310
|
-
description
|
|
2488
|
+
description,
|
|
2311
2489
|
direntType: 0,
|
|
2312
2490
|
fileIcon: '',
|
|
2313
2491
|
icon: '',
|
|
2314
2492
|
label,
|
|
2315
2493
|
matches: [],
|
|
2316
|
-
uri: ''
|
|
2494
|
+
uri: '',
|
|
2495
|
+
value
|
|
2317
2496
|
};
|
|
2318
2497
|
};
|
|
2319
2498
|
const getPicks$a = async (searchValue, args) => {
|
|
2320
|
-
|
|
2499
|
+
state.args = args;
|
|
2500
|
+
const options = args.at(-1);
|
|
2501
|
+
const items = options?.mode === 'quickInput' ? searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue) : options?.customItemsId ? get(options.customItemsId) : args[1] || [];
|
|
2321
2502
|
const mapped = items.map(toProtoVisibleItem$1);
|
|
2322
2503
|
return mapped;
|
|
2323
2504
|
};
|
|
@@ -2325,11 +2506,11 @@ const getPicks$a = async (searchValue, args) => {
|
|
|
2325
2506
|
const emptyMatches = [];
|
|
2326
2507
|
|
|
2327
2508
|
const getWorkspacePath = async () => {
|
|
2328
|
-
return invoke('Workspace.getPath');
|
|
2509
|
+
return invoke$1('Workspace.getPath');
|
|
2329
2510
|
};
|
|
2330
2511
|
|
|
2331
2512
|
const searchFile$1 = async (path, value, prepare, assetDir) => {
|
|
2332
|
-
const result = await invoke$
|
|
2513
|
+
const result = await invoke$2('FileSearch.searchFile', path, value, prepare, assetDir);
|
|
2333
2514
|
return result;
|
|
2334
2515
|
};
|
|
2335
2516
|
|
|
@@ -2614,8 +2795,12 @@ const getPicks$7 = async () => {
|
|
|
2614
2795
|
}];
|
|
2615
2796
|
};
|
|
2616
2797
|
|
|
2617
|
-
const
|
|
2618
|
-
return
|
|
2798
|
+
const uniq = array => {
|
|
2799
|
+
return [...new Set(array)];
|
|
2800
|
+
};
|
|
2801
|
+
const getRecentlyOpened = async () => {
|
|
2802
|
+
const recentlyOpened = await invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
2803
|
+
return uniq(recentlyOpened);
|
|
2619
2804
|
};
|
|
2620
2805
|
|
|
2621
2806
|
const getPath = uri => {
|
|
@@ -2694,7 +2879,7 @@ const shouldHide = item => {
|
|
|
2694
2879
|
const selectPickBuiltin = async item => {
|
|
2695
2880
|
const args = item.args || [];
|
|
2696
2881
|
// TODO ids should be all numbers for efficiency -> also directly can call command
|
|
2697
|
-
await invoke(item.id, ...args);
|
|
2882
|
+
await invoke$1(item.id, ...args);
|
|
2698
2883
|
if (shouldHide(item)) {
|
|
2699
2884
|
return {
|
|
2700
2885
|
command: Hide
|
|
@@ -2707,13 +2892,16 @@ const selectPickBuiltin = async item => {
|
|
|
2707
2892
|
const selectPickExtension = async item => {
|
|
2708
2893
|
const id = item.id.slice(4); // TODO lots of string allocation with 'ext.' find a better way to separate builtin commands from extension commands
|
|
2709
2894
|
try {
|
|
2710
|
-
await invoke('ExtensionHost.executeCommand', id);
|
|
2895
|
+
await invoke$1('ExtensionHost.executeCommand', id);
|
|
2711
2896
|
} catch (error) {
|
|
2712
2897
|
await handleError(error, false);
|
|
2713
2898
|
await showErrorDialog(error);
|
|
2899
|
+
return {
|
|
2900
|
+
command: Hide
|
|
2901
|
+
};
|
|
2714
2902
|
}
|
|
2715
2903
|
return {
|
|
2716
|
-
command:
|
|
2904
|
+
command: KeepOpen
|
|
2717
2905
|
};
|
|
2718
2906
|
};
|
|
2719
2907
|
const selectPick$8 = async item => {
|
|
@@ -2727,16 +2915,31 @@ const selectPick$8 = async item => {
|
|
|
2727
2915
|
return selectPickBuiltin(item);
|
|
2728
2916
|
};
|
|
2729
2917
|
|
|
2730
|
-
const
|
|
2731
|
-
args
|
|
2918
|
+
const getOptions = args => {
|
|
2919
|
+
const last = args.at(-1);
|
|
2920
|
+
if (!last || typeof last !== 'object') {
|
|
2921
|
+
return {};
|
|
2922
|
+
}
|
|
2923
|
+
return last;
|
|
2732
2924
|
};
|
|
2733
|
-
|
|
2734
|
-
const selectPick$7 = async pick => {
|
|
2925
|
+
const selectPick$7 = async (_pick, value) => {
|
|
2735
2926
|
const {
|
|
2736
2927
|
args
|
|
2737
2928
|
} = state;
|
|
2929
|
+
const options = getOptions(args);
|
|
2738
2930
|
const resolveId = args[2];
|
|
2739
|
-
|
|
2931
|
+
const result = options.mode === 'quickPick' ? _pick.value : {
|
|
2932
|
+
canceled: false,
|
|
2933
|
+
inputValue: value
|
|
2934
|
+
};
|
|
2935
|
+
if (options.callbackOwner === 'quickPickWorker') {
|
|
2936
|
+
if (typeof resolveId !== 'number') {
|
|
2937
|
+
throw new TypeError('expected resolve id to be a number');
|
|
2938
|
+
}
|
|
2939
|
+
executeCallback(resolveId, result);
|
|
2940
|
+
} else {
|
|
2941
|
+
await invoke$1('QuickPick.executeCallback', resolveId, result);
|
|
2942
|
+
}
|
|
2740
2943
|
return {
|
|
2741
2944
|
command: Hide
|
|
2742
2945
|
};
|
|
@@ -2760,12 +2963,12 @@ const selectPick$6 = async pick => {
|
|
|
2760
2963
|
};
|
|
2761
2964
|
|
|
2762
2965
|
const setCursor = async (rowIndex, columnIndex) => {
|
|
2763
|
-
await invoke('Editor.cursorSet', rowIndex, columnIndex);
|
|
2966
|
+
await invoke$1('Editor.cursorSet', rowIndex, columnIndex);
|
|
2764
2967
|
};
|
|
2765
2968
|
|
|
2766
2969
|
const goToPositionAndFocus = async (rowIndex, columnIndex) => {
|
|
2767
2970
|
await setCursor(rowIndex, columnIndex);
|
|
2768
|
-
await invoke('Editor.handleFocus');
|
|
2971
|
+
await invoke$1('Editor.handleFocus');
|
|
2769
2972
|
};
|
|
2770
2973
|
|
|
2771
2974
|
const selectPickGoToColumn = async (item, value) => {
|
|
@@ -2808,7 +3011,7 @@ const selectPick$4 = async item => {
|
|
|
2808
3011
|
};
|
|
2809
3012
|
|
|
2810
3013
|
const openWorkspaceFolder = uri => {
|
|
2811
|
-
return invoke(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
|
|
3014
|
+
return invoke$1(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
|
|
2812
3015
|
};
|
|
2813
3016
|
|
|
2814
3017
|
// TODO selectPick should be independent of show/hide
|
|
@@ -2890,6 +3093,11 @@ const getQuickPickSubProviderId = (id, prefix) => {
|
|
|
2890
3093
|
}
|
|
2891
3094
|
};
|
|
2892
3095
|
|
|
3096
|
+
const isQuickInput = args => {
|
|
3097
|
+
const options = args.at(-1);
|
|
3098
|
+
return options?.mode === 'quickInput';
|
|
3099
|
+
};
|
|
3100
|
+
|
|
2893
3101
|
// TODO when user types letters -> no need to query provider again -> just filter existing results
|
|
2894
3102
|
const setValue = async (state, newValue) => {
|
|
2895
3103
|
const {
|
|
@@ -2913,7 +3121,7 @@ const setValue = async (state, newValue) => {
|
|
|
2913
3121
|
assetDir,
|
|
2914
3122
|
platform
|
|
2915
3123
|
});
|
|
2916
|
-
const filterValue = getFilterValue(providerId, subId, newValue);
|
|
3124
|
+
const filterValue = isQuickInput(args) ? '' : getFilterValue(providerId, subId, newValue);
|
|
2917
3125
|
const items = filterQuickPickItems(newPicks, filterValue);
|
|
2918
3126
|
const focusedIndex = items.length === 0 ? -1 : 0;
|
|
2919
3127
|
const sliced = items.slice(minLineY, maxLineY);
|
|
@@ -2921,7 +3129,7 @@ const setValue = async (state, newValue) => {
|
|
|
2921
3129
|
icons,
|
|
2922
3130
|
newFileIconCache
|
|
2923
3131
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
2924
|
-
const listHeight = getListHeight(items.length, itemHeight, height);
|
|
3132
|
+
const listHeight = getListHeight$1(items.length, itemHeight, height);
|
|
2925
3133
|
const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
|
|
2926
3134
|
return {
|
|
2927
3135
|
...state,
|
|
@@ -2967,7 +3175,27 @@ const handleBeforeInput = (state, inputType, data, selectionStart, selectionEnd)
|
|
|
2967
3175
|
return handleInput(state, newValue, cursorOffset, User);
|
|
2968
3176
|
};
|
|
2969
3177
|
|
|
3178
|
+
const getCancelResult = args => {
|
|
3179
|
+
const last = args.at(-1);
|
|
3180
|
+
if (last && typeof last === 'object' &&
|
|
3181
|
+
// @ts-ignore
|
|
3182
|
+
last.mode === 'quickPick') {
|
|
3183
|
+
return undefined;
|
|
3184
|
+
}
|
|
3185
|
+
return {
|
|
3186
|
+
canceled: true,
|
|
3187
|
+
inputValue: ''
|
|
3188
|
+
};
|
|
3189
|
+
};
|
|
2970
3190
|
const handleBlur = async state => {
|
|
3191
|
+
const {
|
|
3192
|
+
args,
|
|
3193
|
+
providerId
|
|
3194
|
+
} = state;
|
|
3195
|
+
if (providerId === Custom$1) {
|
|
3196
|
+
const resolveId = args[2];
|
|
3197
|
+
await invoke$1('QuickPick.executeCallback', resolveId, getCancelResult(args));
|
|
3198
|
+
}
|
|
2971
3199
|
await closeWidget(state.uid);
|
|
2972
3200
|
return state;
|
|
2973
3201
|
};
|
|
@@ -2992,6 +3220,17 @@ const getPick = (items, index) => {
|
|
|
2992
3220
|
return undefined;
|
|
2993
3221
|
};
|
|
2994
3222
|
|
|
3223
|
+
const createCustomPick = value => {
|
|
3224
|
+
return {
|
|
3225
|
+
description: '',
|
|
3226
|
+
direntType: 0,
|
|
3227
|
+
fileIcon: '',
|
|
3228
|
+
icon: '',
|
|
3229
|
+
label: value,
|
|
3230
|
+
matches: [],
|
|
3231
|
+
uri: ''
|
|
3232
|
+
};
|
|
3233
|
+
};
|
|
2995
3234
|
const selectIndex = async (state, index, button = /* left */0) => {
|
|
2996
3235
|
const {
|
|
2997
3236
|
items,
|
|
@@ -3000,12 +3239,12 @@ const selectIndex = async (state, index, button = /* left */0) => {
|
|
|
3000
3239
|
value
|
|
3001
3240
|
} = state;
|
|
3002
3241
|
const actualIndex = index + minLineY;
|
|
3003
|
-
const
|
|
3242
|
+
const prefix = getQuickPickPrefix(value);
|
|
3243
|
+
const subId = getQuickPickSubProviderId(providerId, prefix);
|
|
3244
|
+
const pick = getPick(items, actualIndex) || (subId === Custom$1 ? createCustomPick(value) : undefined);
|
|
3004
3245
|
if (!pick) {
|
|
3005
3246
|
return state;
|
|
3006
3247
|
}
|
|
3007
|
-
const prefix = getQuickPickPrefix(value);
|
|
3008
|
-
const subId = getQuickPickSubProviderId(providerId, prefix);
|
|
3009
3248
|
const fn = getSelect(subId);
|
|
3010
3249
|
const selectPickResult = await fn(pick, value);
|
|
3011
3250
|
object(selectPickResult);
|
|
@@ -3052,11 +3291,12 @@ const handleFocus = async state => {
|
|
|
3052
3291
|
const commandMapRef = {};
|
|
3053
3292
|
|
|
3054
3293
|
const handleMessagePort = async port => {
|
|
3055
|
-
await create$
|
|
3294
|
+
const rpc = await create$8({
|
|
3056
3295
|
commandMap: commandMapRef,
|
|
3057
3296
|
isMessagePortOpen: true,
|
|
3058
3297
|
messagePort: port
|
|
3059
3298
|
});
|
|
3299
|
+
set(rpc);
|
|
3060
3300
|
};
|
|
3061
3301
|
|
|
3062
3302
|
const initialize = async () => {
|
|
@@ -3104,25 +3344,45 @@ const getQuickPickProviderId = prefix => {
|
|
|
3104
3344
|
}
|
|
3105
3345
|
};
|
|
3106
3346
|
|
|
3347
|
+
const callbacks = [];
|
|
3348
|
+
const waitUntilVisible = () => {
|
|
3349
|
+
const {
|
|
3350
|
+
promise,
|
|
3351
|
+
resolve
|
|
3352
|
+
} = Promise.withResolvers();
|
|
3353
|
+
callbacks.push(resolve);
|
|
3354
|
+
return promise;
|
|
3355
|
+
};
|
|
3356
|
+
const notifyVisible = () => {
|
|
3357
|
+
const pendingCallbacks = callbacks.splice(0);
|
|
3358
|
+
for (const callback of pendingCallbacks) {
|
|
3359
|
+
callback();
|
|
3360
|
+
}
|
|
3361
|
+
};
|
|
3362
|
+
|
|
3107
3363
|
const parseArgs = (subId, args) => {
|
|
3108
3364
|
if (subId !== Custom$1) {
|
|
3109
3365
|
return {
|
|
3110
3366
|
ignoreFocusOut: false,
|
|
3111
|
-
initialValue: ''
|
|
3367
|
+
initialValue: '',
|
|
3368
|
+
placeholder: ''
|
|
3112
3369
|
};
|
|
3113
3370
|
}
|
|
3114
3371
|
const last = args.at(-1);
|
|
3115
3372
|
if (!last || typeof last !== 'object') {
|
|
3116
3373
|
return {
|
|
3117
3374
|
ignoreFocusOut: false,
|
|
3118
|
-
initialValue: ''
|
|
3375
|
+
initialValue: '',
|
|
3376
|
+
placeholder: ''
|
|
3119
3377
|
};
|
|
3120
3378
|
}
|
|
3121
3379
|
return {
|
|
3122
3380
|
// @ts-ignore
|
|
3123
3381
|
ignoreFocusOut: Boolean(last.ignoreFocusOut),
|
|
3124
3382
|
// @ts-ignore
|
|
3125
|
-
initialValue: String(last.initialValue)
|
|
3383
|
+
initialValue: last.initialValue ? String(last.initialValue) : '',
|
|
3384
|
+
// @ts-ignore
|
|
3385
|
+
placeholder: last.placeholder ? String(last.placeholder) : ''
|
|
3126
3386
|
};
|
|
3127
3387
|
};
|
|
3128
3388
|
const loadContent = async state => {
|
|
@@ -3154,10 +3414,11 @@ const loadContent = async state => {
|
|
|
3154
3414
|
icons,
|
|
3155
3415
|
newFileIconCache
|
|
3156
3416
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
3157
|
-
const listHeight = getListHeight(items.length, itemHeight, height);
|
|
3417
|
+
const listHeight = getListHeight$1(items.length, itemHeight, height);
|
|
3158
3418
|
const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
|
|
3159
3419
|
const parsedArgs = parseArgs(subId, args);
|
|
3160
3420
|
const finalValue = parsedArgs.initialValue || value;
|
|
3421
|
+
notifyVisible();
|
|
3161
3422
|
return {
|
|
3162
3423
|
...state,
|
|
3163
3424
|
args,
|
|
@@ -3173,20 +3434,13 @@ const loadContent = async state => {
|
|
|
3173
3434
|
maxLineY,
|
|
3174
3435
|
minLineY,
|
|
3175
3436
|
picks: newPicks,
|
|
3176
|
-
placeholder:
|
|
3437
|
+
placeholder: parsedArgs.placeholder,
|
|
3177
3438
|
providerId: id,
|
|
3178
3439
|
state: Finished,
|
|
3179
3440
|
value: finalValue
|
|
3180
3441
|
};
|
|
3181
3442
|
};
|
|
3182
3443
|
|
|
3183
|
-
const callbacks = Object.create(null);
|
|
3184
|
-
const executeCallback = id => {
|
|
3185
|
-
const fn = callbacks[id];
|
|
3186
|
-
delete callbacks[id];
|
|
3187
|
-
fn();
|
|
3188
|
-
};
|
|
3189
|
-
|
|
3190
3444
|
const SetCursorOffset = 'setCursorOffset';
|
|
3191
3445
|
const SetFocusedIndex = 'setFocusedIndex';
|
|
3192
3446
|
const SetItemsHeight = 'setItemsHeight';
|
|
@@ -3459,7 +3713,6 @@ const diffChildren = (oldChildren, newChildren, patches) => {
|
|
|
3459
3713
|
patches.push({
|
|
3460
3714
|
type: NavigateParent
|
|
3461
3715
|
});
|
|
3462
|
-
currentChildIndex = -1;
|
|
3463
3716
|
}
|
|
3464
3717
|
// Add remove patches in reverse order (highest index first)
|
|
3465
3718
|
// This ensures indices remain valid as we remove
|
|
@@ -3536,13 +3789,6 @@ const getVisible$1 = (items, minLineY, maxLineY, icons) => {
|
|
|
3536
3789
|
return protoVisibleItems;
|
|
3537
3790
|
};
|
|
3538
3791
|
|
|
3539
|
-
const getScrollBarSize = (size, contentSize, minimumSliderSize) => {
|
|
3540
|
-
if (size >= contentSize) {
|
|
3541
|
-
return 0;
|
|
3542
|
-
}
|
|
3543
|
-
return Math.max(Math.round(size ** 2 / contentSize), minimumSliderSize);
|
|
3544
|
-
};
|
|
3545
|
-
|
|
3546
3792
|
const emptyHighlightSections = [];
|
|
3547
3793
|
|
|
3548
3794
|
const getHighlightSections = (highlights, label) => {
|
|
@@ -3579,13 +3825,14 @@ const getHighlightSections = (highlights, label) => {
|
|
|
3579
3825
|
};
|
|
3580
3826
|
|
|
3581
3827
|
const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
|
|
3828
|
+
const visibleFocusedIndex = focusedIndex - minLineY;
|
|
3582
3829
|
const visibleItems = protoVisibleItems.map((visibleItem, i) => {
|
|
3583
3830
|
const highlights = visibleItem.matches.slice(1);
|
|
3584
3831
|
const sections = getHighlightSections(highlights, visibleItem.label);
|
|
3585
3832
|
return {
|
|
3586
3833
|
...visibleItem,
|
|
3587
3834
|
highlights: sections,
|
|
3588
|
-
isActive: i ===
|
|
3835
|
+
isActive: i === visibleFocusedIndex,
|
|
3589
3836
|
posInSet: minLineY + i + 1,
|
|
3590
3837
|
setSize
|
|
3591
3838
|
};
|
|
@@ -3593,12 +3840,6 @@ const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
|
|
|
3593
3840
|
return visibleItems;
|
|
3594
3841
|
};
|
|
3595
3842
|
|
|
3596
|
-
const getScrollBarOffset = (delta, finalDelta, size, scrollBarSize) => {
|
|
3597
|
-
const scrollBarOffset = delta / finalDelta * (size - scrollBarSize);
|
|
3598
|
-
return scrollBarOffset;
|
|
3599
|
-
};
|
|
3600
|
-
const getScrollBarY = getScrollBarOffset;
|
|
3601
|
-
|
|
3602
3843
|
const createQuickPickViewModel = (oldState, newState) => {
|
|
3603
3844
|
const {
|
|
3604
3845
|
cursorOffset,
|
|
@@ -3622,7 +3863,7 @@ const createQuickPickViewModel = (oldState, newState) => {
|
|
|
3622
3863
|
const oldFocusedIndex = oldState.focusedIndex - oldState.minLineY;
|
|
3623
3864
|
const newFocusedIndex = focusedIndex - minLineY;
|
|
3624
3865
|
const itemCount = items.length;
|
|
3625
|
-
const listHeight = getListHeight(itemCount, itemHeight, height);
|
|
3866
|
+
const listHeight = getListHeight$1(itemCount, itemHeight, height);
|
|
3626
3867
|
const contentHeight = itemCount * itemHeight;
|
|
3627
3868
|
const scrollBarHeight = getScrollBarSize(listHeight, contentHeight, minimumSliderSize);
|
|
3628
3869
|
const scrollBarY = getScrollBarY(deltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
@@ -3653,7 +3894,7 @@ const Label = 'Label';
|
|
|
3653
3894
|
const List = 'List';
|
|
3654
3895
|
const ListItems = 'ListItems';
|
|
3655
3896
|
const MaskIcon = 'MaskIcon';
|
|
3656
|
-
const QuickPick$
|
|
3897
|
+
const QuickPick$2 = 'QuickPick';
|
|
3657
3898
|
const QuickPickHeader = 'QuickPickHeader';
|
|
3658
3899
|
const QuickPickHighlight = 'QuickPickHighlight';
|
|
3659
3900
|
const QuickPickItem = 'QuickPickItem';
|
|
@@ -3673,12 +3914,15 @@ const HandleBeforeInput = 'handleBeforeInput';
|
|
|
3673
3914
|
const HandleBlur = 'handleBlur';
|
|
3674
3915
|
const HandleFocus = 'handleFocus';
|
|
3675
3916
|
const HandleInput = 'handleInput';
|
|
3917
|
+
const HandleScrollbarPointerDown = 'handleScrollbarPointerDown';
|
|
3918
|
+
const HandleScrollbarPointerMove = 'handleScrollbarPointerMove';
|
|
3919
|
+
const HandleScrollbarPointerUp = 'handleScrollbarPointerUp';
|
|
3676
3920
|
|
|
3677
|
-
const QuickPick = 'QuickPick';
|
|
3921
|
+
const QuickPick$1 = 'QuickPick';
|
|
3678
3922
|
const QuickPickItems = 'QuickPickItems';
|
|
3679
3923
|
const QuickPickItemActive = 'QuickPickItemActive';
|
|
3680
3924
|
|
|
3681
|
-
const getQuickPickInputVirtualDom = () => {
|
|
3925
|
+
const getQuickPickInputVirtualDom = (placeholder = '') => {
|
|
3682
3926
|
const ariaLabel = typeNameofCommandToRun();
|
|
3683
3927
|
return {
|
|
3684
3928
|
ariaAutoComplete: 'list',
|
|
@@ -3694,18 +3938,19 @@ const getQuickPickInputVirtualDom = () => {
|
|
|
3694
3938
|
onBlur: HandleBlur,
|
|
3695
3939
|
onFocus: HandleFocus,
|
|
3696
3940
|
onInput: HandleInput,
|
|
3941
|
+
placeholder,
|
|
3697
3942
|
role: ComboBox,
|
|
3698
3943
|
spellcheck: false,
|
|
3699
3944
|
type: Input
|
|
3700
3945
|
};
|
|
3701
3946
|
};
|
|
3702
3947
|
|
|
3703
|
-
const getQuickPickHeaderVirtualDom = () => {
|
|
3948
|
+
const getQuickPickHeaderVirtualDom = (placeholder = '') => {
|
|
3704
3949
|
return [{
|
|
3705
3950
|
childCount: 1,
|
|
3706
3951
|
className: QuickPickHeader,
|
|
3707
3952
|
type: Div
|
|
3708
|
-
}, getQuickPickInputVirtualDom()];
|
|
3953
|
+
}, getQuickPickInputVirtualDom(placeholder)];
|
|
3709
3954
|
};
|
|
3710
3955
|
|
|
3711
3956
|
const getFileIconVirtualDom = icon => {
|
|
@@ -3827,6 +4072,7 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
|
|
|
3827
4072
|
return [{
|
|
3828
4073
|
childCount: 1,
|
|
3829
4074
|
className: mergeClassNames(ScrollBar, ScrollBarSmall),
|
|
4075
|
+
onPointerDown: HandleScrollbarPointerDown,
|
|
3830
4076
|
type: Div
|
|
3831
4077
|
}, {
|
|
3832
4078
|
childCount: 0,
|
|
@@ -3854,7 +4100,7 @@ const getRootNodeCount = nodes => {
|
|
|
3854
4100
|
}
|
|
3855
4101
|
return count;
|
|
3856
4102
|
};
|
|
3857
|
-
const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) => {
|
|
4103
|
+
const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop, placeholder = '') => {
|
|
3858
4104
|
const quickOpen$1 = quickOpen();
|
|
3859
4105
|
const shouldShowScrollbar = scrollBarHeight > 0;
|
|
3860
4106
|
const quickPickItemsDom = getQuickPickItemsVirtualDom(visibleItems);
|
|
@@ -3862,10 +4108,10 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) =>
|
|
|
3862
4108
|
return [{
|
|
3863
4109
|
ariaLabel: quickOpen$1,
|
|
3864
4110
|
childCount: 2,
|
|
3865
|
-
className: mergeClassNames(Viewlet, QuickPick$
|
|
3866
|
-
id: QuickPick,
|
|
4111
|
+
className: mergeClassNames(Viewlet, QuickPick$2),
|
|
4112
|
+
id: QuickPick$1,
|
|
3867
4113
|
type: Div
|
|
3868
|
-
}, ...getQuickPickHeaderVirtualDom(), {
|
|
4114
|
+
}, ...getQuickPickHeaderVirtualDom(placeholder), {
|
|
3869
4115
|
ariaActivedescendant: QuickPickItemActive,
|
|
3870
4116
|
childCount: shouldShowScrollbar ? 2 : 1,
|
|
3871
4117
|
className: mergeClassNames(List, ContainContent),
|
|
@@ -3891,7 +4137,7 @@ const renderItemsDom = state => {
|
|
|
3891
4137
|
scrollBarTop,
|
|
3892
4138
|
visibleItems
|
|
3893
4139
|
} = viewModel;
|
|
3894
|
-
return getQuickPickVirtualDom(visibleItems, scrollBarHeight, scrollBarTop);
|
|
4140
|
+
return getQuickPickVirtualDom(visibleItems, scrollBarHeight, scrollBarTop, state.placeholder);
|
|
3895
4141
|
};
|
|
3896
4142
|
const renderItems = (_oldState, newState) => {
|
|
3897
4143
|
const dom = renderItemsDom(newState);
|
|
@@ -3949,11 +4195,11 @@ const render2 = (uid, diffResult) => {
|
|
|
3949
4195
|
const {
|
|
3950
4196
|
newState,
|
|
3951
4197
|
oldState
|
|
3952
|
-
} = get(uid);
|
|
4198
|
+
} = get$1(uid);
|
|
3953
4199
|
if (oldState === newState) {
|
|
3954
4200
|
return [];
|
|
3955
4201
|
}
|
|
3956
|
-
set(uid, newState, newState);
|
|
4202
|
+
set$1(uid, newState, newState);
|
|
3957
4203
|
const commands = applyRender(oldState, newState, diffResult);
|
|
3958
4204
|
return commands;
|
|
3959
4205
|
};
|
|
@@ -3967,6 +4213,18 @@ const renderEventListeners = () => {
|
|
|
3967
4213
|
name: HandleWheel,
|
|
3968
4214
|
params: ['handleWheel', 'event.deltaMode', 'event.deltaY'],
|
|
3969
4215
|
passive: true
|
|
4216
|
+
}, {
|
|
4217
|
+
name: HandleScrollbarPointerDown,
|
|
4218
|
+
params: ['handleScrollBarPointerDown', 'event.clientY', 'event.pointerId'],
|
|
4219
|
+
preventDefault: true
|
|
4220
|
+
}, {
|
|
4221
|
+
name: HandleScrollbarPointerMove,
|
|
4222
|
+
params: ['handleScrollBarPointerMove', 'event.clientY', 'event.pointerId'],
|
|
4223
|
+
preventDefault: true
|
|
4224
|
+
}, {
|
|
4225
|
+
name: HandleScrollbarPointerUp,
|
|
4226
|
+
params: ['handleScrollBarPointerUp', 'event.pointerId'],
|
|
4227
|
+
preventDefault: true
|
|
3970
4228
|
}, {
|
|
3971
4229
|
name: HandleBlur,
|
|
3972
4230
|
params: ['handleBlur']
|
|
@@ -4008,26 +4266,62 @@ const selectItem = async (state, label) => {
|
|
|
4008
4266
|
};
|
|
4009
4267
|
|
|
4010
4268
|
const showQuickInput = async ({
|
|
4269
|
+
id,
|
|
4011
4270
|
ignoreFocusOut,
|
|
4271
|
+
initialItems = [],
|
|
4012
4272
|
initialValue,
|
|
4013
4273
|
waitUntil
|
|
4014
4274
|
}) => {
|
|
4015
|
-
|
|
4275
|
+
const customItemsId = add(initialItems);
|
|
4016
4276
|
const picks = [];
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4277
|
+
try {
|
|
4278
|
+
const result = await invoke$1('QuickPick.showCustom', picks, {
|
|
4279
|
+
customItemsId,
|
|
4280
|
+
ignoreFocusOut,
|
|
4281
|
+
initialValue,
|
|
4282
|
+
mode: 'quickInput',
|
|
4283
|
+
quickInputId: id,
|
|
4284
|
+
waitUntil
|
|
4285
|
+
});
|
|
4286
|
+
return result ?? {
|
|
4287
|
+
canceled: true,
|
|
4288
|
+
inputValue: ''
|
|
4289
|
+
};
|
|
4290
|
+
} finally {
|
|
4291
|
+
remove(customItemsId);
|
|
4292
|
+
}
|
|
4293
|
+
};
|
|
4294
|
+
|
|
4295
|
+
const QuickPick = 'QuickPick';
|
|
4296
|
+
|
|
4297
|
+
const showQuickPick = async ({
|
|
4298
|
+
items,
|
|
4299
|
+
placeholder = '',
|
|
4300
|
+
waitUntil = 'selected'
|
|
4301
|
+
}) => {
|
|
4302
|
+
const customItemsId = add(items);
|
|
4303
|
+
const {
|
|
4304
|
+
id,
|
|
4305
|
+
promise
|
|
4306
|
+
} = registerCallback();
|
|
4307
|
+
try {
|
|
4308
|
+
await invoke$1('Viewlet.openWidget', QuickPick, 'custom', [], id, {
|
|
4309
|
+
callbackOwner: 'quickPickWorker',
|
|
4310
|
+
customItemsId,
|
|
4311
|
+
mode: 'quickPick',
|
|
4312
|
+
placeholder
|
|
4313
|
+
});
|
|
4314
|
+
if (waitUntil === 'visible') {
|
|
4315
|
+
return undefined;
|
|
4316
|
+
}
|
|
4317
|
+
return await promise;
|
|
4318
|
+
} finally {
|
|
4319
|
+
remove(customItemsId);
|
|
4320
|
+
}
|
|
4027
4321
|
};
|
|
4028
4322
|
|
|
4029
4323
|
const commandMap = {
|
|
4030
|
-
'QuickPick.addMenuEntries': add,
|
|
4324
|
+
'QuickPick.addMenuEntries': add$1,
|
|
4031
4325
|
'QuickPick.close': close,
|
|
4032
4326
|
'QuickPick.create2': create,
|
|
4033
4327
|
'QuickPick.diff2': diff2,
|
|
@@ -4046,6 +4340,9 @@ const commandMap = {
|
|
|
4046
4340
|
'QuickPick.handleFocus': wrapCommand(handleFocus),
|
|
4047
4341
|
'QuickPick.handleInput': wrapCommand(handleInput),
|
|
4048
4342
|
'QuickPick.handleMessagePort': handleMessagePort,
|
|
4343
|
+
'QuickPick.handleScrollBarPointerDown': wrapCommand(handleScrollBarPointerDown),
|
|
4344
|
+
'QuickPick.handleScrollBarPointerMove': wrapCommand(handleScrollBarPointerMove),
|
|
4345
|
+
'QuickPick.handleScrollBarPointerUp': wrapCommand(handleScrollBarPointerUp),
|
|
4049
4346
|
'QuickPick.handleWheel': wrapCommand(handleWheel),
|
|
4050
4347
|
'QuickPick.initialize': initialize,
|
|
4051
4348
|
'QuickPick.loadContent': wrapCommand(loadContent),
|
|
@@ -4056,34 +4353,36 @@ const commandMap = {
|
|
|
4056
4353
|
'QuickPick.selectItem': wrapCommand(selectItem),
|
|
4057
4354
|
'QuickPick.setDeltaY': wrapCommand(setDeltaY),
|
|
4058
4355
|
'QuickPick.setValue': wrapCommand(setValue),
|
|
4059
|
-
'QuickPick.showQuickInput': showQuickInput
|
|
4356
|
+
'QuickPick.showQuickInput': showQuickInput,
|
|
4357
|
+
'QuickPick.showQuickPick': showQuickPick,
|
|
4358
|
+
'QuickPick.waitUntilVisible': waitUntilVisible
|
|
4060
4359
|
};
|
|
4061
4360
|
|
|
4062
4361
|
const initializeEditorWorker = async () => {
|
|
4063
|
-
const rpc = await create$
|
|
4362
|
+
const rpc = await create$6({
|
|
4064
4363
|
commandMap: {},
|
|
4065
4364
|
async send(port) {
|
|
4066
4365
|
await sendMessagePortToEditorWorker(port, 0);
|
|
4067
4366
|
}
|
|
4068
4367
|
});
|
|
4069
|
-
set$
|
|
4368
|
+
set$4(rpc);
|
|
4070
4369
|
};
|
|
4071
4370
|
|
|
4072
4371
|
const initializeFileSearchWorker = async () => {
|
|
4073
|
-
const rpc = await create$
|
|
4372
|
+
const rpc = await create$6({
|
|
4074
4373
|
commandMap: {},
|
|
4075
4374
|
async send(port) {
|
|
4076
4375
|
await sendMessagePortToFileSearchWorker2(port, 0);
|
|
4077
4376
|
}
|
|
4078
4377
|
});
|
|
4079
|
-
set$
|
|
4378
|
+
set$3(rpc);
|
|
4080
4379
|
};
|
|
4081
4380
|
|
|
4082
4381
|
const initializeRendererWorker = async () => {
|
|
4083
|
-
const rpc = await create$
|
|
4382
|
+
const rpc = await create$5({
|
|
4084
4383
|
commandMap: commandMap
|
|
4085
4384
|
});
|
|
4086
|
-
set$
|
|
4385
|
+
set$2(rpc);
|
|
4087
4386
|
};
|
|
4088
4387
|
|
|
4089
4388
|
const listen = async () => {
|