@lvce-editor/file-search-worker 4.5.0 → 4.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 +204 -224
- package/package.json +1 -1
|
@@ -888,6 +888,32 @@ const Script = 2;
|
|
|
888
888
|
|
|
889
889
|
const minimumSliderSize = 20;
|
|
890
890
|
|
|
891
|
+
const Command = '>';
|
|
892
|
+
const Symbol$1 = '@';
|
|
893
|
+
const WorkspaceSymbol$1 = '#';
|
|
894
|
+
const GoToLine = ':';
|
|
895
|
+
const View$1 = 'view ';
|
|
896
|
+
const None$2 = '';
|
|
897
|
+
|
|
898
|
+
const getQuickPickPrefix = value => {
|
|
899
|
+
if (value.startsWith(Command)) {
|
|
900
|
+
return Command;
|
|
901
|
+
}
|
|
902
|
+
if (value.startsWith(Symbol$1)) {
|
|
903
|
+
return Symbol$1;
|
|
904
|
+
}
|
|
905
|
+
if (value.startsWith(WorkspaceSymbol$1)) {
|
|
906
|
+
return WorkspaceSymbol$1;
|
|
907
|
+
}
|
|
908
|
+
if (value.startsWith(GoToLine)) {
|
|
909
|
+
return GoToLine;
|
|
910
|
+
}
|
|
911
|
+
if (value.startsWith(View$1)) {
|
|
912
|
+
return View$1;
|
|
913
|
+
}
|
|
914
|
+
return None$2;
|
|
915
|
+
};
|
|
916
|
+
|
|
891
917
|
const handleError = async (error, notify = true, prefix = '') => {
|
|
892
918
|
console.error(error);
|
|
893
919
|
};
|
|
@@ -934,7 +960,6 @@ const i18nString = (key, placeholders = emptyObject) => {
|
|
|
934
960
|
};
|
|
935
961
|
|
|
936
962
|
const Files = 'Files';
|
|
937
|
-
const GoToFile = 'Go to file';
|
|
938
963
|
const NoMatchingColorThemesFound = 'No matching color themes found';
|
|
939
964
|
const NoMatchingResults = 'No matching results';
|
|
940
965
|
const NoRecentlyOpenedFoldersFound = 'No recently opened folders found';
|
|
@@ -944,7 +969,6 @@ const NoWorkspaceSymbolsFound = 'no workspace symbols found';
|
|
|
944
969
|
const OpenRecent = 'Open Recent';
|
|
945
970
|
const SelectColorTheme = 'Select Color Theme';
|
|
946
971
|
const SelectToOpen = 'Select to open';
|
|
947
|
-
const ShowAndRunCommands = 'Show And Run Commands';
|
|
948
972
|
const TypeNameOfCommandToRun = 'Type the name of a command to run.';
|
|
949
973
|
const QuickOpen = 'Quick open';
|
|
950
974
|
|
|
@@ -957,18 +981,12 @@ const selectColorTheme = () => {
|
|
|
957
981
|
const typeNameofCommandToRun = () => {
|
|
958
982
|
return i18nString(TypeNameOfCommandToRun);
|
|
959
983
|
};
|
|
960
|
-
const showAndRunCommands = () => {
|
|
961
|
-
return i18nString(ShowAndRunCommands);
|
|
962
|
-
};
|
|
963
984
|
const noMatchingResults = () => {
|
|
964
985
|
return i18nString(NoMatchingResults);
|
|
965
986
|
};
|
|
966
987
|
const files = () => {
|
|
967
988
|
return i18nString(Files);
|
|
968
989
|
};
|
|
969
|
-
const goToFile = () => {
|
|
970
|
-
return i18nString(GoToFile);
|
|
971
|
-
};
|
|
972
990
|
const noResults = () => {
|
|
973
991
|
return i18nString(NoResults);
|
|
974
992
|
};
|
|
@@ -995,12 +1013,6 @@ const name$b = 'command';
|
|
|
995
1013
|
const getPlaceholder$b = () => {
|
|
996
1014
|
return typeNameofCommandToRun();
|
|
997
1015
|
};
|
|
998
|
-
const helpEntries = () => {
|
|
999
|
-
return [{
|
|
1000
|
-
description: showAndRunCommands(),
|
|
1001
|
-
category: 'global commands'
|
|
1002
|
-
}];
|
|
1003
|
-
};
|
|
1004
1016
|
const getLabel$5 = () => {
|
|
1005
1017
|
return '';
|
|
1006
1018
|
};
|
|
@@ -1048,7 +1060,8 @@ const getExtensionPicks = async () => {
|
|
|
1048
1060
|
const getPicks$b = async () => {
|
|
1049
1061
|
const builtinPicks = await getBuiltinPicks();
|
|
1050
1062
|
const extensionPicks = await getExtensionPicks();
|
|
1051
|
-
|
|
1063
|
+
const allPicks = [...builtinPicks, ...extensionPicks];
|
|
1064
|
+
return allPicks;
|
|
1052
1065
|
};
|
|
1053
1066
|
const shouldHide = item => {
|
|
1054
1067
|
if (item.id === 'Viewlet.openWidget' && item.args[0] === 'QuickPick') {
|
|
@@ -1088,7 +1101,7 @@ const selectPick$b = async item => {
|
|
|
1088
1101
|
return selectPickBuiltin(item);
|
|
1089
1102
|
};
|
|
1090
1103
|
const getFilterValue$b = value => {
|
|
1091
|
-
return value;
|
|
1104
|
+
return value.trim();
|
|
1092
1105
|
};
|
|
1093
1106
|
const getPickFilterValue$9 = pick => {
|
|
1094
1107
|
return pick.label;
|
|
@@ -1110,7 +1123,6 @@ const QuickPickEntriesCommand = {
|
|
|
1110
1123
|
getPickLabel: getPickLabel$8,
|
|
1111
1124
|
getPicks: getPicks$b,
|
|
1112
1125
|
getPlaceholder: getPlaceholder$b,
|
|
1113
|
-
helpEntries,
|
|
1114
1126
|
name: name$b,
|
|
1115
1127
|
selectPick: selectPick$b
|
|
1116
1128
|
};
|
|
@@ -1175,14 +1187,6 @@ const getPlaceholder$a = () => {
|
|
|
1175
1187
|
const getLabel$4 = () => {
|
|
1176
1188
|
return files();
|
|
1177
1189
|
};
|
|
1178
|
-
|
|
1179
|
-
// TODO help entries should not be here
|
|
1180
|
-
const getHelpEntries$a = () => {
|
|
1181
|
-
return [{
|
|
1182
|
-
description: goToFile(),
|
|
1183
|
-
category: 'global commands'
|
|
1184
|
-
}];
|
|
1185
|
-
};
|
|
1186
1190
|
const getNoResults$a = () => {
|
|
1187
1191
|
return {
|
|
1188
1192
|
label: noMatchingResults()
|
|
@@ -1258,7 +1262,6 @@ const isPrepared$7 = () => {
|
|
|
1258
1262
|
const QuickPickEntriesFile = {
|
|
1259
1263
|
__proto__: null,
|
|
1260
1264
|
getFilterValue: getFilterValue$a,
|
|
1261
|
-
getHelpEntries: getHelpEntries$a,
|
|
1262
1265
|
getLabel: getLabel$4,
|
|
1263
1266
|
getNoResults: getNoResults$a,
|
|
1264
1267
|
getPickDescription: getPickDescription$8,
|
|
@@ -1281,7 +1284,7 @@ const name$9 = 'goToLine';
|
|
|
1281
1284
|
const getPlaceholder$9 = () => {
|
|
1282
1285
|
return '';
|
|
1283
1286
|
};
|
|
1284
|
-
const getHelpEntries$
|
|
1287
|
+
const getHelpEntries$3 = () => {
|
|
1285
1288
|
return [];
|
|
1286
1289
|
};
|
|
1287
1290
|
const getNoResults$9 = () => {
|
|
@@ -1322,7 +1325,7 @@ const getFilterValue$9 = value => {
|
|
|
1322
1325
|
const QuickPickEntriesGoToLine = {
|
|
1323
1326
|
__proto__: null,
|
|
1324
1327
|
getFilterValue: getFilterValue$9,
|
|
1325
|
-
getHelpEntries: getHelpEntries$
|
|
1328
|
+
getHelpEntries: getHelpEntries$3,
|
|
1326
1329
|
getNoResults: getNoResults$9,
|
|
1327
1330
|
getPicks: getPicks$9,
|
|
1328
1331
|
getPlaceholder: getPlaceholder$9,
|
|
@@ -1330,65 +1333,25 @@ const QuickPickEntriesGoToLine = {
|
|
|
1330
1333
|
selectPick: selectPick$9
|
|
1331
1334
|
};
|
|
1332
1335
|
|
|
1333
|
-
const name$8 = '
|
|
1336
|
+
const name$8 = 'symbol';
|
|
1334
1337
|
const getPlaceholder$8 = () => {
|
|
1335
1338
|
return '';
|
|
1336
1339
|
};
|
|
1337
|
-
const getHelpEntries$8 = () => {
|
|
1338
|
-
return [];
|
|
1339
|
-
};
|
|
1340
1340
|
const getNoResults$8 = () => {
|
|
1341
|
-
return noResults();
|
|
1342
|
-
};
|
|
1343
|
-
const getPicks$8 = async value => {
|
|
1344
|
-
return [];
|
|
1345
|
-
};
|
|
1346
|
-
const selectPick$8 = async item => {
|
|
1347
|
-
return {
|
|
1348
|
-
command: Hide
|
|
1349
|
-
};
|
|
1350
|
-
};
|
|
1351
|
-
const getFilterValue$8 = value => {
|
|
1352
|
-
return value;
|
|
1353
|
-
};
|
|
1354
|
-
const getPickFilterValue$7 = pick => {
|
|
1355
|
-
return pick;
|
|
1356
|
-
};
|
|
1357
|
-
|
|
1358
|
-
const QuickPickNoop = {
|
|
1359
|
-
__proto__: null,
|
|
1360
|
-
getFilterValue: getFilterValue$8,
|
|
1361
|
-
getHelpEntries: getHelpEntries$8,
|
|
1362
|
-
getNoResults: getNoResults$8,
|
|
1363
|
-
getPickFilterValue: getPickFilterValue$7,
|
|
1364
|
-
getPicks: getPicks$8,
|
|
1365
|
-
getPlaceholder: getPlaceholder$8,
|
|
1366
|
-
name: name$8,
|
|
1367
|
-
selectPick: selectPick$8
|
|
1368
|
-
};
|
|
1369
|
-
|
|
1370
|
-
const name$7 = 'symbol';
|
|
1371
|
-
const getPlaceholder$7 = () => {
|
|
1372
|
-
return '';
|
|
1373
|
-
};
|
|
1374
|
-
const getHelpEntries$7 = () => {
|
|
1375
|
-
return [];
|
|
1376
|
-
};
|
|
1377
|
-
const getNoResults$7 = () => {
|
|
1378
1341
|
return {
|
|
1379
1342
|
label: noSymbolFound()
|
|
1380
1343
|
};
|
|
1381
1344
|
};
|
|
1382
|
-
const getPicks$
|
|
1345
|
+
const getPicks$8 = async () => {
|
|
1383
1346
|
const picks = [];
|
|
1384
1347
|
return picks;
|
|
1385
1348
|
};
|
|
1386
|
-
const selectPick$
|
|
1349
|
+
const selectPick$8 = async item => {
|
|
1387
1350
|
return {
|
|
1388
1351
|
command: Hide
|
|
1389
1352
|
};
|
|
1390
1353
|
};
|
|
1391
|
-
const getFilterValue$
|
|
1354
|
+
const getFilterValue$8 = value => {
|
|
1392
1355
|
return value;
|
|
1393
1356
|
};
|
|
1394
1357
|
const state$7 = {};
|
|
@@ -1398,7 +1361,7 @@ const getPickDescription$7 = value => {
|
|
|
1398
1361
|
const isPrepared$6 = () => {
|
|
1399
1362
|
return false;
|
|
1400
1363
|
};
|
|
1401
|
-
const getPickFilterValue$
|
|
1364
|
+
const getPickFilterValue$7 = value => {
|
|
1402
1365
|
return value;
|
|
1403
1366
|
};
|
|
1404
1367
|
const getPickLabel$6 = value => {
|
|
@@ -1410,45 +1373,44 @@ const getPickIcon$6 = value => {
|
|
|
1410
1373
|
|
|
1411
1374
|
const QuickPickEntriesSymbol = {
|
|
1412
1375
|
__proto__: null,
|
|
1413
|
-
getFilterValue: getFilterValue$
|
|
1414
|
-
|
|
1415
|
-
getNoResults: getNoResults$7,
|
|
1376
|
+
getFilterValue: getFilterValue$8,
|
|
1377
|
+
getNoResults: getNoResults$8,
|
|
1416
1378
|
getPickDescription: getPickDescription$7,
|
|
1417
|
-
getPickFilterValue: getPickFilterValue$
|
|
1379
|
+
getPickFilterValue: getPickFilterValue$7,
|
|
1418
1380
|
getPickIcon: getPickIcon$6,
|
|
1419
1381
|
getPickLabel: getPickLabel$6,
|
|
1420
|
-
getPicks: getPicks$
|
|
1421
|
-
getPlaceholder: getPlaceholder$
|
|
1382
|
+
getPicks: getPicks$8,
|
|
1383
|
+
getPlaceholder: getPlaceholder$8,
|
|
1422
1384
|
isPrepared: isPrepared$6,
|
|
1423
|
-
name: name$
|
|
1424
|
-
selectPick: selectPick$
|
|
1385
|
+
name: name$8,
|
|
1386
|
+
selectPick: selectPick$8,
|
|
1425
1387
|
state: state$7
|
|
1426
1388
|
};
|
|
1427
1389
|
|
|
1428
1390
|
// TODO probably not needed
|
|
1429
1391
|
|
|
1430
|
-
const getPlaceholder$
|
|
1392
|
+
const getPlaceholder$7 = () => {
|
|
1431
1393
|
return typeNameofCommandToRun();
|
|
1432
1394
|
};
|
|
1433
|
-
const getHelpEntries$
|
|
1395
|
+
const getHelpEntries$2 = () => {
|
|
1434
1396
|
return undefined;
|
|
1435
1397
|
};
|
|
1436
|
-
const getPicks$
|
|
1398
|
+
const getPicks$7 = async () => {
|
|
1437
1399
|
// const views = ViewService.getViews()
|
|
1438
1400
|
// const picks = views.map(toPick)
|
|
1439
1401
|
// return picks
|
|
1440
1402
|
return [];
|
|
1441
1403
|
};
|
|
1442
|
-
const selectPick$
|
|
1404
|
+
const selectPick$7 = async item => {
|
|
1443
1405
|
// Command.execute(/* openView */ 549, /* viewName */ item.label)
|
|
1444
1406
|
// return {
|
|
1445
1407
|
// command: QuickPickReturnValue.Hide,
|
|
1446
1408
|
// }
|
|
1447
1409
|
};
|
|
1448
|
-
const getFilterValue$
|
|
1410
|
+
const getFilterValue$7 = value => {
|
|
1449
1411
|
return value;
|
|
1450
1412
|
};
|
|
1451
|
-
const getPickFilterValue$
|
|
1413
|
+
const getPickFilterValue$6 = value => {
|
|
1452
1414
|
return value;
|
|
1453
1415
|
};
|
|
1454
1416
|
const getPickLabel$5 = value => {
|
|
@@ -1458,10 +1420,10 @@ const getPickIcon$5 = value => {
|
|
|
1458
1420
|
return '';
|
|
1459
1421
|
};
|
|
1460
1422
|
const state$6 = {};
|
|
1461
|
-
const getNoResults$
|
|
1423
|
+
const getNoResults$7 = () => {
|
|
1462
1424
|
return '';
|
|
1463
1425
|
};
|
|
1464
|
-
const name$
|
|
1426
|
+
const name$7 = '';
|
|
1465
1427
|
const isPrepared$5 = () => {
|
|
1466
1428
|
return true;
|
|
1467
1429
|
};
|
|
@@ -1471,37 +1433,83 @@ const getPickDescription$6 = () => {
|
|
|
1471
1433
|
|
|
1472
1434
|
const QuickPickEntriesView = {
|
|
1473
1435
|
__proto__: null,
|
|
1474
|
-
getFilterValue: getFilterValue$
|
|
1475
|
-
getHelpEntries: getHelpEntries$
|
|
1476
|
-
getNoResults: getNoResults$
|
|
1436
|
+
getFilterValue: getFilterValue$7,
|
|
1437
|
+
getHelpEntries: getHelpEntries$2,
|
|
1438
|
+
getNoResults: getNoResults$7,
|
|
1477
1439
|
getPickDescription: getPickDescription$6,
|
|
1478
|
-
getPickFilterValue: getPickFilterValue$
|
|
1440
|
+
getPickFilterValue: getPickFilterValue$6,
|
|
1479
1441
|
getPickIcon: getPickIcon$5,
|
|
1480
1442
|
getPickLabel: getPickLabel$5,
|
|
1481
|
-
getPicks: getPicks$
|
|
1482
|
-
getPlaceholder: getPlaceholder$
|
|
1443
|
+
getPicks: getPicks$7,
|
|
1444
|
+
getPlaceholder: getPlaceholder$7,
|
|
1483
1445
|
isPrepared: isPrepared$5,
|
|
1484
|
-
name: name$
|
|
1485
|
-
selectPick: selectPick$
|
|
1446
|
+
name: name$7,
|
|
1447
|
+
selectPick: selectPick$7,
|
|
1486
1448
|
state: state$6
|
|
1487
1449
|
};
|
|
1488
1450
|
|
|
1489
|
-
const name$
|
|
1490
|
-
const getPlaceholder$
|
|
1451
|
+
const name$6 = 'workspace-symbol';
|
|
1452
|
+
const getPlaceholder$6 = () => {
|
|
1491
1453
|
return '';
|
|
1492
1454
|
};
|
|
1493
|
-
const
|
|
1494
|
-
return [];
|
|
1495
|
-
};
|
|
1496
|
-
const getNoResults$5 = () => {
|
|
1455
|
+
const getNoResults$6 = () => {
|
|
1497
1456
|
return {
|
|
1498
1457
|
label: noWorkspaceSymbolsFound()
|
|
1499
1458
|
};
|
|
1500
1459
|
};
|
|
1501
|
-
const getPicks$
|
|
1460
|
+
const getPicks$6 = async () => {
|
|
1502
1461
|
const picks = [];
|
|
1503
1462
|
return picks;
|
|
1504
1463
|
};
|
|
1464
|
+
const selectPick$6 = async item => {
|
|
1465
|
+
return {
|
|
1466
|
+
command: Hide
|
|
1467
|
+
};
|
|
1468
|
+
};
|
|
1469
|
+
const getFilterValue$6 = value => {
|
|
1470
|
+
return value;
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
const QuickPickEntriesWorkspaceSymbol = {
|
|
1474
|
+
__proto__: null,
|
|
1475
|
+
getFilterValue: getFilterValue$6,
|
|
1476
|
+
getNoResults: getNoResults$6,
|
|
1477
|
+
getPicks: getPicks$6,
|
|
1478
|
+
getPlaceholder: getPlaceholder$6,
|
|
1479
|
+
name: name$6,
|
|
1480
|
+
selectPick: selectPick$6
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
const getQuickPickProvider = prefix => {
|
|
1484
|
+
// TODO could use enum for prefix
|
|
1485
|
+
// TODO could use regex to extract prefix
|
|
1486
|
+
// TODO or could check first letter char code (less comparisons)
|
|
1487
|
+
switch (prefix) {
|
|
1488
|
+
case Command:
|
|
1489
|
+
return QuickPickEntriesCommand;
|
|
1490
|
+
case Symbol$1:
|
|
1491
|
+
return QuickPickEntriesSymbol;
|
|
1492
|
+
case WorkspaceSymbol$1:
|
|
1493
|
+
return QuickPickEntriesWorkspaceSymbol;
|
|
1494
|
+
case GoToLine:
|
|
1495
|
+
return QuickPickEntriesGoToLine;
|
|
1496
|
+
case View$1:
|
|
1497
|
+
return QuickPickEntriesView;
|
|
1498
|
+
default:
|
|
1499
|
+
return QuickPickEntriesFile;
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
|
|
1503
|
+
const name$5 = 'noop';
|
|
1504
|
+
const getPlaceholder$5 = () => {
|
|
1505
|
+
return '';
|
|
1506
|
+
};
|
|
1507
|
+
const getNoResults$5 = () => {
|
|
1508
|
+
return noResults();
|
|
1509
|
+
};
|
|
1510
|
+
const getPicks$5 = async value => {
|
|
1511
|
+
return [];
|
|
1512
|
+
};
|
|
1505
1513
|
const selectPick$5 = async item => {
|
|
1506
1514
|
return {
|
|
1507
1515
|
command: Hide
|
|
@@ -1510,25 +1518,21 @@ const selectPick$5 = async item => {
|
|
|
1510
1518
|
const getFilterValue$5 = value => {
|
|
1511
1519
|
return value;
|
|
1512
1520
|
};
|
|
1521
|
+
const getPickFilterValue$5 = pick => {
|
|
1522
|
+
return pick;
|
|
1523
|
+
};
|
|
1513
1524
|
|
|
1514
|
-
const
|
|
1525
|
+
const QuickPickNoop = {
|
|
1515
1526
|
__proto__: null,
|
|
1516
1527
|
getFilterValue: getFilterValue$5,
|
|
1517
|
-
getHelpEntries: getHelpEntries$5,
|
|
1518
1528
|
getNoResults: getNoResults$5,
|
|
1529
|
+
getPickFilterValue: getPickFilterValue$5,
|
|
1519
1530
|
getPicks: getPicks$5,
|
|
1520
1531
|
getPlaceholder: getPlaceholder$5,
|
|
1521
1532
|
name: name$5,
|
|
1522
1533
|
selectPick: selectPick$5
|
|
1523
1534
|
};
|
|
1524
1535
|
|
|
1525
|
-
const Command = '>';
|
|
1526
|
-
const Symbol$1 = '@';
|
|
1527
|
-
const WorkspaceSymbol$1 = '#';
|
|
1528
|
-
const GoToLine = ':';
|
|
1529
|
-
const View$1 = 'view ';
|
|
1530
|
-
const None$2 = '';
|
|
1531
|
-
|
|
1532
1536
|
// TODO avoid global variable
|
|
1533
1537
|
|
|
1534
1538
|
const state$5 = {
|
|
@@ -1547,56 +1551,15 @@ const getPlaceholder$4 = () => {
|
|
|
1547
1551
|
const getLabel$3 = () => {
|
|
1548
1552
|
return '';
|
|
1549
1553
|
};
|
|
1550
|
-
const getHelpEntries$4 = () => {
|
|
1551
|
-
return state$5.provider.getHelpEntries();
|
|
1552
|
-
};
|
|
1553
1554
|
const getNoResults$4 = () => {
|
|
1554
1555
|
return state$5.provider.getNoResults();
|
|
1555
1556
|
};
|
|
1556
|
-
const getPrefix = value => {
|
|
1557
|
-
if (value.startsWith(Command)) {
|
|
1558
|
-
return Command;
|
|
1559
|
-
}
|
|
1560
|
-
if (value.startsWith(Symbol$1)) {
|
|
1561
|
-
return Symbol$1;
|
|
1562
|
-
}
|
|
1563
|
-
if (value.startsWith(WorkspaceSymbol$1)) {
|
|
1564
|
-
return WorkspaceSymbol$1;
|
|
1565
|
-
}
|
|
1566
|
-
if (value.startsWith(GoToLine)) {
|
|
1567
|
-
return GoToLine;
|
|
1568
|
-
}
|
|
1569
|
-
if (value.startsWith(View$1)) {
|
|
1570
|
-
return View$1;
|
|
1571
|
-
}
|
|
1572
|
-
return None$2;
|
|
1573
|
-
};
|
|
1574
|
-
const getQuickPickProvider = prefix => {
|
|
1575
|
-
// TODO could use enum for prefix
|
|
1576
|
-
// TODO could use regex to extract prefix
|
|
1577
|
-
// TODO or could check first letter char code (less comparisons)
|
|
1578
|
-
switch (prefix) {
|
|
1579
|
-
case Command:
|
|
1580
|
-
return QuickPickEntriesCommand;
|
|
1581
|
-
case Symbol$1:
|
|
1582
|
-
return QuickPickEntriesSymbol;
|
|
1583
|
-
case WorkspaceSymbol$1:
|
|
1584
|
-
return QuickPickEntriesWorkspaceSymbol;
|
|
1585
|
-
case GoToLine:
|
|
1586
|
-
return QuickPickEntriesGoToLine;
|
|
1587
|
-
case View$1:
|
|
1588
|
-
return QuickPickEntriesView;
|
|
1589
|
-
default:
|
|
1590
|
-
return QuickPickEntriesFile;
|
|
1591
|
-
}
|
|
1592
|
-
};
|
|
1593
1557
|
const getPicks$4 = async value => {
|
|
1594
|
-
const prefix =
|
|
1558
|
+
const prefix = getQuickPickPrefix(value);
|
|
1595
1559
|
|
|
1596
1560
|
// TODO race condition
|
|
1597
1561
|
if (state$5.prefix !== prefix) {
|
|
1598
1562
|
state$5.prefix = prefix;
|
|
1599
|
-
// @ts-ignore
|
|
1600
1563
|
state$5.provider = await getQuickPickProvider(prefix);
|
|
1601
1564
|
}
|
|
1602
1565
|
// TODO this line is a bit duplicated with getFilterValue
|
|
@@ -1617,7 +1580,7 @@ const openView = () => {
|
|
|
1617
1580
|
// show('view ')
|
|
1618
1581
|
};
|
|
1619
1582
|
const getFilterValue$4 = value => {
|
|
1620
|
-
return value.slice(state$5.prefix.length);
|
|
1583
|
+
return value.slice(state$5.prefix.length).trim();
|
|
1621
1584
|
};
|
|
1622
1585
|
const getPickFilterValue$4 = pick => {
|
|
1623
1586
|
const {
|
|
@@ -1676,7 +1639,6 @@ const isPrepared$4 = () => {
|
|
|
1676
1639
|
const QuickPickEntriesEverything = {
|
|
1677
1640
|
__proto__: null,
|
|
1678
1641
|
getFilterValue: getFilterValue$4,
|
|
1679
|
-
getHelpEntries: getHelpEntries$4,
|
|
1680
1642
|
getLabel: getLabel$3,
|
|
1681
1643
|
getNoResults: getNoResults$4,
|
|
1682
1644
|
getPickDescription: getPickDescription$5,
|
|
@@ -1820,6 +1782,60 @@ const create = (uid, uri, listItemHeight, x, y, width, height, platform, args) =
|
|
|
1820
1782
|
set(uid, state, state);
|
|
1821
1783
|
};
|
|
1822
1784
|
|
|
1785
|
+
const RenderItems = 1;
|
|
1786
|
+
const RenderFocus = 2;
|
|
1787
|
+
const RenderValue = 3;
|
|
1788
|
+
const RenderCursorOffset = 7;
|
|
1789
|
+
const RenderFocusedIndex = 8;
|
|
1790
|
+
const Height = 9;
|
|
1791
|
+
|
|
1792
|
+
const diffType$4 = RenderFocus;
|
|
1793
|
+
const isEqual$4 = (oldState, newState) => {
|
|
1794
|
+
return oldState.focused === newState.focused;
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
const diffType$3 = RenderFocusedIndex;
|
|
1798
|
+
const isEqual$3 = (oldState, newState) => {
|
|
1799
|
+
return oldState.focusedIndex === newState.focusedIndex;
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
const diffType$2 = Height;
|
|
1803
|
+
const isEqual$2 = (oldState, newState) => {
|
|
1804
|
+
return oldState.items.length === newState.items.length;
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
const diffType$1 = RenderItems;
|
|
1808
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1809
|
+
return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.focusedIndex === newState.focusedIndex;
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1812
|
+
const diffType = RenderValue;
|
|
1813
|
+
const isEqual = (oldState, newState) => {
|
|
1814
|
+
return newState.inputSource === User || oldState.value === newState.value;
|
|
1815
|
+
};
|
|
1816
|
+
|
|
1817
|
+
const modules = [isEqual$2, isEqual$1, isEqual, isEqual$3, isEqual$4];
|
|
1818
|
+
const numbers = [diffType$2, diffType$1, diffType, diffType$3, diffType$4];
|
|
1819
|
+
|
|
1820
|
+
const diff = (oldState, newState) => {
|
|
1821
|
+
const diffResult = [];
|
|
1822
|
+
for (let i = 0; i < modules.length; i++) {
|
|
1823
|
+
const fn = modules[i];
|
|
1824
|
+
if (!fn(oldState, newState)) {
|
|
1825
|
+
diffResult.push(numbers[i]);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
return diffResult;
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
const diff2 = uid => {
|
|
1832
|
+
const {
|
|
1833
|
+
oldState,
|
|
1834
|
+
newState
|
|
1835
|
+
} = get(uid);
|
|
1836
|
+
return diff(oldState, newState);
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1823
1839
|
const dispose = uid => {
|
|
1824
1840
|
remove(uid);
|
|
1825
1841
|
};
|
|
@@ -2099,7 +2115,7 @@ const focusPrevious = state => {
|
|
|
2099
2115
|
return focusIndex(state, previousIndex);
|
|
2100
2116
|
};
|
|
2101
2117
|
|
|
2102
|
-
const commandIds = ['close', 'dispose', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusPrevious', 'handleBeforeInput', 'handleBlur', 'handleClickAt', 'handleFocus', 'handleInput', 'handleWheel', 'renderEventListeners', 'selectCurrentIndex', 'selectIndex', 'selectItem', 'setValue'];
|
|
2118
|
+
const commandIds = ['close', 'dispose', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusPrevious', 'handleBeforeInput', 'handleBlur', 'handleClickAt', 'diff2', 'handleFocus', 'handleInput', 'handleWheel', 'renderEventListeners', 'selectCurrentIndex', 'selectIndex', 'selectItem', 'setValue'];
|
|
2103
2119
|
|
|
2104
2120
|
const getCommandIds = () => {
|
|
2105
2121
|
return commandIds;
|
|
@@ -2287,12 +2303,16 @@ const getNewValue = (value, inputType, data, selectionStart, selectionEnd) => {
|
|
|
2287
2303
|
|
|
2288
2304
|
// TODO when user types letters -> no need to query provider again -> just filter existing results
|
|
2289
2305
|
const setValue = async (state, newValue) => {
|
|
2290
|
-
|
|
2306
|
+
const {
|
|
2307
|
+
value,
|
|
2308
|
+
provider
|
|
2309
|
+
} = state;
|
|
2310
|
+
if (value === newValue) {
|
|
2291
2311
|
return state;
|
|
2292
2312
|
}
|
|
2293
|
-
const newPicks = await
|
|
2294
|
-
const filterValue =
|
|
2295
|
-
const items = filterQuickPickItems(newPicks, filterValue,
|
|
2313
|
+
const newPicks = await provider.getPicks(newValue);
|
|
2314
|
+
const filterValue = provider.getFilterValue(newValue);
|
|
2315
|
+
const items = filterQuickPickItems(newPicks, filterValue, provider);
|
|
2296
2316
|
const focusedIndex = items.length === 0 ? -1 : 0;
|
|
2297
2317
|
return {
|
|
2298
2318
|
...state,
|
|
@@ -2331,7 +2351,7 @@ const handleBeforeInput = (state, inputType, data, selectionStart, selectionEnd)
|
|
|
2331
2351
|
return handleInput(state, newValue, cursorOffset, User);
|
|
2332
2352
|
};
|
|
2333
2353
|
|
|
2334
|
-
const handleBlur
|
|
2354
|
+
const handleBlur = async state => {
|
|
2335
2355
|
// TODO fix virtual dom diffing so that input isn't destroyed and loses focus when rerendering
|
|
2336
2356
|
// await CloseWidget.closeWidget(state.uid)
|
|
2337
2357
|
return state;
|
|
@@ -2398,7 +2418,7 @@ const setFocus = async focusKey => {
|
|
|
2398
2418
|
await invoke$1('Focus.setFocus', focusKey);
|
|
2399
2419
|
};
|
|
2400
2420
|
|
|
2401
|
-
const
|
|
2421
|
+
const handleFocus = async state => {
|
|
2402
2422
|
// TODO fix virtual dom diffing so that input isn't destroyed and loses focus when rerendering
|
|
2403
2423
|
await setFocus(FocusQuickPickInput);
|
|
2404
2424
|
// await CloseWidget.closeWidget(state.uid)
|
|
@@ -2440,7 +2460,6 @@ const loadContent = async state => {
|
|
|
2440
2460
|
}
|
|
2441
2461
|
const newPicks = await provider.getPicks(value);
|
|
2442
2462
|
array(newPicks);
|
|
2443
|
-
// @ts-ignore
|
|
2444
2463
|
const filterValue = provider.getFilterValue(value);
|
|
2445
2464
|
const items = filterQuickPickItems(newPicks, filterValue, provider);
|
|
2446
2465
|
// @ts-ignore
|
|
@@ -2475,9 +2494,6 @@ const getPlaceholder$3 = () => {
|
|
|
2475
2494
|
const getLabel$2 = () => {
|
|
2476
2495
|
return openRecent();
|
|
2477
2496
|
};
|
|
2478
|
-
const getHelpEntries$3 = () => {
|
|
2479
|
-
return [];
|
|
2480
|
-
};
|
|
2481
2497
|
const getNoResults$3 = () => {
|
|
2482
2498
|
return {
|
|
2483
2499
|
label: noRecentlyOpenedFoldersFound()
|
|
@@ -2538,7 +2554,6 @@ const name$3 = '';
|
|
|
2538
2554
|
const QuickPickEntriesOpenRecent = {
|
|
2539
2555
|
__proto__: null,
|
|
2540
2556
|
getFilterValue: getFilterValue$3,
|
|
2541
|
-
getHelpEntries: getHelpEntries$3,
|
|
2542
2557
|
getLabel: getLabel$2,
|
|
2543
2558
|
getNoResults: getNoResults$3,
|
|
2544
2559
|
getPickDescription: getPickDescription$4,
|
|
@@ -2657,13 +2672,6 @@ const createQuickPickViewModel = async (oldState, newState) => {
|
|
|
2657
2672
|
};
|
|
2658
2673
|
};
|
|
2659
2674
|
|
|
2660
|
-
const RenderItems = 1;
|
|
2661
|
-
const RenderFocus = 2;
|
|
2662
|
-
const RenderValue = 3;
|
|
2663
|
-
const RenderCursorOffset = 7;
|
|
2664
|
-
const RenderFocusedIndex = 8;
|
|
2665
|
-
const Height = 9;
|
|
2666
|
-
|
|
2667
2675
|
const SetCursorOffset = 'setCursorOffset';
|
|
2668
2676
|
const SetFocusedIndex = 'setFocusedIndex';
|
|
2669
2677
|
const SetItemsHeight = 'setItemsHeight';
|
|
@@ -3066,43 +3074,14 @@ const applyRender = async (oldState, newState, diffResult) => {
|
|
|
3066
3074
|
return commands;
|
|
3067
3075
|
};
|
|
3068
3076
|
|
|
3069
|
-
const
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
const
|
|
3076
|
-
return
|
|
3077
|
-
};
|
|
3078
|
-
|
|
3079
|
-
const diffType$2 = Height;
|
|
3080
|
-
const isEqual$2 = (oldState, newState) => {
|
|
3081
|
-
return oldState.items.length === newState.items.length;
|
|
3082
|
-
};
|
|
3083
|
-
|
|
3084
|
-
const diffType$1 = RenderItems;
|
|
3085
|
-
const isEqual$1 = (oldState, newState) => {
|
|
3086
|
-
return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.focusedIndex === newState.focusedIndex;
|
|
3087
|
-
};
|
|
3088
|
-
|
|
3089
|
-
const diffType = RenderValue;
|
|
3090
|
-
const isEqual = (oldState, newState) => {
|
|
3091
|
-
return newState.inputSource === User || oldState.value === newState.value;
|
|
3092
|
-
};
|
|
3093
|
-
|
|
3094
|
-
const modules = [isEqual$2, isEqual$1, isEqual, isEqual$3, isEqual$4];
|
|
3095
|
-
const numbers = [diffType$2, diffType$1, diffType, diffType$3, diffType$4];
|
|
3096
|
-
|
|
3097
|
-
const diff = (oldState, newState) => {
|
|
3098
|
-
const diffResult = [];
|
|
3099
|
-
for (let i = 0; i < modules.length; i++) {
|
|
3100
|
-
const fn = modules[i];
|
|
3101
|
-
if (!fn(oldState, newState)) {
|
|
3102
|
-
diffResult.push(numbers[i]);
|
|
3103
|
-
}
|
|
3104
|
-
}
|
|
3105
|
-
return diffResult;
|
|
3077
|
+
const render2 = async (uid, diffResult) => {
|
|
3078
|
+
const {
|
|
3079
|
+
oldState,
|
|
3080
|
+
newState
|
|
3081
|
+
} = get(uid);
|
|
3082
|
+
set(uid, oldState, newState);
|
|
3083
|
+
const commands = applyRender(oldState, newState, diffResult);
|
|
3084
|
+
return commands;
|
|
3106
3085
|
};
|
|
3107
3086
|
|
|
3108
3087
|
const doRender = async uid => {
|
|
@@ -3165,6 +3144,9 @@ const wrapCommand = fn => {
|
|
|
3165
3144
|
newState
|
|
3166
3145
|
} = get(uid);
|
|
3167
3146
|
const newerState = await fn(newState, ...args);
|
|
3147
|
+
if (newState === newerState) {
|
|
3148
|
+
return;
|
|
3149
|
+
}
|
|
3168
3150
|
set(uid, newState, newerState);
|
|
3169
3151
|
};
|
|
3170
3152
|
return wrapped;
|
|
@@ -3174,6 +3156,7 @@ const commandMap = {
|
|
|
3174
3156
|
'QuickPick.addMenuEntries': add,
|
|
3175
3157
|
'QuickPick.close': close,
|
|
3176
3158
|
'QuickPick.create2': create,
|
|
3159
|
+
'QuickPick.diff2': diff2,
|
|
3177
3160
|
'QuickPick.dispose': dispose,
|
|
3178
3161
|
'QuickPick.focusFirst': wrapCommand(focusFirst),
|
|
3179
3162
|
'QuickPick.focusIndex': wrapCommand(focusIndex),
|
|
@@ -3183,14 +3166,14 @@ const commandMap = {
|
|
|
3183
3166
|
'QuickPick.getCommandIds': getCommandIds,
|
|
3184
3167
|
'QuickPick.getKeyBindings': getKeyBindings,
|
|
3185
3168
|
'QuickPick.handleBeforeInput': wrapCommand(handleBeforeInput),
|
|
3186
|
-
'QuickPick.handleBlur': wrapCommand(handleBlur
|
|
3169
|
+
'QuickPick.handleBlur': wrapCommand(handleBlur),
|
|
3187
3170
|
'QuickPick.handleClickAt': wrapCommand(handleClickAt),
|
|
3188
|
-
'QuickPick.handleFocus': wrapCommand(
|
|
3171
|
+
'QuickPick.handleFocus': wrapCommand(handleFocus),
|
|
3189
3172
|
'QuickPick.handleInput': wrapCommand(handleInput),
|
|
3190
3173
|
'QuickPick.handleWheel': wrapCommand(handleWheel),
|
|
3191
3174
|
'QuickPick.loadContent': wrapCommand(loadContent),
|
|
3192
3175
|
'QuickPick.loadEntries2': load,
|
|
3193
|
-
'QuickPick.
|
|
3176
|
+
'QuickPick.render2': render2,
|
|
3194
3177
|
'QuickPick.renderEventListeners': renderEventListeners,
|
|
3195
3178
|
'QuickPick.selectCurrentIndex': wrapCommand(selectCurrentIndex),
|
|
3196
3179
|
'QuickPick.selectIndex': wrapCommand(selectIndex),
|
|
@@ -3198,6 +3181,7 @@ const commandMap = {
|
|
|
3198
3181
|
'QuickPick.setDeltaY': wrapCommand(setDeltaY),
|
|
3199
3182
|
'QuickPick.setValue': wrapCommand(setValue),
|
|
3200
3183
|
// deprecated
|
|
3184
|
+
'QuickPick.render': doRender,
|
|
3201
3185
|
'SearchFile.filter': filterQuickPickItems,
|
|
3202
3186
|
'SearchFile.searchFile': searchFile$5,
|
|
3203
3187
|
'QuickPick.loadEntries': loadQuickPickEntries
|
|
@@ -3254,7 +3238,7 @@ const isPrepared$2 = () => {
|
|
|
3254
3238
|
return false;
|
|
3255
3239
|
};
|
|
3256
3240
|
const name$2 = '';
|
|
3257
|
-
const getHelpEntries$
|
|
3241
|
+
const getHelpEntries$1 = () => {
|
|
3258
3242
|
return [];
|
|
3259
3243
|
};
|
|
3260
3244
|
|
|
@@ -3262,7 +3246,7 @@ const QuickPickEntriesColorTheme = {
|
|
|
3262
3246
|
__proto__: null,
|
|
3263
3247
|
focusPick,
|
|
3264
3248
|
getFilterValue: getFilterValue$2,
|
|
3265
|
-
getHelpEntries: getHelpEntries$
|
|
3249
|
+
getHelpEntries: getHelpEntries$1,
|
|
3266
3250
|
getLabel: getLabel$1,
|
|
3267
3251
|
getNoResults: getNoResults$2,
|
|
3268
3252
|
getPickDescription: getPickDescription$2,
|
|
@@ -3302,7 +3286,7 @@ const getLabel = () => {
|
|
|
3302
3286
|
};
|
|
3303
3287
|
|
|
3304
3288
|
// TODO help entries should not be here
|
|
3305
|
-
const getHelpEntries
|
|
3289
|
+
const getHelpEntries = () => {
|
|
3306
3290
|
return [];
|
|
3307
3291
|
};
|
|
3308
3292
|
const getNoResults$1 = () => {
|
|
@@ -3358,7 +3342,7 @@ const isPrepared$1 = () => {
|
|
|
3358
3342
|
const QuickPickEntriesCustom = {
|
|
3359
3343
|
__proto__: null,
|
|
3360
3344
|
getFilterValue: getFilterValue$1,
|
|
3361
|
-
getHelpEntries
|
|
3345
|
+
getHelpEntries,
|
|
3362
3346
|
getLabel,
|
|
3363
3347
|
getNoResults: getNoResults$1,
|
|
3364
3348
|
getPickDescription: getPickDescription$1,
|
|
@@ -3378,9 +3362,6 @@ const name = 'number';
|
|
|
3378
3362
|
const getPlaceholder = () => {
|
|
3379
3363
|
return '';
|
|
3380
3364
|
};
|
|
3381
|
-
const getHelpEntries = () => {
|
|
3382
|
-
return [];
|
|
3383
|
-
};
|
|
3384
3365
|
const getNoResults = () => {
|
|
3385
3366
|
return {
|
|
3386
3367
|
label: noMatchingResults()
|
|
@@ -3438,7 +3419,6 @@ const isPrepared = () => {
|
|
|
3438
3419
|
const QuickPickEntriesNumber = {
|
|
3439
3420
|
__proto__: null,
|
|
3440
3421
|
getFilterValue,
|
|
3441
|
-
getHelpEntries,
|
|
3442
3422
|
getNoResults,
|
|
3443
3423
|
getPickDescription,
|
|
3444
3424
|
getPickFilterValue,
|