@lvce-editor/file-search-worker 6.3.0 → 6.6.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/fileSearchWorkerMain.js +356 -313
- package/package.json +1 -1
|
@@ -553,7 +553,7 @@ const getParentStack = error => {
|
|
|
553
553
|
return parentStack;
|
|
554
554
|
};
|
|
555
555
|
const MethodNotFound = -32601;
|
|
556
|
-
const Custom$
|
|
556
|
+
const Custom$2 = -32001;
|
|
557
557
|
const restoreJsonRpcError = error => {
|
|
558
558
|
const currentStack = getCurrentStack();
|
|
559
559
|
if (error && error instanceof Error) {
|
|
@@ -662,7 +662,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
664
|
return {
|
|
665
|
-
code: Custom$
|
|
665
|
+
code: Custom$2,
|
|
666
666
|
message: prettyError.message,
|
|
667
667
|
data: {
|
|
668
668
|
stack: getStack(prettyError),
|
|
@@ -702,7 +702,7 @@ const getErrorResponseSimple = (id, error) => {
|
|
|
702
702
|
jsonrpc: Two,
|
|
703
703
|
id,
|
|
704
704
|
error: {
|
|
705
|
-
code: Custom$
|
|
705
|
+
code: Custom$2,
|
|
706
706
|
// @ts-ignore
|
|
707
707
|
message: error.message,
|
|
708
708
|
data: error
|
|
@@ -823,7 +823,7 @@ const register$1 = commandMap => {
|
|
|
823
823
|
const getCommand = key => {
|
|
824
824
|
return commands[key];
|
|
825
825
|
};
|
|
826
|
-
const execute
|
|
826
|
+
const execute = (command, ...args) => {
|
|
827
827
|
const fn = getCommand(command);
|
|
828
828
|
if (!fn) {
|
|
829
829
|
throw new CommandNotFoundError(command);
|
|
@@ -864,7 +864,7 @@ const logError = () => {
|
|
|
864
864
|
};
|
|
865
865
|
const handleMessage = event => {
|
|
866
866
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
867
|
-
const actualExecute = event?.target?.execute || execute
|
|
867
|
+
const actualExecute = event?.target?.execute || execute;
|
|
868
868
|
return handleJsonRpcMessage(event.target, event.data, actualExecute, resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
869
869
|
};
|
|
870
870
|
const handleIpc = ipc => {
|
|
@@ -923,6 +923,8 @@ const Span = 8;
|
|
|
923
923
|
const Text = 12;
|
|
924
924
|
const Img = 17;
|
|
925
925
|
|
|
926
|
+
const Script$1 = 2;
|
|
927
|
+
|
|
926
928
|
const DebugWorker = 55;
|
|
927
929
|
const RendererWorker$1 = 1;
|
|
928
930
|
|
|
@@ -970,9 +972,20 @@ const searchFileHtml = async uri => {
|
|
|
970
972
|
const getFilePathElectron = async file => {
|
|
971
973
|
return invoke$2('FileSystemHandle.getFilePathElectron', file);
|
|
972
974
|
};
|
|
975
|
+
/**
|
|
976
|
+
* @deprecated
|
|
977
|
+
*/
|
|
973
978
|
const showContextMenu = async (x, y, id, ...args) => {
|
|
974
979
|
return invoke$2('ContextMenu.show', x, y, id, ...args);
|
|
975
980
|
};
|
|
981
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
982
|
+
number(uid);
|
|
983
|
+
number(menuId);
|
|
984
|
+
number(x);
|
|
985
|
+
number(y);
|
|
986
|
+
// @ts-ignore
|
|
987
|
+
await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
|
|
988
|
+
};
|
|
976
989
|
const getElectronVersion = async () => {
|
|
977
990
|
return invoke$2('Process.getElectronVersion');
|
|
978
991
|
};
|
|
@@ -1064,6 +1077,9 @@ const handleDebugChange = async params => {
|
|
|
1064
1077
|
const getFolderIcon$1 = async options => {
|
|
1065
1078
|
return invoke$2('IconTheme.getFolderIcon', options);
|
|
1066
1079
|
};
|
|
1080
|
+
const handleWorkspaceRefresh = async () => {
|
|
1081
|
+
return invoke$2('Layout.handleWorkspaceRefresh');
|
|
1082
|
+
};
|
|
1067
1083
|
const closeWidget$2 = async widgetId => {
|
|
1068
1084
|
return invoke$2('Viewlet.closeWidget', widgetId);
|
|
1069
1085
|
};
|
|
@@ -1088,6 +1104,9 @@ const getKeyBindings$1 = async () => {
|
|
|
1088
1104
|
const writeClipBoardText = async text => {
|
|
1089
1105
|
await invoke$2('ClipBoard.writeText', /* text */text);
|
|
1090
1106
|
};
|
|
1107
|
+
const readClipBoardText = async () => {
|
|
1108
|
+
return invoke$2('ClipBoard.readText');
|
|
1109
|
+
};
|
|
1091
1110
|
const writeClipBoardImage = async blob => {
|
|
1092
1111
|
// @ts-ignore
|
|
1093
1112
|
await invoke$2('ClipBoard.writeImage', /* text */blob);
|
|
@@ -1131,6 +1150,20 @@ const sendMessagePortToRendererProcess = async port => {
|
|
|
1131
1150
|
// @ts-ignore
|
|
1132
1151
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1133
1152
|
};
|
|
1153
|
+
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1154
|
+
const command = 'TextMeasurement.handleMessagePort';
|
|
1155
|
+
// @ts-ignore
|
|
1156
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1157
|
+
};
|
|
1158
|
+
const sendMessagePortToSourceControlWorker = async port => {
|
|
1159
|
+
const command = 'SourceControl.handleMessagePort';
|
|
1160
|
+
// @ts-ignore
|
|
1161
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1162
|
+
};
|
|
1163
|
+
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1164
|
+
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1165
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1166
|
+
};
|
|
1134
1167
|
const getPreference = async key => {
|
|
1135
1168
|
return await invoke$2('Preferences.get', key);
|
|
1136
1169
|
};
|
|
@@ -1202,7 +1235,7 @@ const openExtensionSearch = async () => {
|
|
|
1202
1235
|
};
|
|
1203
1236
|
const setExtensionsSearchValue = async searchValue => {
|
|
1204
1237
|
// @ts-ignore
|
|
1205
|
-
return invoke$2('Extensions.handleInput', searchValue);
|
|
1238
|
+
return invoke$2('Extensions.handleInput', searchValue, Script$1);
|
|
1206
1239
|
};
|
|
1207
1240
|
const openExternal = async uri => {
|
|
1208
1241
|
// @ts-ignore
|
|
@@ -1224,6 +1257,9 @@ const getLogsDir = async () => {
|
|
|
1224
1257
|
// @ts-ignore
|
|
1225
1258
|
return invoke$2('PlatformPaths.getLogsDir');
|
|
1226
1259
|
};
|
|
1260
|
+
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1261
|
+
return invoke$2(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1262
|
+
};
|
|
1227
1263
|
const registerMockRpc = commandMap => {
|
|
1228
1264
|
const mockRpc = createMockRpc({
|
|
1229
1265
|
commandMap
|
|
@@ -1270,15 +1306,18 @@ const RendererWorker = {
|
|
|
1270
1306
|
handleDebugPaused,
|
|
1271
1307
|
handleDebugResumed,
|
|
1272
1308
|
handleDebugScriptParsed,
|
|
1309
|
+
handleWorkspaceRefresh,
|
|
1273
1310
|
installExtension,
|
|
1274
1311
|
invoke: invoke$2,
|
|
1275
1312
|
invokeAndTransfer,
|
|
1313
|
+
measureTextBlockHeight,
|
|
1276
1314
|
openExtensionSearch,
|
|
1277
1315
|
openExternal,
|
|
1278
1316
|
openNativeFolder,
|
|
1279
1317
|
openUri: openUri$2,
|
|
1280
1318
|
openUrl,
|
|
1281
1319
|
openWidget,
|
|
1320
|
+
readClipBoardText,
|
|
1282
1321
|
readFile,
|
|
1283
1322
|
registerMockRpc,
|
|
1284
1323
|
registerWebViewInterceptor,
|
|
@@ -1290,12 +1329,15 @@ const RendererWorker = {
|
|
|
1290
1329
|
sendMessagePortToEditorWorker,
|
|
1291
1330
|
sendMessagePortToErrorWorker,
|
|
1292
1331
|
sendMessagePortToExtensionHostWorker,
|
|
1332
|
+
sendMessagePortToFileSystemProcess,
|
|
1293
1333
|
sendMessagePortToFileSystemWorker,
|
|
1294
1334
|
sendMessagePortToIconThemeWorker,
|
|
1295
1335
|
sendMessagePortToMarkdownWorker,
|
|
1296
1336
|
sendMessagePortToRendererProcess,
|
|
1297
1337
|
sendMessagePortToSearchProcess,
|
|
1338
|
+
sendMessagePortToSourceControlWorker,
|
|
1298
1339
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1340
|
+
sendMessagePortToTextMeasurementWorker,
|
|
1299
1341
|
set: set$2,
|
|
1300
1342
|
setAdditionalFocus,
|
|
1301
1343
|
setColorTheme: setColorTheme$1,
|
|
@@ -1304,6 +1346,7 @@ const RendererWorker = {
|
|
|
1304
1346
|
setWebViewPort,
|
|
1305
1347
|
setWorkspacePath,
|
|
1306
1348
|
showContextMenu,
|
|
1349
|
+
showContextMenu2,
|
|
1307
1350
|
showErrorDialog: showErrorDialog$2,
|
|
1308
1351
|
showMessageBox,
|
|
1309
1352
|
showSaveFilePicker,
|
|
@@ -1314,14 +1357,14 @@ const RendererWorker = {
|
|
|
1314
1357
|
};
|
|
1315
1358
|
|
|
1316
1359
|
const {
|
|
1360
|
+
closeWidget: closeWidget$1,
|
|
1361
|
+
getFileIcon,
|
|
1362
|
+
getFolderIcon,
|
|
1317
1363
|
invoke: invoke$1,
|
|
1364
|
+
openUri: openUri$1,
|
|
1318
1365
|
set: set$1,
|
|
1319
1366
|
setFocus: setFocus$1,
|
|
1320
|
-
|
|
1321
|
-
showErrorDialog: showErrorDialog$1,
|
|
1322
|
-
openUri: openUri$1,
|
|
1323
|
-
getFileIcon,
|
|
1324
|
-
getFolderIcon
|
|
1367
|
+
showErrorDialog: showErrorDialog$1
|
|
1325
1368
|
} = RendererWorker;
|
|
1326
1369
|
|
|
1327
1370
|
const closeWidget = async id => {
|
|
@@ -1375,10 +1418,11 @@ const create$2 = () => {
|
|
|
1375
1418
|
wrapCommand(fn) {
|
|
1376
1419
|
const wrapped = async (uid, ...args) => {
|
|
1377
1420
|
const {
|
|
1421
|
+
oldState,
|
|
1378
1422
|
newState
|
|
1379
1423
|
} = states[uid];
|
|
1380
1424
|
const newerState = await fn(newState, ...args);
|
|
1381
|
-
if (newState === newerState) {
|
|
1425
|
+
if (oldState === newerState || newState === newerState) {
|
|
1382
1426
|
return;
|
|
1383
1427
|
}
|
|
1384
1428
|
const latest = states[uid];
|
|
@@ -1424,32 +1468,32 @@ const create$2 = () => {
|
|
|
1424
1468
|
};
|
|
1425
1469
|
|
|
1426
1470
|
const {
|
|
1471
|
+
dispose: dispose$1,
|
|
1427
1472
|
get,
|
|
1428
1473
|
set,
|
|
1429
|
-
dispose: dispose$1,
|
|
1430
1474
|
wrapCommand
|
|
1431
1475
|
} = create$2();
|
|
1432
1476
|
|
|
1433
1477
|
const create$1 = ({
|
|
1434
|
-
itemHeight,
|
|
1435
1478
|
headerHeight = 0,
|
|
1479
|
+
itemHeight,
|
|
1436
1480
|
minimumSliderSize = 20
|
|
1437
1481
|
}) => {
|
|
1438
1482
|
return {
|
|
1439
1483
|
deltaY: 0,
|
|
1440
|
-
minLineY: 0,
|
|
1441
|
-
maxLineY: 0,
|
|
1442
1484
|
finalDeltaY: 0,
|
|
1443
|
-
|
|
1485
|
+
focusedIndex: -1,
|
|
1444
1486
|
headerHeight,
|
|
1487
|
+
itemHeight,
|
|
1445
1488
|
items: [],
|
|
1489
|
+
maxLineY: 0,
|
|
1446
1490
|
minimumSliderSize,
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
touchTimeStamp: 0,
|
|
1450
|
-
touchDifference: 0,
|
|
1491
|
+
minLineY: 0,
|
|
1492
|
+
scrollBarActive: false,
|
|
1451
1493
|
scrollBarHeight: 0,
|
|
1452
|
-
|
|
1494
|
+
touchDifference: 0,
|
|
1495
|
+
touchOffsetY: 0,
|
|
1496
|
+
touchTimeStamp: 0
|
|
1453
1497
|
};
|
|
1454
1498
|
};
|
|
1455
1499
|
const getListHeight$1 = (height, headerHeight) => {
|
|
@@ -1462,10 +1506,10 @@ const setDeltaY = (state, deltaY) => {
|
|
|
1462
1506
|
object(state);
|
|
1463
1507
|
number(deltaY);
|
|
1464
1508
|
const {
|
|
1465
|
-
|
|
1466
|
-
items,
|
|
1509
|
+
headerHeight,
|
|
1467
1510
|
height,
|
|
1468
|
-
|
|
1511
|
+
itemHeight,
|
|
1512
|
+
items
|
|
1469
1513
|
} = state;
|
|
1470
1514
|
const listHeight = getListHeight$1(height, headerHeight);
|
|
1471
1515
|
const itemsLength = items.length;
|
|
@@ -1485,8 +1529,8 @@ const setDeltaY = (state, deltaY) => {
|
|
|
1485
1529
|
return {
|
|
1486
1530
|
...state,
|
|
1487
1531
|
deltaY,
|
|
1488
|
-
|
|
1489
|
-
|
|
1532
|
+
maxLineY,
|
|
1533
|
+
minLineY
|
|
1490
1534
|
};
|
|
1491
1535
|
};
|
|
1492
1536
|
const handleWheel = (state, deltaMode, deltaY) => {
|
|
@@ -1498,32 +1542,32 @@ const handleWheel = (state, deltaMode, deltaY) => {
|
|
|
1498
1542
|
|
|
1499
1543
|
const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, workspaceUri) => {
|
|
1500
1544
|
const state = {
|
|
1501
|
-
|
|
1502
|
-
|
|
1545
|
+
cursorOffset: 0,
|
|
1546
|
+
height: 300,
|
|
1503
1547
|
icons: [],
|
|
1504
|
-
|
|
1548
|
+
maxVisibleItems: 10,
|
|
1505
1549
|
picks: [],
|
|
1506
|
-
recentPicks: [],
|
|
1507
1550
|
recentPickIds: Object.create(null),
|
|
1551
|
+
recentPicks: [],
|
|
1552
|
+
state: Default$1,
|
|
1553
|
+
top: 50,
|
|
1554
|
+
uid,
|
|
1555
|
+
uri,
|
|
1508
1556
|
versionId: 0,
|
|
1509
1557
|
warned: [],
|
|
1510
|
-
maxVisibleItems: 10,
|
|
1511
|
-
uri,
|
|
1512
|
-
cursorOffset: 0,
|
|
1513
|
-
height: 300,
|
|
1514
|
-
top: 50,
|
|
1515
1558
|
width: 600,
|
|
1559
|
+
workspaceUri,
|
|
1516
1560
|
...create$1({
|
|
1517
|
-
itemHeight: listItemHeight,
|
|
1518
1561
|
headerHeight: 38,
|
|
1562
|
+
itemHeight: listItemHeight,
|
|
1519
1563
|
minimumSliderSize: minimumSliderSize
|
|
1520
1564
|
}),
|
|
1521
|
-
inputSource: User,
|
|
1522
1565
|
args,
|
|
1566
|
+
fileIconCache: Object.create(null),
|
|
1523
1567
|
focused: false,
|
|
1568
|
+
inputSource: User,
|
|
1524
1569
|
platform,
|
|
1525
|
-
value: ''
|
|
1526
|
-
fileIconCache: Object.create(null)
|
|
1570
|
+
value: ''
|
|
1527
1571
|
};
|
|
1528
1572
|
set(uid, state, state);
|
|
1529
1573
|
};
|
|
@@ -1576,8 +1620,8 @@ const diff = (oldState, newState) => {
|
|
|
1576
1620
|
|
|
1577
1621
|
const diff2 = uid => {
|
|
1578
1622
|
const {
|
|
1579
|
-
|
|
1580
|
-
|
|
1623
|
+
newState,
|
|
1624
|
+
oldState
|
|
1581
1625
|
} = get(uid);
|
|
1582
1626
|
return diff(oldState, newState);
|
|
1583
1627
|
};
|
|
@@ -1597,7 +1641,7 @@ const focusPick$1 = async pick => {
|
|
|
1597
1641
|
|
|
1598
1642
|
const ColorTheme$1 = 0;
|
|
1599
1643
|
const Commands$1 = 1;
|
|
1600
|
-
const Custom = 2;
|
|
1644
|
+
const Custom$1 = 2;
|
|
1601
1645
|
const File$2 = 3;
|
|
1602
1646
|
const GoToLine$2 = 4;
|
|
1603
1647
|
const Help$2 = 5;
|
|
@@ -1607,17 +1651,17 @@ const View$3 = 8;
|
|
|
1607
1651
|
const WorkspaceSymbol$2 = 9;
|
|
1608
1652
|
const EveryThing$1 = 100;
|
|
1609
1653
|
|
|
1610
|
-
const noop$
|
|
1611
|
-
const getFn$
|
|
1654
|
+
const noop$1 = async () => {};
|
|
1655
|
+
const getFn$2 = id => {
|
|
1612
1656
|
switch (id) {
|
|
1613
1657
|
case ColorTheme$1:
|
|
1614
1658
|
return focusPick$1;
|
|
1615
1659
|
default:
|
|
1616
|
-
return noop$
|
|
1660
|
+
return noop$1;
|
|
1617
1661
|
}
|
|
1618
1662
|
};
|
|
1619
1663
|
const focusPick = (id, pick) => {
|
|
1620
|
-
const fn = getFn$
|
|
1664
|
+
const fn = getFn$2(id);
|
|
1621
1665
|
return fn(pick);
|
|
1622
1666
|
};
|
|
1623
1667
|
|
|
@@ -1633,9 +1677,9 @@ const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
|
1633
1677
|
}
|
|
1634
1678
|
if (!(dirent.path in fileIconCache)) {
|
|
1635
1679
|
missingRequests.push({
|
|
1636
|
-
type: dirent.type,
|
|
1637
1680
|
name: dirent.name,
|
|
1638
|
-
path: dirent.path
|
|
1681
|
+
path: dirent.path,
|
|
1682
|
+
type: dirent.type
|
|
1639
1683
|
});
|
|
1640
1684
|
}
|
|
1641
1685
|
}
|
|
@@ -1681,9 +1725,9 @@ const getPath = dirent => {
|
|
|
1681
1725
|
};
|
|
1682
1726
|
const toDirent = pick => {
|
|
1683
1727
|
const dirent = {
|
|
1684
|
-
type: pick.direntType,
|
|
1685
1728
|
name: pick.label,
|
|
1686
|
-
path: pick.uri
|
|
1729
|
+
path: pick.uri,
|
|
1730
|
+
type: pick.direntType
|
|
1687
1731
|
};
|
|
1688
1732
|
return dirent;
|
|
1689
1733
|
};
|
|
@@ -1702,12 +1746,12 @@ const getQuickPickFileIcons = async (items, fileIconCache) => {
|
|
|
1702
1746
|
|
|
1703
1747
|
const focusIndex = async (state, index) => {
|
|
1704
1748
|
const {
|
|
1705
|
-
|
|
1706
|
-
maxVisibleItems,
|
|
1749
|
+
fileIconCache,
|
|
1707
1750
|
items,
|
|
1708
|
-
minLineY,
|
|
1709
1751
|
maxLineY,
|
|
1710
|
-
|
|
1752
|
+
maxVisibleItems,
|
|
1753
|
+
minLineY,
|
|
1754
|
+
providerId
|
|
1711
1755
|
} = state;
|
|
1712
1756
|
await focusPick(providerId, items[index]);
|
|
1713
1757
|
if (index < minLineY + 1) {
|
|
@@ -1715,18 +1759,18 @@ const focusIndex = async (state, index) => {
|
|
|
1715
1759
|
const maxLineY = Math.min(index + maxVisibleItems, items.length - 1);
|
|
1716
1760
|
const sliced = items.slice(minLineY, maxLineY);
|
|
1717
1761
|
const {
|
|
1718
|
-
|
|
1719
|
-
|
|
1762
|
+
icons,
|
|
1763
|
+
newFileIconCache
|
|
1720
1764
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
1721
1765
|
|
|
1722
1766
|
// TODO need to scroll up
|
|
1723
1767
|
return {
|
|
1724
1768
|
...state,
|
|
1725
|
-
|
|
1726
|
-
maxLineY,
|
|
1769
|
+
fileIconCache: newFileIconCache,
|
|
1727
1770
|
focusedIndex: index,
|
|
1728
1771
|
icons,
|
|
1729
|
-
|
|
1772
|
+
maxLineY,
|
|
1773
|
+
minLineY
|
|
1730
1774
|
};
|
|
1731
1775
|
}
|
|
1732
1776
|
if (index >= maxLineY - 1) {
|
|
@@ -1735,27 +1779,27 @@ const focusIndex = async (state, index) => {
|
|
|
1735
1779
|
const minLineY = Math.max(maxLineY - maxVisibleItems, 0);
|
|
1736
1780
|
const sliced = items.slice(minLineY, maxLineY);
|
|
1737
1781
|
const {
|
|
1738
|
-
|
|
1739
|
-
|
|
1782
|
+
icons,
|
|
1783
|
+
newFileIconCache
|
|
1740
1784
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
1741
1785
|
return {
|
|
1742
1786
|
...state,
|
|
1743
|
-
minLineY,
|
|
1744
|
-
maxLineY,
|
|
1745
|
-
focusedIndex: index,
|
|
1746
1787
|
fileIconCache: newFileIconCache,
|
|
1747
|
-
|
|
1788
|
+
focusedIndex: index,
|
|
1789
|
+
icons,
|
|
1790
|
+
maxLineY,
|
|
1791
|
+
minLineY
|
|
1748
1792
|
};
|
|
1749
1793
|
}
|
|
1750
1794
|
const sliced = items.slice(minLineY, maxLineY);
|
|
1751
1795
|
const {
|
|
1752
|
-
|
|
1753
|
-
|
|
1796
|
+
icons,
|
|
1797
|
+
newFileIconCache
|
|
1754
1798
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
1755
1799
|
return {
|
|
1756
1800
|
...state,
|
|
1757
|
-
focusedIndex: index,
|
|
1758
1801
|
fileIconCache: newFileIconCache,
|
|
1802
|
+
focusedIndex: index,
|
|
1759
1803
|
icons
|
|
1760
1804
|
};
|
|
1761
1805
|
};
|
|
@@ -1786,8 +1830,8 @@ const focusLast = state => {
|
|
|
1786
1830
|
|
|
1787
1831
|
const focusNext = state => {
|
|
1788
1832
|
const {
|
|
1789
|
-
|
|
1790
|
-
|
|
1833
|
+
focusedIndex,
|
|
1834
|
+
items
|
|
1791
1835
|
} = state;
|
|
1792
1836
|
const nextIndex = next(items, focusedIndex);
|
|
1793
1837
|
return focusIndex(state, nextIndex);
|
|
@@ -1795,8 +1839,8 @@ const focusNext = state => {
|
|
|
1795
1839
|
|
|
1796
1840
|
const focusPrevious = state => {
|
|
1797
1841
|
const {
|
|
1798
|
-
|
|
1799
|
-
|
|
1842
|
+
focusedIndex,
|
|
1843
|
+
items
|
|
1800
1844
|
} = state;
|
|
1801
1845
|
const previousIndex = previous(items, focusedIndex);
|
|
1802
1846
|
return focusIndex(state, previousIndex);
|
|
@@ -1819,29 +1863,29 @@ const FocusQuickPickInput = 20;
|
|
|
1819
1863
|
|
|
1820
1864
|
const getKeyBindings = () => {
|
|
1821
1865
|
return [{
|
|
1822
|
-
key: Escape,
|
|
1823
|
-
command: 'Viewlet.closeWidget',
|
|
1824
1866
|
args: ['QuickPick'],
|
|
1867
|
+
command: 'Viewlet.closeWidget',
|
|
1868
|
+
key: Escape,
|
|
1825
1869
|
when: FocusQuickPickInput
|
|
1826
1870
|
}, {
|
|
1827
|
-
key: UpArrow,
|
|
1828
1871
|
command: 'QuickPick.focusPrevious',
|
|
1872
|
+
key: UpArrow,
|
|
1829
1873
|
when: FocusQuickPickInput
|
|
1830
1874
|
}, {
|
|
1831
|
-
key: DownArrow,
|
|
1832
1875
|
command: 'QuickPick.focusNext',
|
|
1876
|
+
key: DownArrow,
|
|
1833
1877
|
when: FocusQuickPickInput
|
|
1834
1878
|
}, {
|
|
1835
|
-
key: PageUp,
|
|
1836
1879
|
command: 'QuickPick.focusFirst',
|
|
1880
|
+
key: PageUp,
|
|
1837
1881
|
when: FocusQuickPickInput
|
|
1838
1882
|
}, {
|
|
1839
|
-
key: PageDown,
|
|
1840
1883
|
command: 'QuickPick.focusLast',
|
|
1884
|
+
key: PageDown,
|
|
1841
1885
|
when: FocusQuickPickInput
|
|
1842
1886
|
}, {
|
|
1843
|
-
key: Enter,
|
|
1844
1887
|
command: 'QuickPick.selectCurrentIndex',
|
|
1888
|
+
key: Enter,
|
|
1845
1889
|
when: FocusQuickPickInput
|
|
1846
1890
|
}];
|
|
1847
1891
|
};
|
|
@@ -1852,15 +1896,15 @@ const getNewValueDeleteContentBackward = (value, selectionStart, selectionEnd, d
|
|
|
1852
1896
|
const before = value.slice(0, selectionStart - 1);
|
|
1853
1897
|
const newValue = before + after;
|
|
1854
1898
|
return {
|
|
1855
|
-
|
|
1856
|
-
|
|
1899
|
+
cursorOffset: before.length,
|
|
1900
|
+
newValue
|
|
1857
1901
|
};
|
|
1858
1902
|
}
|
|
1859
1903
|
const before = value.slice(0, selectionStart);
|
|
1860
1904
|
const newValue = before + after;
|
|
1861
1905
|
return {
|
|
1862
|
-
|
|
1863
|
-
|
|
1906
|
+
cursorOffset: selectionStart,
|
|
1907
|
+
newValue
|
|
1864
1908
|
};
|
|
1865
1909
|
};
|
|
1866
1910
|
|
|
@@ -1870,15 +1914,15 @@ const getNewValueDeleteContentForward = (value, selectionStart, selectionEnd, da
|
|
|
1870
1914
|
const after = value.slice(selectionEnd + 1);
|
|
1871
1915
|
const newValue = before + after;
|
|
1872
1916
|
return {
|
|
1873
|
-
|
|
1874
|
-
|
|
1917
|
+
cursorOffset: selectionStart,
|
|
1918
|
+
newValue
|
|
1875
1919
|
};
|
|
1876
1920
|
}
|
|
1877
1921
|
const after = value.slice(selectionEnd);
|
|
1878
1922
|
const newValue = before + after;
|
|
1879
1923
|
return {
|
|
1880
|
-
|
|
1881
|
-
|
|
1924
|
+
cursorOffset: selectionStart,
|
|
1925
|
+
newValue
|
|
1882
1926
|
};
|
|
1883
1927
|
};
|
|
1884
1928
|
|
|
@@ -1897,15 +1941,15 @@ const getNewValueDeleteWordBackward = (value, selectionStart, selectionEnd, data
|
|
|
1897
1941
|
const before = value.slice(0, startIndex);
|
|
1898
1942
|
const newValue = before + after;
|
|
1899
1943
|
return {
|
|
1900
|
-
|
|
1901
|
-
|
|
1944
|
+
cursorOffset: before.length,
|
|
1945
|
+
newValue
|
|
1902
1946
|
};
|
|
1903
1947
|
}
|
|
1904
1948
|
const before = value.slice(0, selectionStart);
|
|
1905
1949
|
const newValue = before + after;
|
|
1906
1950
|
return {
|
|
1907
|
-
|
|
1908
|
-
|
|
1951
|
+
cursorOffset: selectionStart,
|
|
1952
|
+
newValue
|
|
1909
1953
|
};
|
|
1910
1954
|
};
|
|
1911
1955
|
|
|
@@ -1919,15 +1963,15 @@ const getNewValueDeleteWordForward = (value, selectionStart, selectionEnd, data)
|
|
|
1919
1963
|
const after = value.slice(startIndex);
|
|
1920
1964
|
const newValue = before + after;
|
|
1921
1965
|
return {
|
|
1922
|
-
|
|
1923
|
-
|
|
1966
|
+
cursorOffset: before.length,
|
|
1967
|
+
newValue
|
|
1924
1968
|
};
|
|
1925
1969
|
}
|
|
1926
1970
|
const after = value.slice(selectionEnd);
|
|
1927
1971
|
const newValue = before + after;
|
|
1928
1972
|
return {
|
|
1929
|
-
|
|
1930
|
-
|
|
1973
|
+
cursorOffset: selectionStart,
|
|
1974
|
+
newValue
|
|
1931
1975
|
};
|
|
1932
1976
|
};
|
|
1933
1977
|
|
|
@@ -1935,16 +1979,16 @@ const getNewValueInsertText = (value, selectionStart, selectionEnd, data) => {
|
|
|
1935
1979
|
if (selectionStart === value.length) {
|
|
1936
1980
|
const newValue = value + data;
|
|
1937
1981
|
return {
|
|
1938
|
-
newValue,
|
|
1939
|
-
|
|
1982
|
+
cursorOffset: newValue.length,
|
|
1983
|
+
newValue
|
|
1940
1984
|
};
|
|
1941
1985
|
}
|
|
1942
1986
|
const before = value.slice(0, selectionStart);
|
|
1943
1987
|
const after = value.slice(selectionEnd);
|
|
1944
1988
|
const newValue = before + data + after;
|
|
1945
1989
|
return {
|
|
1946
|
-
|
|
1947
|
-
|
|
1990
|
+
cursorOffset: selectionStart + data.length,
|
|
1991
|
+
newValue
|
|
1948
1992
|
};
|
|
1949
1993
|
};
|
|
1950
1994
|
|
|
@@ -1954,8 +1998,8 @@ const getNewValueInsertCompositionText = (value, selectionStart, selectionEnd, d
|
|
|
1954
1998
|
|
|
1955
1999
|
const getNewValueInsertLineBreak = (value, selectionStart, selectionEnd, data) => {
|
|
1956
2000
|
return {
|
|
1957
|
-
|
|
1958
|
-
|
|
2001
|
+
cursorOffset: selectionEnd,
|
|
2002
|
+
newValue: value
|
|
1959
2003
|
};
|
|
1960
2004
|
};
|
|
1961
2005
|
|
|
@@ -1970,21 +2014,21 @@ const InsertFromPaste = 'insertFromPaste';
|
|
|
1970
2014
|
|
|
1971
2015
|
const getNewValueFunction = inputType => {
|
|
1972
2016
|
switch (inputType) {
|
|
1973
|
-
case InsertFromPaste:
|
|
1974
|
-
case InsertText:
|
|
1975
|
-
return getNewValueInsertText;
|
|
1976
2017
|
case DeleteContentBackward:
|
|
1977
2018
|
return getNewValueDeleteContentBackward;
|
|
1978
2019
|
case DeleteContentForward:
|
|
1979
2020
|
return getNewValueDeleteContentForward;
|
|
1980
|
-
case DeleteWordForward:
|
|
1981
|
-
return getNewValueDeleteWordForward;
|
|
1982
2021
|
case DeleteWordBackward:
|
|
1983
2022
|
return getNewValueDeleteWordBackward;
|
|
1984
|
-
case
|
|
1985
|
-
return
|
|
2023
|
+
case DeleteWordForward:
|
|
2024
|
+
return getNewValueDeleteWordForward;
|
|
1986
2025
|
case InsertCompositionText:
|
|
1987
2026
|
return getNewValueInsertCompositionText;
|
|
2027
|
+
case InsertFromPaste:
|
|
2028
|
+
case InsertText:
|
|
2029
|
+
return getNewValueInsertText;
|
|
2030
|
+
case InsertLineBreak:
|
|
2031
|
+
return getNewValueInsertLineBreak;
|
|
1988
2032
|
default:
|
|
1989
2033
|
throw new Error(`unsupported input type ${inputType}`);
|
|
1990
2034
|
}
|
|
@@ -2199,7 +2243,7 @@ const getQuickPickPrefix = value => {
|
|
|
2199
2243
|
return None$1;
|
|
2200
2244
|
};
|
|
2201
2245
|
|
|
2202
|
-
const noop
|
|
2246
|
+
const noop = value => {
|
|
2203
2247
|
return value;
|
|
2204
2248
|
};
|
|
2205
2249
|
const getFilterValueEverything = value => {
|
|
@@ -2207,16 +2251,16 @@ const getFilterValueEverything = value => {
|
|
|
2207
2251
|
const prefixLength = prefix.length;
|
|
2208
2252
|
return value.slice(prefixLength).trim();
|
|
2209
2253
|
};
|
|
2210
|
-
const getFn$
|
|
2254
|
+
const getFn$1 = id => {
|
|
2211
2255
|
switch (id) {
|
|
2212
2256
|
case EveryThing$1:
|
|
2213
2257
|
return getFilterValueEverything;
|
|
2214
2258
|
default:
|
|
2215
|
-
return noop
|
|
2259
|
+
return noop;
|
|
2216
2260
|
}
|
|
2217
2261
|
};
|
|
2218
2262
|
const getFilterValue = (id, value) => {
|
|
2219
|
-
const fn = getFn$
|
|
2263
|
+
const fn = getFn$1(id);
|
|
2220
2264
|
const filterValue = fn(value);
|
|
2221
2265
|
return filterValue;
|
|
2222
2266
|
};
|
|
@@ -2242,21 +2286,21 @@ const getColorThemeNames = async () => {
|
|
|
2242
2286
|
return invoke$1(/* Ajax.getJson */'ColorTheme.getColorThemeNames');
|
|
2243
2287
|
};
|
|
2244
2288
|
|
|
2245
|
-
const toProtoVisibleItem$
|
|
2289
|
+
const toProtoVisibleItem$3 = name => {
|
|
2246
2290
|
const pick = {
|
|
2247
|
-
label: name,
|
|
2248
2291
|
description: '',
|
|
2292
|
+
direntType: 0,
|
|
2249
2293
|
fileIcon: '',
|
|
2250
2294
|
icon: '',
|
|
2295
|
+
label: name,
|
|
2251
2296
|
matches: [],
|
|
2252
|
-
direntType: 0,
|
|
2253
2297
|
uri: ''
|
|
2254
2298
|
};
|
|
2255
2299
|
return pick;
|
|
2256
2300
|
};
|
|
2257
2301
|
const getPicks$c = async searchValue => {
|
|
2258
2302
|
const colorThemeNames = await getColorThemeNames();
|
|
2259
|
-
const picks = colorThemeNames.map(toProtoVisibleItem$
|
|
2303
|
+
const picks = colorThemeNames.map(toProtoVisibleItem$3);
|
|
2260
2304
|
return picks;
|
|
2261
2305
|
};
|
|
2262
2306
|
|
|
@@ -2271,8 +2315,8 @@ const showErrorDialog = async error => {
|
|
|
2271
2315
|
const errorInfo = {
|
|
2272
2316
|
code,
|
|
2273
2317
|
message,
|
|
2274
|
-
|
|
2275
|
-
|
|
2318
|
+
name,
|
|
2319
|
+
stack
|
|
2276
2320
|
};
|
|
2277
2321
|
await showErrorDialog$1(errorInfo);
|
|
2278
2322
|
};
|
|
@@ -2330,18 +2374,19 @@ const getExtensionPicks = async () => {
|
|
|
2330
2374
|
return [];
|
|
2331
2375
|
}
|
|
2332
2376
|
};
|
|
2333
|
-
const toProtoVisibleItem$
|
|
2377
|
+
const toProtoVisibleItem$2 = item => {
|
|
2334
2378
|
const pick = {
|
|
2335
|
-
|
|
2379
|
+
// @ts-ignore
|
|
2380
|
+
args: item.args,
|
|
2336
2381
|
description: '',
|
|
2382
|
+
direntType: 0,
|
|
2337
2383
|
fileIcon: '',
|
|
2338
2384
|
icon: '',
|
|
2339
|
-
matches: [],
|
|
2340
|
-
direntType: 0,
|
|
2341
|
-
uri: '',
|
|
2342
2385
|
// @ts-ignore
|
|
2343
2386
|
id: item.id,
|
|
2344
|
-
|
|
2387
|
+
label: item.label,
|
|
2388
|
+
matches: [],
|
|
2389
|
+
uri: ''
|
|
2345
2390
|
};
|
|
2346
2391
|
// @ts-ignore
|
|
2347
2392
|
return pick;
|
|
@@ -2351,17 +2396,28 @@ const getPicks$b = async () => {
|
|
|
2351
2396
|
const builtinPicks = await getBuiltinPicks();
|
|
2352
2397
|
const extensionPicks = await getExtensionPicks();
|
|
2353
2398
|
const allPicks = [...builtinPicks, ...extensionPicks];
|
|
2354
|
-
const converted = allPicks.map(toProtoVisibleItem$
|
|
2399
|
+
const converted = allPicks.map(toProtoVisibleItem$2);
|
|
2355
2400
|
return converted;
|
|
2356
2401
|
};
|
|
2357
2402
|
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2403
|
+
const toProtoVisibleItem$1 = item => {
|
|
2404
|
+
const {
|
|
2405
|
+
label
|
|
2406
|
+
} = item;
|
|
2407
|
+
return {
|
|
2408
|
+
description: '',
|
|
2409
|
+
direntType: 0,
|
|
2410
|
+
fileIcon: '',
|
|
2411
|
+
icon: '',
|
|
2412
|
+
label,
|
|
2413
|
+
matches: [],
|
|
2414
|
+
uri: ''
|
|
2415
|
+
};
|
|
2360
2416
|
};
|
|
2361
|
-
|
|
2362
|
-
const
|
|
2363
|
-
const
|
|
2364
|
-
return
|
|
2417
|
+
const getPicks$a = async (searchValue, args) => {
|
|
2418
|
+
const items = args[1] || [];
|
|
2419
|
+
const mapped = items.map(toProtoVisibleItem$1);
|
|
2420
|
+
return mapped;
|
|
2365
2421
|
};
|
|
2366
2422
|
|
|
2367
2423
|
const emptyMatches = [];
|
|
@@ -2379,18 +2435,18 @@ const getProtocol = uri => {
|
|
|
2379
2435
|
return '';
|
|
2380
2436
|
};
|
|
2381
2437
|
|
|
2382
|
-
const state = Object.create(null);
|
|
2438
|
+
const state$1 = Object.create(null);
|
|
2383
2439
|
const register = modules => {
|
|
2384
|
-
Object.assign(state, modules);
|
|
2440
|
+
Object.assign(state$1, modules);
|
|
2385
2441
|
};
|
|
2386
|
-
const getFn
|
|
2387
|
-
return state[protocol];
|
|
2442
|
+
const getFn = protocol => {
|
|
2443
|
+
return state$1[protocol];
|
|
2388
2444
|
};
|
|
2389
2445
|
|
|
2390
2446
|
const searchFile$5 = async (path, value, prepare, assetDir) => {
|
|
2391
2447
|
const protocol = getProtocol(path);
|
|
2392
2448
|
// TODO call different providers depending on protocol
|
|
2393
|
-
const fn = getFn
|
|
2449
|
+
const fn = getFn(protocol);
|
|
2394
2450
|
const result = await fn(path, value, prepare, assetDir);
|
|
2395
2451
|
return result;
|
|
2396
2452
|
};
|
|
@@ -2446,52 +2502,52 @@ const getPicks$9 = async searchValue => {
|
|
|
2446
2502
|
|
|
2447
2503
|
const getPicks$8 = async () => {
|
|
2448
2504
|
const picks = [{
|
|
2449
|
-
label: '1',
|
|
2450
2505
|
description: '',
|
|
2451
|
-
|
|
2506
|
+
direntType: None$2,
|
|
2452
2507
|
fileIcon: '',
|
|
2508
|
+
icon: '',
|
|
2509
|
+
label: '1',
|
|
2453
2510
|
matches: [],
|
|
2454
|
-
direntType: None$2,
|
|
2455
2511
|
uri: ''
|
|
2456
2512
|
}, {
|
|
2457
|
-
label: '2',
|
|
2458
2513
|
description: '',
|
|
2459
|
-
|
|
2514
|
+
direntType: None$2,
|
|
2460
2515
|
fileIcon: '',
|
|
2516
|
+
icon: '',
|
|
2517
|
+
label: '2',
|
|
2461
2518
|
matches: [],
|
|
2462
|
-
direntType: None$2,
|
|
2463
2519
|
uri: ''
|
|
2464
2520
|
}, {
|
|
2465
|
-
label: '3',
|
|
2466
2521
|
description: '',
|
|
2467
|
-
|
|
2522
|
+
direntType: None$2,
|
|
2468
2523
|
fileIcon: '',
|
|
2524
|
+
icon: '',
|
|
2525
|
+
label: '3',
|
|
2469
2526
|
matches: [],
|
|
2470
|
-
direntType: None$2,
|
|
2471
2527
|
uri: ''
|
|
2472
2528
|
}, {
|
|
2473
|
-
label: '4',
|
|
2474
2529
|
description: '',
|
|
2475
|
-
|
|
2530
|
+
direntType: None$2,
|
|
2476
2531
|
fileIcon: '',
|
|
2532
|
+
icon: '',
|
|
2533
|
+
label: '4',
|
|
2477
2534
|
matches: [],
|
|
2478
|
-
direntType: None$2,
|
|
2479
2535
|
uri: ''
|
|
2480
2536
|
}, {
|
|
2481
|
-
label: '5',
|
|
2482
2537
|
description: '',
|
|
2483
|
-
|
|
2538
|
+
direntType: None$2,
|
|
2484
2539
|
fileIcon: '',
|
|
2540
|
+
icon: '',
|
|
2541
|
+
label: '5',
|
|
2485
2542
|
matches: [],
|
|
2486
|
-
direntType: None$2,
|
|
2487
2543
|
uri: ''
|
|
2488
2544
|
}, {
|
|
2489
|
-
label: '6',
|
|
2490
2545
|
description: '',
|
|
2491
|
-
|
|
2546
|
+
direntType: None$2,
|
|
2492
2547
|
fileIcon: '',
|
|
2548
|
+
icon: '',
|
|
2549
|
+
label: '6',
|
|
2493
2550
|
matches: [],
|
|
2494
|
-
direntType: None$2,
|
|
2495
2551
|
uri: ''
|
|
2496
2552
|
}];
|
|
2497
2553
|
return picks;
|
|
@@ -2617,12 +2673,12 @@ const getLabel = uri => {
|
|
|
2617
2673
|
};
|
|
2618
2674
|
const toProtoVisibleItem = uri => {
|
|
2619
2675
|
return {
|
|
2620
|
-
label: getLabel(uri),
|
|
2621
2676
|
description: '',
|
|
2677
|
+
direntType: Directory,
|
|
2622
2678
|
fileIcon: '',
|
|
2623
2679
|
icon: '',
|
|
2680
|
+
label: getLabel(uri),
|
|
2624
2681
|
matches: [],
|
|
2625
|
-
direntType: Directory,
|
|
2626
2682
|
uri
|
|
2627
2683
|
};
|
|
2628
2684
|
};
|
|
@@ -2699,12 +2755,16 @@ const selectPick$8 = async item => {
|
|
|
2699
2755
|
return selectPickBuiltin(item);
|
|
2700
2756
|
};
|
|
2701
2757
|
|
|
2758
|
+
const state = {
|
|
2759
|
+
args: []
|
|
2760
|
+
};
|
|
2761
|
+
|
|
2702
2762
|
const selectPick$7 = async pick => {
|
|
2703
2763
|
const {
|
|
2704
2764
|
args
|
|
2705
|
-
} = state
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2765
|
+
} = state;
|
|
2766
|
+
const resolveId = args[2];
|
|
2767
|
+
await invoke$1(`QuickPick.executeCallback`, resolveId, pick);
|
|
2708
2768
|
return {
|
|
2709
2769
|
command: Hide
|
|
2710
2770
|
};
|
|
@@ -2725,18 +2785,14 @@ const selectPick$6 = async pick => {
|
|
|
2725
2785
|
};
|
|
2726
2786
|
};
|
|
2727
2787
|
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2788
|
+
const setCursor = async (rowIndex, columnIndex) => {
|
|
2789
|
+
await invoke$2('Editor.cursorSet', rowIndex, columnIndex);
|
|
2730
2790
|
};
|
|
2731
2791
|
|
|
2732
2792
|
const selectPick$5 = async item => {
|
|
2733
2793
|
const rowIndex = Number.parseInt(item.label);
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
columnIndex: 5
|
|
2737
|
-
};
|
|
2738
|
-
await execute(/* EditorSetCursor.editorSetCursor */'TODO', /* position */position);
|
|
2739
|
-
// TODO put cursor onto that line
|
|
2794
|
+
const columnIndex = 5;
|
|
2795
|
+
await setCursor(rowIndex, columnIndex);
|
|
2740
2796
|
return {
|
|
2741
2797
|
command: Hide
|
|
2742
2798
|
};
|
|
@@ -2797,9 +2853,9 @@ const getSelect = id => {
|
|
|
2797
2853
|
return fn;
|
|
2798
2854
|
};
|
|
2799
2855
|
|
|
2800
|
-
const getPicks = (id, searchValue) => {
|
|
2856
|
+
const getPicks = (id, searchValue, args) => {
|
|
2801
2857
|
const fn = getPicks$1(id);
|
|
2802
|
-
return fn(searchValue);
|
|
2858
|
+
return fn(searchValue, args);
|
|
2803
2859
|
};
|
|
2804
2860
|
|
|
2805
2861
|
const getQuickPickSubProviderId = (id, prefix) => {
|
|
@@ -2809,16 +2865,16 @@ const getQuickPickSubProviderId = (id, prefix) => {
|
|
|
2809
2865
|
switch (prefix) {
|
|
2810
2866
|
case Command:
|
|
2811
2867
|
return Commands$1;
|
|
2812
|
-
case Symbol$1:
|
|
2813
|
-
return Symbol$2;
|
|
2814
|
-
case WorkspaceSymbol$1:
|
|
2815
|
-
return WorkspaceSymbol$2;
|
|
2816
2868
|
case GoToLine$1:
|
|
2817
2869
|
return GoToLine$2;
|
|
2818
|
-
case View$2:
|
|
2819
|
-
return View$3;
|
|
2820
2870
|
case Help$1:
|
|
2821
2871
|
return Help$2;
|
|
2872
|
+
case Symbol$1:
|
|
2873
|
+
return Symbol$2;
|
|
2874
|
+
case View$2:
|
|
2875
|
+
return View$3;
|
|
2876
|
+
case WorkspaceSymbol$1:
|
|
2877
|
+
return WorkspaceSymbol$2;
|
|
2822
2878
|
default:
|
|
2823
2879
|
return File$2;
|
|
2824
2880
|
}
|
|
@@ -2827,40 +2883,41 @@ const getQuickPickSubProviderId = (id, prefix) => {
|
|
|
2827
2883
|
// TODO when user types letters -> no need to query provider again -> just filter existing results
|
|
2828
2884
|
const setValue = async (state, newValue) => {
|
|
2829
2885
|
const {
|
|
2830
|
-
|
|
2831
|
-
value,
|
|
2832
|
-
minLineY,
|
|
2833
|
-
maxLineY,
|
|
2886
|
+
args,
|
|
2834
2887
|
fileIconCache,
|
|
2888
|
+
height,
|
|
2835
2889
|
itemHeight,
|
|
2836
|
-
|
|
2890
|
+
maxLineY,
|
|
2891
|
+
minLineY,
|
|
2892
|
+
providerId,
|
|
2893
|
+
value
|
|
2837
2894
|
} = state;
|
|
2838
2895
|
if (value === newValue) {
|
|
2839
2896
|
return state;
|
|
2840
2897
|
}
|
|
2841
2898
|
const prefix = getQuickPickPrefix(newValue);
|
|
2842
2899
|
const subId = getQuickPickSubProviderId(providerId, prefix);
|
|
2843
|
-
const newPicks = await getPicks(subId, newValue);
|
|
2900
|
+
const newPicks = await getPicks(subId, newValue, args);
|
|
2844
2901
|
const filterValue = getFilterValue(providerId, newValue);
|
|
2845
2902
|
const items = filterQuickPickItems(newPicks, filterValue);
|
|
2846
2903
|
const focusedIndex = items.length === 0 ? -1 : 0;
|
|
2847
2904
|
const sliced = items.slice(minLineY, maxLineY);
|
|
2848
2905
|
const {
|
|
2849
|
-
|
|
2850
|
-
|
|
2906
|
+
icons,
|
|
2907
|
+
newFileIconCache
|
|
2851
2908
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
2852
2909
|
const listHeight = getListHeight(items.length, itemHeight, height);
|
|
2853
2910
|
const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
|
|
2854
2911
|
return {
|
|
2855
2912
|
...state,
|
|
2856
|
-
|
|
2857
|
-
|
|
2913
|
+
fileIconCache: newFileIconCache,
|
|
2914
|
+
finalDeltaY,
|
|
2858
2915
|
focusedIndex,
|
|
2859
|
-
inputSource: Script,
|
|
2860
|
-
value: newValue,
|
|
2861
2916
|
icons,
|
|
2862
|
-
|
|
2863
|
-
|
|
2917
|
+
inputSource: Script,
|
|
2918
|
+
items,
|
|
2919
|
+
picks: newPicks,
|
|
2920
|
+
value: newValue
|
|
2864
2921
|
};
|
|
2865
2922
|
};
|
|
2866
2923
|
|
|
@@ -2885,8 +2942,8 @@ const handleBeforeInput = (state, inputType, data, selectionStart, selectionEnd)
|
|
|
2885
2942
|
value
|
|
2886
2943
|
} = state;
|
|
2887
2944
|
const {
|
|
2888
|
-
|
|
2889
|
-
|
|
2945
|
+
cursorOffset,
|
|
2946
|
+
newValue
|
|
2890
2947
|
} = getNewValue(value, inputType, data, selectionStart, selectionEnd);
|
|
2891
2948
|
return handleInput(state, newValue, cursorOffset, User);
|
|
2892
2949
|
};
|
|
@@ -2919,10 +2976,10 @@ const getPick = (items, index) => {
|
|
|
2919
2976
|
|
|
2920
2977
|
const selectIndex = async (state, index, button = /* left */0) => {
|
|
2921
2978
|
const {
|
|
2922
|
-
minLineY,
|
|
2923
2979
|
items,
|
|
2924
|
-
|
|
2925
|
-
providerId
|
|
2980
|
+
minLineY,
|
|
2981
|
+
providerId,
|
|
2982
|
+
value
|
|
2926
2983
|
} = state;
|
|
2927
2984
|
const actualIndex = index + minLineY;
|
|
2928
2985
|
const pick = getPick(items, actualIndex);
|
|
@@ -2959,9 +3016,9 @@ const selectIndex = async (state, index, button = /* left */0) => {
|
|
|
2959
3016
|
|
|
2960
3017
|
const handleClickAt = (state, x, y) => {
|
|
2961
3018
|
const {
|
|
2962
|
-
top,
|
|
2963
3019
|
headerHeight,
|
|
2964
|
-
itemHeight
|
|
3020
|
+
itemHeight,
|
|
3021
|
+
top
|
|
2965
3022
|
} = state;
|
|
2966
3023
|
const index = getIndex(top, headerHeight, itemHeight, y);
|
|
2967
3024
|
return selectIndex(state, index);
|
|
@@ -2993,20 +3050,23 @@ const Symbol = 'quickPick://symbol';
|
|
|
2993
3050
|
const View = 'quickPick://view';
|
|
2994
3051
|
const Help = 'quickPick://help';
|
|
2995
3052
|
const WorkspaceSymbol = 'quickPick://workspace-symbol';
|
|
3053
|
+
const Custom = 'quickPick://custom';
|
|
2996
3054
|
const GoToLine = 'quickPick://go-to-line';
|
|
2997
3055
|
|
|
2998
3056
|
const getQuickPickProviderId = prefix => {
|
|
2999
3057
|
switch (prefix) {
|
|
3058
|
+
case ColorTheme:
|
|
3059
|
+
return ColorTheme$1;
|
|
3000
3060
|
case Commands:
|
|
3001
|
-
case Symbol:
|
|
3002
|
-
case WorkspaceSymbol:
|
|
3003
3061
|
case EveryThing:
|
|
3004
3062
|
case GoToLine:
|
|
3005
|
-
case View:
|
|
3006
3063
|
case Help:
|
|
3064
|
+
case Symbol:
|
|
3065
|
+
case View:
|
|
3066
|
+
case WorkspaceSymbol:
|
|
3007
3067
|
return EveryThing$1;
|
|
3008
|
-
case
|
|
3009
|
-
return
|
|
3068
|
+
case Custom:
|
|
3069
|
+
return Custom$1;
|
|
3010
3070
|
case Recent:
|
|
3011
3071
|
return Recent$1;
|
|
3012
3072
|
default:
|
|
@@ -3014,37 +3074,19 @@ const getQuickPickProviderId = prefix => {
|
|
|
3014
3074
|
}
|
|
3015
3075
|
};
|
|
3016
3076
|
|
|
3017
|
-
const noop = args => {};
|
|
3018
|
-
const setArgsCustom = args => {
|
|
3019
|
-
state$1.args = args;
|
|
3020
|
-
};
|
|
3021
|
-
const getFn = id => {
|
|
3022
|
-
switch (id) {
|
|
3023
|
-
case Custom:
|
|
3024
|
-
return setArgsCustom;
|
|
3025
|
-
default:
|
|
3026
|
-
return noop;
|
|
3027
|
-
}
|
|
3028
|
-
};
|
|
3029
|
-
const setArgs = (id, args) => {
|
|
3030
|
-
const fn = getFn(id);
|
|
3031
|
-
return fn(args);
|
|
3032
|
-
};
|
|
3033
|
-
|
|
3034
3077
|
const loadContent = async state => {
|
|
3035
3078
|
const {
|
|
3036
|
-
uri,
|
|
3037
3079
|
args,
|
|
3038
3080
|
fileIconCache,
|
|
3081
|
+
height,
|
|
3039
3082
|
itemHeight,
|
|
3040
|
-
|
|
3083
|
+
uri
|
|
3041
3084
|
} = state;
|
|
3042
3085
|
const id = getQuickPickProviderId(uri);
|
|
3043
3086
|
const value = getDefaultValue(id);
|
|
3044
3087
|
const prefix = getQuickPickPrefix(value);
|
|
3045
3088
|
const subId = getQuickPickSubProviderId(id, prefix);
|
|
3046
|
-
|
|
3047
|
-
const newPicks = await getPicks(subId, value);
|
|
3089
|
+
const newPicks = await getPicks(subId, value, args);
|
|
3048
3090
|
array(newPicks);
|
|
3049
3091
|
const filterValue = getFilterValue(id, value);
|
|
3050
3092
|
const items = filterQuickPickItems(newPicks, filterValue);
|
|
@@ -3052,27 +3094,28 @@ const loadContent = async state => {
|
|
|
3052
3094
|
const maxLineY = Math.min(minLineY + state.maxVisibleItems, newPicks.length);
|
|
3053
3095
|
const sliced = newPicks.slice(minLineY, maxLineY);
|
|
3054
3096
|
const {
|
|
3055
|
-
|
|
3056
|
-
|
|
3097
|
+
icons,
|
|
3098
|
+
newFileIconCache
|
|
3057
3099
|
} = await getQuickPickFileIcons(sliced, fileIconCache);
|
|
3058
3100
|
const listHeight = getListHeight(items.length, itemHeight, height);
|
|
3059
3101
|
const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
|
|
3060
3102
|
return {
|
|
3061
3103
|
...state,
|
|
3062
|
-
|
|
3063
|
-
items,
|
|
3064
|
-
focusedIndex: 0,
|
|
3065
|
-
state: Finished,
|
|
3066
|
-
minLineY,
|
|
3067
|
-
maxLineY,
|
|
3068
|
-
value,
|
|
3104
|
+
args,
|
|
3069
3105
|
cursorOffset: value.length,
|
|
3070
|
-
inputSource: Script,
|
|
3071
|
-
focused: true,
|
|
3072
3106
|
fileIconCache: newFileIconCache,
|
|
3107
|
+
finalDeltaY,
|
|
3108
|
+
focused: true,
|
|
3109
|
+
focusedIndex: 0,
|
|
3073
3110
|
icons,
|
|
3111
|
+
inputSource: Script,
|
|
3112
|
+
items,
|
|
3113
|
+
maxLineY,
|
|
3114
|
+
minLineY,
|
|
3115
|
+
picks: newPicks,
|
|
3074
3116
|
providerId: id,
|
|
3075
|
-
|
|
3117
|
+
state: Finished,
|
|
3118
|
+
value
|
|
3076
3119
|
};
|
|
3077
3120
|
};
|
|
3078
3121
|
|
|
@@ -3135,10 +3178,10 @@ const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
|
|
|
3135
3178
|
const sections = getHighlightSections(highlights, visibleItem.label);
|
|
3136
3179
|
return {
|
|
3137
3180
|
...visibleItem,
|
|
3138
|
-
|
|
3139
|
-
setSize,
|
|
3181
|
+
highlights: sections,
|
|
3140
3182
|
isActive: i === focusedIndex,
|
|
3141
|
-
|
|
3183
|
+
posInSet: minLineY + i + 1,
|
|
3184
|
+
setSize
|
|
3142
3185
|
};
|
|
3143
3186
|
});
|
|
3144
3187
|
return visibleItems;
|
|
@@ -3157,12 +3200,12 @@ const createQuickPickViewModel = (oldState, newState) => {
|
|
|
3157
3200
|
const newFocusedIndex = newState.focusedIndex - newState.minLineY;
|
|
3158
3201
|
const itemCount = newState.items.length;
|
|
3159
3202
|
const {
|
|
3160
|
-
itemHeight,
|
|
3161
3203
|
deltaY,
|
|
3162
3204
|
finalDeltaY,
|
|
3163
|
-
minimumSliderSize,
|
|
3164
3205
|
headerHeight,
|
|
3165
|
-
height
|
|
3206
|
+
height,
|
|
3207
|
+
itemHeight,
|
|
3208
|
+
minimumSliderSize
|
|
3166
3209
|
} = newState;
|
|
3167
3210
|
const listHeight = getListHeight(itemCount, itemHeight, height);
|
|
3168
3211
|
const contentHeight = itemCount * itemHeight;
|
|
@@ -3170,16 +3213,16 @@ const createQuickPickViewModel = (oldState, newState) => {
|
|
|
3170
3213
|
const scrollBarY = getScrollBarY(deltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
3171
3214
|
const roundedScrollBarY = Math.round(scrollBarY);
|
|
3172
3215
|
return {
|
|
3173
|
-
visibleItems,
|
|
3174
|
-
value: newState.value,
|
|
3175
3216
|
cursorOffset: newState.cursorOffset,
|
|
3176
3217
|
focused: newState.focused,
|
|
3177
3218
|
height,
|
|
3178
|
-
oldFocusedIndex,
|
|
3179
3219
|
newFocusedIndex,
|
|
3180
|
-
|
|
3220
|
+
oldFocusedIndex,
|
|
3181
3221
|
scrollBarHeight,
|
|
3182
|
-
scrollBarTop: roundedScrollBarY
|
|
3222
|
+
scrollBarTop: roundedScrollBarY,
|
|
3223
|
+
uid: newState.uid,
|
|
3224
|
+
value: newState.value,
|
|
3225
|
+
visibleItems
|
|
3183
3226
|
};
|
|
3184
3227
|
};
|
|
3185
3228
|
|
|
@@ -3267,53 +3310,53 @@ const QuickPickItemActive = 'QuickPickItemActive';
|
|
|
3267
3310
|
const getQuickPickInputVirtualDom = () => {
|
|
3268
3311
|
const ariaLabel = typeNameofCommandToRun();
|
|
3269
3312
|
return {
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3313
|
+
ariaAutoComplete: 'list',
|
|
3314
|
+
ariaExpanded: true,
|
|
3315
|
+
ariaLabel: ariaLabel,
|
|
3273
3316
|
autocapitalize: 'off',
|
|
3274
|
-
|
|
3317
|
+
autocomplete: 'off',
|
|
3275
3318
|
childCount: 0,
|
|
3276
|
-
|
|
3319
|
+
className: InputBox,
|
|
3320
|
+
inputType: 'text',
|
|
3277
3321
|
name: QuickPickInput,
|
|
3278
3322
|
onBeforeInput: HandleBeforeInput,
|
|
3279
3323
|
onBlur: HandleBlur,
|
|
3280
|
-
onInput: HandleInput,
|
|
3281
3324
|
onFocus: HandleFocus,
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3325
|
+
onInput: HandleInput,
|
|
3326
|
+
role: ComboBox,
|
|
3327
|
+
spellcheck: false,
|
|
3328
|
+
type: Input
|
|
3286
3329
|
};
|
|
3287
3330
|
};
|
|
3288
3331
|
|
|
3289
3332
|
const getQuickPickHeaderVirtualDom = () => {
|
|
3290
3333
|
return [{
|
|
3291
|
-
|
|
3334
|
+
childCount: 1,
|
|
3292
3335
|
className: QuickPickHeader,
|
|
3293
|
-
|
|
3336
|
+
type: Div
|
|
3294
3337
|
}, getQuickPickInputVirtualDom()];
|
|
3295
3338
|
};
|
|
3296
3339
|
|
|
3297
3340
|
const getFileIconVirtualDom = icon => {
|
|
3298
3341
|
return {
|
|
3299
|
-
|
|
3342
|
+
childCount: 0,
|
|
3300
3343
|
className: FileIcon,
|
|
3301
|
-
src: icon,
|
|
3302
3344
|
role: None,
|
|
3303
|
-
|
|
3345
|
+
src: icon,
|
|
3346
|
+
type: Img
|
|
3304
3347
|
};
|
|
3305
3348
|
};
|
|
3306
3349
|
|
|
3307
3350
|
const quickPickHighlight = {
|
|
3308
|
-
|
|
3351
|
+
childCount: 1,
|
|
3309
3352
|
className: QuickPickHighlight,
|
|
3310
|
-
|
|
3353
|
+
type: Span
|
|
3311
3354
|
};
|
|
3312
3355
|
const getHighlights = (sections, label) => {
|
|
3313
3356
|
const labelDom = {
|
|
3314
|
-
|
|
3357
|
+
childCount: 0,
|
|
3315
3358
|
className: QuickPickItemLabel,
|
|
3316
|
-
|
|
3359
|
+
type: Div
|
|
3317
3360
|
};
|
|
3318
3361
|
const nodes = [labelDom];
|
|
3319
3362
|
if (sections.length === 0) {
|
|
@@ -3335,22 +3378,22 @@ const getHighlights = (sections, label) => {
|
|
|
3335
3378
|
|
|
3336
3379
|
const getQuickPickItemVirtualDom = visibleItem => {
|
|
3337
3380
|
const {
|
|
3338
|
-
posInSet,
|
|
3339
|
-
label,
|
|
3340
|
-
setSize,
|
|
3341
|
-
isActive,
|
|
3342
3381
|
description,
|
|
3343
|
-
|
|
3382
|
+
fileIcon,
|
|
3344
3383
|
highlights,
|
|
3345
|
-
|
|
3384
|
+
icon,
|
|
3385
|
+
isActive,
|
|
3386
|
+
label,
|
|
3387
|
+
posInSet,
|
|
3388
|
+
setSize
|
|
3346
3389
|
} = visibleItem;
|
|
3347
3390
|
const dom = [{
|
|
3348
|
-
type: Div,
|
|
3349
|
-
className: QuickPickItem,
|
|
3350
|
-
role: Option,
|
|
3351
3391
|
ariaPosInSet: posInSet,
|
|
3352
3392
|
ariaSetSize: setSize,
|
|
3353
|
-
childCount: 1
|
|
3393
|
+
childCount: 1,
|
|
3394
|
+
className: QuickPickItem,
|
|
3395
|
+
role: Option,
|
|
3396
|
+
type: Div
|
|
3354
3397
|
}];
|
|
3355
3398
|
const parent = dom[0];
|
|
3356
3399
|
if (isActive) {
|
|
@@ -3364,9 +3407,9 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
3364
3407
|
} else if (icon) {
|
|
3365
3408
|
parent.childCount++;
|
|
3366
3409
|
dom.push({
|
|
3367
|
-
|
|
3410
|
+
childCount: 0,
|
|
3368
3411
|
className: mergeClassNames(QuickPickMaskIcon, MaskIcon, `MaskIcon${icon}`),
|
|
3369
|
-
|
|
3412
|
+
type: Div
|
|
3370
3413
|
});
|
|
3371
3414
|
}
|
|
3372
3415
|
const highlightDom = getHighlights(highlights, label);
|
|
@@ -3374,9 +3417,9 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
3374
3417
|
if (description) {
|
|
3375
3418
|
parent.childCount++;
|
|
3376
3419
|
dom.push({
|
|
3377
|
-
|
|
3420
|
+
childCount: 1,
|
|
3378
3421
|
className: QuickPickItemDescription,
|
|
3379
|
-
|
|
3422
|
+
type: Div
|
|
3380
3423
|
}, text(description));
|
|
3381
3424
|
}
|
|
3382
3425
|
return dom;
|
|
@@ -3385,13 +3428,13 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
3385
3428
|
const getQuickPickNoResultsVirtualDom = () => {
|
|
3386
3429
|
const noResults$1 = noResults();
|
|
3387
3430
|
return [{
|
|
3388
|
-
|
|
3431
|
+
childCount: 1,
|
|
3389
3432
|
className: mergeClassNames(QuickPickItem, QuickPickItemActive$1, QuickPickStatus),
|
|
3390
|
-
|
|
3433
|
+
type: Div
|
|
3391
3434
|
}, {
|
|
3392
|
-
|
|
3435
|
+
childCount: 1,
|
|
3393
3436
|
className: Label,
|
|
3394
|
-
|
|
3437
|
+
type: Div
|
|
3395
3438
|
}, text(noResults$1)];
|
|
3396
3439
|
};
|
|
3397
3440
|
|
|
@@ -3411,15 +3454,15 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
|
|
|
3411
3454
|
const heightString = px(scrollBarHeight);
|
|
3412
3455
|
const translateString = position(0, scrollBarTop);
|
|
3413
3456
|
return [{
|
|
3414
|
-
|
|
3457
|
+
childCount: 1,
|
|
3415
3458
|
className: mergeClassNames(ScrollBar, ScrollBarSmall),
|
|
3416
|
-
|
|
3459
|
+
type: Div
|
|
3417
3460
|
}, {
|
|
3418
|
-
type: Div,
|
|
3419
|
-
className: ScrollBarThumb,
|
|
3420
3461
|
childCount: 0,
|
|
3462
|
+
className: ScrollBarThumb,
|
|
3421
3463
|
height: heightString,
|
|
3422
|
-
translate: translateString
|
|
3464
|
+
translate: translateString,
|
|
3465
|
+
type: Div
|
|
3423
3466
|
}];
|
|
3424
3467
|
};
|
|
3425
3468
|
|
|
@@ -3427,24 +3470,24 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) =>
|
|
|
3427
3470
|
const quickOpen$1 = quickOpen();
|
|
3428
3471
|
const shouldShowScrollbar = scrollBarHeight > 0;
|
|
3429
3472
|
return [{
|
|
3430
|
-
|
|
3431
|
-
className: mergeClassNames(Viewlet, QuickPick$1),
|
|
3473
|
+
ariaLabel: quickOpen$1,
|
|
3432
3474
|
childCount: 2,
|
|
3475
|
+
className: mergeClassNames(Viewlet, QuickPick$1),
|
|
3433
3476
|
id: QuickPick,
|
|
3434
|
-
|
|
3477
|
+
type: Div
|
|
3435
3478
|
}, ...getQuickPickHeaderVirtualDom(), {
|
|
3436
|
-
|
|
3479
|
+
ariaActivedescendant: QuickPickItemActive,
|
|
3480
|
+
childCount: shouldShowScrollbar ? 2 : 1,
|
|
3437
3481
|
className: mergeClassNames(List, ContainContent),
|
|
3438
3482
|
id: QuickPickItems,
|
|
3439
|
-
role: ListBox,
|
|
3440
|
-
ariaActivedescendant: QuickPickItemActive,
|
|
3441
|
-
onWheel: HandleWheel,
|
|
3442
3483
|
onPointerDown: HandlePointerDown,
|
|
3443
|
-
|
|
3484
|
+
onWheel: HandleWheel,
|
|
3485
|
+
role: ListBox,
|
|
3486
|
+
type: Div
|
|
3444
3487
|
}, {
|
|
3445
|
-
|
|
3488
|
+
childCount: visibleItems.length,
|
|
3446
3489
|
className: mergeClassNames(ListItems, ContainContent),
|
|
3447
|
-
|
|
3490
|
+
type: Div
|
|
3448
3491
|
}, ...getQuickPickItemsVirtualDom(visibleItems), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarTop)];
|
|
3449
3492
|
};
|
|
3450
3493
|
|
|
@@ -3459,18 +3502,18 @@ const renderValue = newState => {
|
|
|
3459
3502
|
|
|
3460
3503
|
const getRenderer = diffType => {
|
|
3461
3504
|
switch (diffType) {
|
|
3462
|
-
case RenderValue:
|
|
3463
|
-
return renderValue;
|
|
3464
|
-
case RenderCursorOffset:
|
|
3465
|
-
return renderCursorOffset;
|
|
3466
|
-
case RenderItems:
|
|
3467
|
-
return renderItems;
|
|
3468
|
-
case RenderFocusedIndex:
|
|
3469
|
-
return renderFocusedIndex;
|
|
3470
3505
|
case Height:
|
|
3471
3506
|
return renderHeight;
|
|
3507
|
+
case RenderCursorOffset:
|
|
3508
|
+
return renderCursorOffset;
|
|
3472
3509
|
case RenderFocus:
|
|
3473
3510
|
return renderFocus;
|
|
3511
|
+
case RenderFocusedIndex:
|
|
3512
|
+
return renderFocusedIndex;
|
|
3513
|
+
case RenderItems:
|
|
3514
|
+
return renderItems;
|
|
3515
|
+
case RenderValue:
|
|
3516
|
+
return renderValue;
|
|
3474
3517
|
default:
|
|
3475
3518
|
throw new Error('unknown renderer');
|
|
3476
3519
|
}
|
|
@@ -3494,8 +3537,8 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
3494
3537
|
|
|
3495
3538
|
const render2 = (uid, diffResult) => {
|
|
3496
3539
|
const {
|
|
3497
|
-
|
|
3498
|
-
|
|
3540
|
+
newState,
|
|
3541
|
+
oldState
|
|
3499
3542
|
} = get(uid);
|
|
3500
3543
|
if (oldState === newState) {
|
|
3501
3544
|
return [];
|
|
@@ -3622,9 +3665,9 @@ const splitLines = lines => {
|
|
|
3622
3665
|
const searchFile = async (path, value, prepare) => {
|
|
3623
3666
|
const ripGrepArgs = getFileSearchRipGrepArgs();
|
|
3624
3667
|
const options = {
|
|
3668
|
+
limit: 9_999_999,
|
|
3625
3669
|
ripGrepArgs,
|
|
3626
|
-
searchPath: path
|
|
3627
|
-
limit: 9_999_999
|
|
3670
|
+
searchPath: path
|
|
3628
3671
|
};
|
|
3629
3672
|
const stdout = await invoke('SearchFile.searchFile', options);
|
|
3630
3673
|
const lines = splitLines(stdout);
|
|
@@ -3632,11 +3675,11 @@ const searchFile = async (path, value, prepare) => {
|
|
|
3632
3675
|
};
|
|
3633
3676
|
|
|
3634
3677
|
const searchModules = {
|
|
3635
|
-
[
|
|
3678
|
+
[Default]: searchFile,
|
|
3636
3679
|
[Fetch]: searchFile$2,
|
|
3637
|
-
[Html]: searchFile$1,
|
|
3638
3680
|
[File]: searchFile,
|
|
3639
|
-
[
|
|
3681
|
+
[Html]: searchFile$1,
|
|
3682
|
+
[Memfs]: searchFile$3
|
|
3640
3683
|
};
|
|
3641
3684
|
|
|
3642
3685
|
const listen = async () => {
|