@lvce-editor/file-search-worker 6.2.0 → 6.5.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.
@@ -553,7 +553,7 @@ const getParentStack = error => {
553
553
  return parentStack;
554
554
  };
555
555
  const MethodNotFound = -32601;
556
- const Custom$1 = -32001;
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$1,
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$1,
705
+ code: Custom$2,
706
706
  // @ts-ignore
707
707
  message: error.message,
708
708
  data: error
@@ -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
- closeWidget: closeWidget$1,
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
- itemHeight,
1485
+ focusedIndex: -1,
1444
1486
  headerHeight,
1487
+ itemHeight,
1445
1488
  items: [],
1489
+ maxLineY: 0,
1446
1490
  minimumSliderSize,
1447
- focusedIndex: -1,
1448
- touchOffsetY: 0,
1449
- touchTimeStamp: 0,
1450
- touchDifference: 0,
1491
+ minLineY: 0,
1492
+ scrollBarActive: false,
1451
1493
  scrollBarHeight: 0,
1452
- scrollBarActive: false
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
- itemHeight,
1466
- items,
1509
+ headerHeight,
1467
1510
  height,
1468
- headerHeight
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
- minLineY,
1489
- maxLineY
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
- workspaceUri,
1502
- uid,
1545
+ cursorOffset: 0,
1546
+ height: 300,
1503
1547
  icons: [],
1504
- state: Default$1,
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
- oldState,
1580
- newState
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$2 = async () => {};
1611
- const getFn$3 = id => {
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$2;
1660
+ return noop$1;
1617
1661
  }
1618
1662
  };
1619
1663
  const focusPick = (id, pick) => {
1620
- const fn = getFn$3(id);
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
- providerId,
1706
- maxVisibleItems,
1749
+ fileIconCache,
1707
1750
  items,
1708
- minLineY,
1709
1751
  maxLineY,
1710
- fileIconCache
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
- newFileIconCache,
1719
- icons
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
- minLineY,
1726
- maxLineY,
1769
+ fileIconCache: newFileIconCache,
1727
1770
  focusedIndex: index,
1728
1771
  icons,
1729
- fileIconCache: newFileIconCache
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
- newFileIconCache,
1739
- icons
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
- icons
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
- newFileIconCache,
1753
- icons
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
- items,
1790
- focusedIndex
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
- items,
1799
- focusedIndex
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
- newValue,
1856
- cursorOffset: before.length
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
- newValue,
1863
- cursorOffset: selectionStart
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
- newValue,
1874
- cursorOffset: selectionStart
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
- newValue,
1881
- cursorOffset: selectionStart
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
- newValue,
1901
- cursorOffset: before.length
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
- newValue,
1908
- cursorOffset: selectionStart
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
- newValue,
1923
- cursorOffset: before.length
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
- newValue,
1930
- cursorOffset: selectionStart
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
- cursorOffset: newValue.length
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
- newValue,
1947
- cursorOffset: selectionStart + data.length
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
- newValue: value,
1958
- cursorOffset: selectionEnd
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 InsertLineBreak:
1985
- return getNewValueInsertLineBreak;
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$1 = value => {
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$2 = id => {
2254
+ const getFn$1 = id => {
2211
2255
  switch (id) {
2212
2256
  case EveryThing$1:
2213
2257
  return getFilterValueEverything;
2214
2258
  default:
2215
- return noop$1;
2259
+ return noop;
2216
2260
  }
2217
2261
  };
2218
2262
  const getFilterValue = (id, value) => {
2219
- const fn = getFn$2(id);
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$2 = name => {
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$2);
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
- stack,
2275
- name
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$1 = item => {
2377
+ const toProtoVisibleItem$2 = item => {
2334
2378
  const pick = {
2335
- label: item.label,
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
- args: item.args
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$1);
2399
+ const converted = allPicks.map(toProtoVisibleItem$2);
2355
2400
  return converted;
2356
2401
  };
2357
2402
 
2358
- const state$1 = {
2359
- args: []
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 getPicks$a = async searchValue => {
2363
- const items = state$1.args[1] || [];
2364
- return items;
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$1 = protocol => {
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$1(protocol);
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
- icon: '',
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
- icon: '',
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
- icon: '',
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
- icon: '',
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
- icon: '',
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
- icon: '',
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
  };
@@ -2651,18 +2707,20 @@ const KeepOpen = '';
2651
2707
 
2652
2708
  const selectPick$9 = async pick => {
2653
2709
  const id = pick.label;
2654
- await setColorTheme(/* colorThemeId */id);
2710
+ await setColorTheme(id);
2655
2711
  return {
2656
2712
  command: Hide
2657
2713
  };
2658
2714
  };
2659
2715
 
2716
+ const hideIds = ['AutoUpdater.checkForUpdates'];
2660
2717
  const shouldHide = item => {
2661
- if (item.id === 'Viewlet.openWidget' && item.args[0] === 'QuickPick') {
2718
+ if (hideIds.includes(item.id) || item.id === 'Viewlet.openWidget' && item.args[0] === 'QuickPick') {
2662
2719
  return false;
2663
2720
  }
2664
2721
  return true;
2665
2722
  };
2723
+
2666
2724
  const selectPickBuiltin = async item => {
2667
2725
  const args = item.args || [];
2668
2726
  // TODO ids should be all numbers for efficiency -> also directly can call command
@@ -2697,12 +2755,16 @@ const selectPick$8 = async item => {
2697
2755
  return selectPickBuiltin(item);
2698
2756
  };
2699
2757
 
2758
+ const state = {
2759
+ args: []
2760
+ };
2761
+
2700
2762
  const selectPick$7 = async pick => {
2701
2763
  const {
2702
2764
  args
2703
- } = state$1;
2704
- const resolve = args[2];
2705
- resolve(pick);
2765
+ } = state;
2766
+ const resolveId = args[2];
2767
+ await invoke$1(`QuickPick.executeCallback`, resolveId, pick);
2706
2768
  return {
2707
2769
  command: Hide
2708
2770
  };
@@ -2730,8 +2792,8 @@ const execute = async (method, ...params) => {
2730
2792
  const selectPick$5 = async item => {
2731
2793
  const rowIndex = Number.parseInt(item.label);
2732
2794
  const position = {
2733
- rowIndex,
2734
- columnIndex: 5
2795
+ columnIndex: 5,
2796
+ rowIndex
2735
2797
  };
2736
2798
  await execute(/* EditorSetCursor.editorSetCursor */'TODO', /* position */position);
2737
2799
  // TODO put cursor onto that line
@@ -2795,9 +2857,9 @@ const getSelect = id => {
2795
2857
  return fn;
2796
2858
  };
2797
2859
 
2798
- const getPicks = (id, searchValue) => {
2860
+ const getPicks = (id, searchValue, args) => {
2799
2861
  const fn = getPicks$1(id);
2800
- return fn(searchValue);
2862
+ return fn(searchValue, args);
2801
2863
  };
2802
2864
 
2803
2865
  const getQuickPickSubProviderId = (id, prefix) => {
@@ -2807,16 +2869,16 @@ const getQuickPickSubProviderId = (id, prefix) => {
2807
2869
  switch (prefix) {
2808
2870
  case Command:
2809
2871
  return Commands$1;
2810
- case Symbol$1:
2811
- return Symbol$2;
2812
- case WorkspaceSymbol$1:
2813
- return WorkspaceSymbol$2;
2814
2872
  case GoToLine$1:
2815
2873
  return GoToLine$2;
2816
- case View$2:
2817
- return View$3;
2818
2874
  case Help$1:
2819
2875
  return Help$2;
2876
+ case Symbol$1:
2877
+ return Symbol$2;
2878
+ case View$2:
2879
+ return View$3;
2880
+ case WorkspaceSymbol$1:
2881
+ return WorkspaceSymbol$2;
2820
2882
  default:
2821
2883
  return File$2;
2822
2884
  }
@@ -2825,40 +2887,41 @@ const getQuickPickSubProviderId = (id, prefix) => {
2825
2887
  // TODO when user types letters -> no need to query provider again -> just filter existing results
2826
2888
  const setValue = async (state, newValue) => {
2827
2889
  const {
2828
- providerId,
2829
- value,
2830
- minLineY,
2831
- maxLineY,
2890
+ args,
2832
2891
  fileIconCache,
2892
+ height,
2833
2893
  itemHeight,
2834
- height
2894
+ maxLineY,
2895
+ minLineY,
2896
+ providerId,
2897
+ value
2835
2898
  } = state;
2836
2899
  if (value === newValue) {
2837
2900
  return state;
2838
2901
  }
2839
2902
  const prefix = getQuickPickPrefix(newValue);
2840
2903
  const subId = getQuickPickSubProviderId(providerId, prefix);
2841
- const newPicks = await getPicks(subId, newValue);
2904
+ const newPicks = await getPicks(subId, newValue, args);
2842
2905
  const filterValue = getFilterValue(providerId, newValue);
2843
2906
  const items = filterQuickPickItems(newPicks, filterValue);
2844
2907
  const focusedIndex = items.length === 0 ? -1 : 0;
2845
2908
  const sliced = items.slice(minLineY, maxLineY);
2846
2909
  const {
2847
- newFileIconCache,
2848
- icons
2910
+ icons,
2911
+ newFileIconCache
2849
2912
  } = await getQuickPickFileIcons(sliced, fileIconCache);
2850
2913
  const listHeight = getListHeight(items.length, itemHeight, height);
2851
2914
  const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
2852
2915
  return {
2853
2916
  ...state,
2854
- picks: newPicks,
2855
- items,
2917
+ fileIconCache: newFileIconCache,
2918
+ finalDeltaY,
2856
2919
  focusedIndex,
2857
- inputSource: Script,
2858
- value: newValue,
2859
2920
  icons,
2860
- fileIconCache: newFileIconCache,
2861
- finalDeltaY
2921
+ inputSource: Script,
2922
+ items,
2923
+ picks: newPicks,
2924
+ value: newValue
2862
2925
  };
2863
2926
  };
2864
2927
 
@@ -2883,8 +2946,8 @@ const handleBeforeInput = (state, inputType, data, selectionStart, selectionEnd)
2883
2946
  value
2884
2947
  } = state;
2885
2948
  const {
2886
- newValue,
2887
- cursorOffset
2949
+ cursorOffset,
2950
+ newValue
2888
2951
  } = getNewValue(value, inputType, data, selectionStart, selectionEnd);
2889
2952
  return handleInput(state, newValue, cursorOffset, User);
2890
2953
  };
@@ -2917,10 +2980,10 @@ const getPick = (items, index) => {
2917
2980
 
2918
2981
  const selectIndex = async (state, index, button = /* left */0) => {
2919
2982
  const {
2920
- minLineY,
2921
2983
  items,
2922
- value,
2923
- providerId
2984
+ minLineY,
2985
+ providerId,
2986
+ value
2924
2987
  } = state;
2925
2988
  const actualIndex = index + minLineY;
2926
2989
  const pick = getPick(items, actualIndex);
@@ -2957,9 +3020,9 @@ const selectIndex = async (state, index, button = /* left */0) => {
2957
3020
 
2958
3021
  const handleClickAt = (state, x, y) => {
2959
3022
  const {
2960
- top,
2961
3023
  headerHeight,
2962
- itemHeight
3024
+ itemHeight,
3025
+ top
2963
3026
  } = state;
2964
3027
  const index = getIndex(top, headerHeight, itemHeight, y);
2965
3028
  return selectIndex(state, index);
@@ -2991,20 +3054,23 @@ const Symbol = 'quickPick://symbol';
2991
3054
  const View = 'quickPick://view';
2992
3055
  const Help = 'quickPick://help';
2993
3056
  const WorkspaceSymbol = 'quickPick://workspace-symbol';
3057
+ const Custom = 'quickPick://custom';
2994
3058
  const GoToLine = 'quickPick://go-to-line';
2995
3059
 
2996
3060
  const getQuickPickProviderId = prefix => {
2997
3061
  switch (prefix) {
3062
+ case ColorTheme:
3063
+ return ColorTheme$1;
2998
3064
  case Commands:
2999
- case Symbol:
3000
- case WorkspaceSymbol:
3001
3065
  case EveryThing:
3002
3066
  case GoToLine:
3003
- case View:
3004
3067
  case Help:
3068
+ case Symbol:
3069
+ case View:
3070
+ case WorkspaceSymbol:
3005
3071
  return EveryThing$1;
3006
- case ColorTheme:
3007
- return ColorTheme$1;
3072
+ case Custom:
3073
+ return Custom$1;
3008
3074
  case Recent:
3009
3075
  return Recent$1;
3010
3076
  default:
@@ -3012,37 +3078,19 @@ const getQuickPickProviderId = prefix => {
3012
3078
  }
3013
3079
  };
3014
3080
 
3015
- const noop = args => {};
3016
- const setArgsCustom = args => {
3017
- state$1.args = args;
3018
- };
3019
- const getFn = id => {
3020
- switch (id) {
3021
- case Custom:
3022
- return setArgsCustom;
3023
- default:
3024
- return noop;
3025
- }
3026
- };
3027
- const setArgs = (id, args) => {
3028
- const fn = getFn(id);
3029
- return fn(args);
3030
- };
3031
-
3032
3081
  const loadContent = async state => {
3033
3082
  const {
3034
- uri,
3035
3083
  args,
3036
3084
  fileIconCache,
3085
+ height,
3037
3086
  itemHeight,
3038
- height
3087
+ uri
3039
3088
  } = state;
3040
3089
  const id = getQuickPickProviderId(uri);
3041
3090
  const value = getDefaultValue(id);
3042
3091
  const prefix = getQuickPickPrefix(value);
3043
3092
  const subId = getQuickPickSubProviderId(id, prefix);
3044
- setArgs(subId, args);
3045
- const newPicks = await getPicks(subId, value);
3093
+ const newPicks = await getPicks(subId, value, args);
3046
3094
  array(newPicks);
3047
3095
  const filterValue = getFilterValue(id, value);
3048
3096
  const items = filterQuickPickItems(newPicks, filterValue);
@@ -3050,27 +3098,28 @@ const loadContent = async state => {
3050
3098
  const maxLineY = Math.min(minLineY + state.maxVisibleItems, newPicks.length);
3051
3099
  const sliced = newPicks.slice(minLineY, maxLineY);
3052
3100
  const {
3053
- newFileIconCache,
3054
- icons
3101
+ icons,
3102
+ newFileIconCache
3055
3103
  } = await getQuickPickFileIcons(sliced, fileIconCache);
3056
3104
  const listHeight = getListHeight(items.length, itemHeight, height);
3057
3105
  const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
3058
3106
  return {
3059
3107
  ...state,
3060
- picks: newPicks,
3061
- items,
3062
- focusedIndex: 0,
3063
- state: Finished,
3064
- minLineY,
3065
- maxLineY,
3066
- value,
3108
+ args,
3067
3109
  cursorOffset: value.length,
3068
- inputSource: Script,
3069
- focused: true,
3070
3110
  fileIconCache: newFileIconCache,
3111
+ finalDeltaY,
3112
+ focused: true,
3113
+ focusedIndex: 0,
3071
3114
  icons,
3115
+ inputSource: Script,
3116
+ items,
3117
+ maxLineY,
3118
+ minLineY,
3119
+ picks: newPicks,
3072
3120
  providerId: id,
3073
- finalDeltaY
3121
+ state: Finished,
3122
+ value
3074
3123
  };
3075
3124
  };
3076
3125
 
@@ -3133,10 +3182,10 @@ const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
3133
3182
  const sections = getHighlightSections(highlights, visibleItem.label);
3134
3183
  return {
3135
3184
  ...visibleItem,
3136
- posInSet: minLineY + i + 1,
3137
- setSize,
3185
+ highlights: sections,
3138
3186
  isActive: i === focusedIndex,
3139
- highlights: sections
3187
+ posInSet: minLineY + i + 1,
3188
+ setSize
3140
3189
  };
3141
3190
  });
3142
3191
  return visibleItems;
@@ -3155,12 +3204,12 @@ const createQuickPickViewModel = (oldState, newState) => {
3155
3204
  const newFocusedIndex = newState.focusedIndex - newState.minLineY;
3156
3205
  const itemCount = newState.items.length;
3157
3206
  const {
3158
- itemHeight,
3159
3207
  deltaY,
3160
3208
  finalDeltaY,
3161
- minimumSliderSize,
3162
3209
  headerHeight,
3163
- height
3210
+ height,
3211
+ itemHeight,
3212
+ minimumSliderSize
3164
3213
  } = newState;
3165
3214
  const listHeight = getListHeight(itemCount, itemHeight, height);
3166
3215
  const contentHeight = itemCount * itemHeight;
@@ -3168,16 +3217,16 @@ const createQuickPickViewModel = (oldState, newState) => {
3168
3217
  const scrollBarY = getScrollBarY(deltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
3169
3218
  const roundedScrollBarY = Math.round(scrollBarY);
3170
3219
  return {
3171
- visibleItems,
3172
- value: newState.value,
3173
3220
  cursorOffset: newState.cursorOffset,
3174
3221
  focused: newState.focused,
3175
3222
  height,
3176
- oldFocusedIndex,
3177
3223
  newFocusedIndex,
3178
- uid: newState.uid,
3224
+ oldFocusedIndex,
3179
3225
  scrollBarHeight,
3180
- scrollBarTop: roundedScrollBarY
3226
+ scrollBarTop: roundedScrollBarY,
3227
+ uid: newState.uid,
3228
+ value: newState.value,
3229
+ visibleItems
3181
3230
  };
3182
3231
  };
3183
3232
 
@@ -3265,53 +3314,53 @@ const QuickPickItemActive = 'QuickPickItemActive';
3265
3314
  const getQuickPickInputVirtualDom = () => {
3266
3315
  const ariaLabel = typeNameofCommandToRun();
3267
3316
  return {
3268
- type: Input,
3269
- className: InputBox,
3270
- spellcheck: false,
3317
+ ariaAutoComplete: 'list',
3318
+ ariaExpanded: true,
3319
+ ariaLabel: ariaLabel,
3271
3320
  autocapitalize: 'off',
3272
- inputType: 'text',
3321
+ autocomplete: 'off',
3273
3322
  childCount: 0,
3274
- role: ComboBox,
3323
+ className: InputBox,
3324
+ inputType: 'text',
3275
3325
  name: QuickPickInput,
3276
3326
  onBeforeInput: HandleBeforeInput,
3277
3327
  onBlur: HandleBlur,
3278
- onInput: HandleInput,
3279
3328
  onFocus: HandleFocus,
3280
- ariaLabel: ariaLabel,
3281
- ariaAutoComplete: 'list',
3282
- ariaExpanded: true,
3283
- autocomplete: 'off'
3329
+ onInput: HandleInput,
3330
+ role: ComboBox,
3331
+ spellcheck: false,
3332
+ type: Input
3284
3333
  };
3285
3334
  };
3286
3335
 
3287
3336
  const getQuickPickHeaderVirtualDom = () => {
3288
3337
  return [{
3289
- type: Div,
3338
+ childCount: 1,
3290
3339
  className: QuickPickHeader,
3291
- childCount: 1
3340
+ type: Div
3292
3341
  }, getQuickPickInputVirtualDom()];
3293
3342
  };
3294
3343
 
3295
3344
  const getFileIconVirtualDom = icon => {
3296
3345
  return {
3297
- type: Img,
3346
+ childCount: 0,
3298
3347
  className: FileIcon,
3299
- src: icon,
3300
3348
  role: None,
3301
- childCount: 0
3349
+ src: icon,
3350
+ type: Img
3302
3351
  };
3303
3352
  };
3304
3353
 
3305
3354
  const quickPickHighlight = {
3306
- type: Span,
3355
+ childCount: 1,
3307
3356
  className: QuickPickHighlight,
3308
- childCount: 1
3357
+ type: Span
3309
3358
  };
3310
3359
  const getHighlights = (sections, label) => {
3311
3360
  const labelDom = {
3312
- type: Div,
3361
+ childCount: 0,
3313
3362
  className: QuickPickItemLabel,
3314
- childCount: 0
3363
+ type: Div
3315
3364
  };
3316
3365
  const nodes = [labelDom];
3317
3366
  if (sections.length === 0) {
@@ -3333,22 +3382,22 @@ const getHighlights = (sections, label) => {
3333
3382
 
3334
3383
  const getQuickPickItemVirtualDom = visibleItem => {
3335
3384
  const {
3336
- posInSet,
3337
- label,
3338
- setSize,
3339
- isActive,
3340
3385
  description,
3341
- icon,
3386
+ fileIcon,
3342
3387
  highlights,
3343
- fileIcon
3388
+ icon,
3389
+ isActive,
3390
+ label,
3391
+ posInSet,
3392
+ setSize
3344
3393
  } = visibleItem;
3345
3394
  const dom = [{
3346
- type: Div,
3347
- className: QuickPickItem,
3348
- role: Option,
3349
3395
  ariaPosInSet: posInSet,
3350
3396
  ariaSetSize: setSize,
3351
- childCount: 1
3397
+ childCount: 1,
3398
+ className: QuickPickItem,
3399
+ role: Option,
3400
+ type: Div
3352
3401
  }];
3353
3402
  const parent = dom[0];
3354
3403
  if (isActive) {
@@ -3362,9 +3411,9 @@ const getQuickPickItemVirtualDom = visibleItem => {
3362
3411
  } else if (icon) {
3363
3412
  parent.childCount++;
3364
3413
  dom.push({
3365
- type: Div,
3414
+ childCount: 0,
3366
3415
  className: mergeClassNames(QuickPickMaskIcon, MaskIcon, `MaskIcon${icon}`),
3367
- childCount: 0
3416
+ type: Div
3368
3417
  });
3369
3418
  }
3370
3419
  const highlightDom = getHighlights(highlights, label);
@@ -3372,9 +3421,9 @@ const getQuickPickItemVirtualDom = visibleItem => {
3372
3421
  if (description) {
3373
3422
  parent.childCount++;
3374
3423
  dom.push({
3375
- type: Div,
3424
+ childCount: 1,
3376
3425
  className: QuickPickItemDescription,
3377
- childCount: 1
3426
+ type: Div
3378
3427
  }, text(description));
3379
3428
  }
3380
3429
  return dom;
@@ -3383,13 +3432,13 @@ const getQuickPickItemVirtualDom = visibleItem => {
3383
3432
  const getQuickPickNoResultsVirtualDom = () => {
3384
3433
  const noResults$1 = noResults();
3385
3434
  return [{
3386
- type: Div,
3435
+ childCount: 1,
3387
3436
  className: mergeClassNames(QuickPickItem, QuickPickItemActive$1, QuickPickStatus),
3388
- childCount: 1
3437
+ type: Div
3389
3438
  }, {
3390
- type: Div,
3439
+ childCount: 1,
3391
3440
  className: Label,
3392
- childCount: 1
3441
+ type: Div
3393
3442
  }, text(noResults$1)];
3394
3443
  };
3395
3444
 
@@ -3409,15 +3458,15 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3409
3458
  const heightString = px(scrollBarHeight);
3410
3459
  const translateString = position(0, scrollBarTop);
3411
3460
  return [{
3412
- type: Div,
3461
+ childCount: 1,
3413
3462
  className: mergeClassNames(ScrollBar, ScrollBarSmall),
3414
- childCount: 1
3463
+ type: Div
3415
3464
  }, {
3416
- type: Div,
3417
- className: ScrollBarThumb,
3418
3465
  childCount: 0,
3466
+ className: ScrollBarThumb,
3419
3467
  height: heightString,
3420
- translate: translateString
3468
+ translate: translateString,
3469
+ type: Div
3421
3470
  }];
3422
3471
  };
3423
3472
 
@@ -3425,24 +3474,24 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) =>
3425
3474
  const quickOpen$1 = quickOpen();
3426
3475
  const shouldShowScrollbar = scrollBarHeight > 0;
3427
3476
  return [{
3428
- type: Div,
3429
- className: mergeClassNames(Viewlet, QuickPick$1),
3477
+ ariaLabel: quickOpen$1,
3430
3478
  childCount: 2,
3479
+ className: mergeClassNames(Viewlet, QuickPick$1),
3431
3480
  id: QuickPick,
3432
- ariaLabel: quickOpen$1
3481
+ type: Div
3433
3482
  }, ...getQuickPickHeaderVirtualDom(), {
3434
- type: Div,
3483
+ ariaActivedescendant: QuickPickItemActive,
3484
+ childCount: shouldShowScrollbar ? 2 : 1,
3435
3485
  className: mergeClassNames(List, ContainContent),
3436
3486
  id: QuickPickItems,
3437
- role: ListBox,
3438
- ariaActivedescendant: QuickPickItemActive,
3439
- onWheel: HandleWheel,
3440
3487
  onPointerDown: HandlePointerDown,
3441
- childCount: shouldShowScrollbar ? 2 : 1
3488
+ onWheel: HandleWheel,
3489
+ role: ListBox,
3490
+ type: Div
3442
3491
  }, {
3443
- type: Div,
3492
+ childCount: visibleItems.length,
3444
3493
  className: mergeClassNames(ListItems, ContainContent),
3445
- childCount: visibleItems.length
3494
+ type: Div
3446
3495
  }, ...getQuickPickItemsVirtualDom(visibleItems), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarTop)];
3447
3496
  };
3448
3497
 
@@ -3457,18 +3506,18 @@ const renderValue = newState => {
3457
3506
 
3458
3507
  const getRenderer = diffType => {
3459
3508
  switch (diffType) {
3460
- case RenderValue:
3461
- return renderValue;
3462
- case RenderCursorOffset:
3463
- return renderCursorOffset;
3464
- case RenderItems:
3465
- return renderItems;
3466
- case RenderFocusedIndex:
3467
- return renderFocusedIndex;
3468
3509
  case Height:
3469
3510
  return renderHeight;
3511
+ case RenderCursorOffset:
3512
+ return renderCursorOffset;
3470
3513
  case RenderFocus:
3471
3514
  return renderFocus;
3515
+ case RenderFocusedIndex:
3516
+ return renderFocusedIndex;
3517
+ case RenderItems:
3518
+ return renderItems;
3519
+ case RenderValue:
3520
+ return renderValue;
3472
3521
  default:
3473
3522
  throw new Error('unknown renderer');
3474
3523
  }
@@ -3492,8 +3541,8 @@ const applyRender = (oldState, newState, diffResult) => {
3492
3541
 
3493
3542
  const render2 = (uid, diffResult) => {
3494
3543
  const {
3495
- oldState,
3496
- newState
3544
+ newState,
3545
+ oldState
3497
3546
  } = get(uid);
3498
3547
  if (oldState === newState) {
3499
3548
  return [];
@@ -3620,9 +3669,9 @@ const splitLines = lines => {
3620
3669
  const searchFile = async (path, value, prepare) => {
3621
3670
  const ripGrepArgs = getFileSearchRipGrepArgs();
3622
3671
  const options = {
3672
+ limit: 9_999_999,
3623
3673
  ripGrepArgs,
3624
- searchPath: path,
3625
- limit: 9_999_999
3674
+ searchPath: path
3626
3675
  };
3627
3676
  const stdout = await invoke('SearchFile.searchFile', options);
3628
3677
  const lines = splitLines(stdout);
@@ -3630,11 +3679,11 @@ const searchFile = async (path, value, prepare) => {
3630
3679
  };
3631
3680
 
3632
3681
  const searchModules = {
3633
- [Memfs]: searchFile$3,
3682
+ [Default]: searchFile,
3634
3683
  [Fetch]: searchFile$2,
3635
- [Html]: searchFile$1,
3636
3684
  [File]: searchFile,
3637
- [Default]: searchFile
3685
+ [Html]: searchFile$1,
3686
+ [Memfs]: searchFile$3
3638
3687
  };
3639
3688
 
3640
3689
  const listen = async () => {