@lvce-editor/file-search-worker 6.3.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
  };
@@ -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$1;
2706
- const resolve = args[2];
2707
- resolve(pick);
2765
+ } = state;
2766
+ const resolveId = args[2];
2767
+ await invoke$1(`QuickPick.executeCallback`, resolveId, pick);
2708
2768
  return {
2709
2769
  command: Hide
2710
2770
  };
@@ -2732,8 +2792,8 @@ const execute = async (method, ...params) => {
2732
2792
  const selectPick$5 = async item => {
2733
2793
  const rowIndex = Number.parseInt(item.label);
2734
2794
  const position = {
2735
- rowIndex,
2736
- columnIndex: 5
2795
+ columnIndex: 5,
2796
+ rowIndex
2737
2797
  };
2738
2798
  await execute(/* EditorSetCursor.editorSetCursor */'TODO', /* position */position);
2739
2799
  // TODO put cursor onto that line
@@ -2797,9 +2857,9 @@ const getSelect = id => {
2797
2857
  return fn;
2798
2858
  };
2799
2859
 
2800
- const getPicks = (id, searchValue) => {
2860
+ const getPicks = (id, searchValue, args) => {
2801
2861
  const fn = getPicks$1(id);
2802
- return fn(searchValue);
2862
+ return fn(searchValue, args);
2803
2863
  };
2804
2864
 
2805
2865
  const getQuickPickSubProviderId = (id, prefix) => {
@@ -2809,16 +2869,16 @@ const getQuickPickSubProviderId = (id, prefix) => {
2809
2869
  switch (prefix) {
2810
2870
  case Command:
2811
2871
  return Commands$1;
2812
- case Symbol$1:
2813
- return Symbol$2;
2814
- case WorkspaceSymbol$1:
2815
- return WorkspaceSymbol$2;
2816
2872
  case GoToLine$1:
2817
2873
  return GoToLine$2;
2818
- case View$2:
2819
- return View$3;
2820
2874
  case Help$1:
2821
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;
2822
2882
  default:
2823
2883
  return File$2;
2824
2884
  }
@@ -2827,40 +2887,41 @@ const getQuickPickSubProviderId = (id, prefix) => {
2827
2887
  // TODO when user types letters -> no need to query provider again -> just filter existing results
2828
2888
  const setValue = async (state, newValue) => {
2829
2889
  const {
2830
- providerId,
2831
- value,
2832
- minLineY,
2833
- maxLineY,
2890
+ args,
2834
2891
  fileIconCache,
2892
+ height,
2835
2893
  itemHeight,
2836
- height
2894
+ maxLineY,
2895
+ minLineY,
2896
+ providerId,
2897
+ value
2837
2898
  } = state;
2838
2899
  if (value === newValue) {
2839
2900
  return state;
2840
2901
  }
2841
2902
  const prefix = getQuickPickPrefix(newValue);
2842
2903
  const subId = getQuickPickSubProviderId(providerId, prefix);
2843
- const newPicks = await getPicks(subId, newValue);
2904
+ const newPicks = await getPicks(subId, newValue, args);
2844
2905
  const filterValue = getFilterValue(providerId, newValue);
2845
2906
  const items = filterQuickPickItems(newPicks, filterValue);
2846
2907
  const focusedIndex = items.length === 0 ? -1 : 0;
2847
2908
  const sliced = items.slice(minLineY, maxLineY);
2848
2909
  const {
2849
- newFileIconCache,
2850
- icons
2910
+ icons,
2911
+ newFileIconCache
2851
2912
  } = await getQuickPickFileIcons(sliced, fileIconCache);
2852
2913
  const listHeight = getListHeight(items.length, itemHeight, height);
2853
2914
  const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
2854
2915
  return {
2855
2916
  ...state,
2856
- picks: newPicks,
2857
- items,
2917
+ fileIconCache: newFileIconCache,
2918
+ finalDeltaY,
2858
2919
  focusedIndex,
2859
- inputSource: Script,
2860
- value: newValue,
2861
2920
  icons,
2862
- fileIconCache: newFileIconCache,
2863
- finalDeltaY
2921
+ inputSource: Script,
2922
+ items,
2923
+ picks: newPicks,
2924
+ value: newValue
2864
2925
  };
2865
2926
  };
2866
2927
 
@@ -2885,8 +2946,8 @@ const handleBeforeInput = (state, inputType, data, selectionStart, selectionEnd)
2885
2946
  value
2886
2947
  } = state;
2887
2948
  const {
2888
- newValue,
2889
- cursorOffset
2949
+ cursorOffset,
2950
+ newValue
2890
2951
  } = getNewValue(value, inputType, data, selectionStart, selectionEnd);
2891
2952
  return handleInput(state, newValue, cursorOffset, User);
2892
2953
  };
@@ -2919,10 +2980,10 @@ const getPick = (items, index) => {
2919
2980
 
2920
2981
  const selectIndex = async (state, index, button = /* left */0) => {
2921
2982
  const {
2922
- minLineY,
2923
2983
  items,
2924
- value,
2925
- providerId
2984
+ minLineY,
2985
+ providerId,
2986
+ value
2926
2987
  } = state;
2927
2988
  const actualIndex = index + minLineY;
2928
2989
  const pick = getPick(items, actualIndex);
@@ -2959,9 +3020,9 @@ const selectIndex = async (state, index, button = /* left */0) => {
2959
3020
 
2960
3021
  const handleClickAt = (state, x, y) => {
2961
3022
  const {
2962
- top,
2963
3023
  headerHeight,
2964
- itemHeight
3024
+ itemHeight,
3025
+ top
2965
3026
  } = state;
2966
3027
  const index = getIndex(top, headerHeight, itemHeight, y);
2967
3028
  return selectIndex(state, index);
@@ -2993,20 +3054,23 @@ const Symbol = 'quickPick://symbol';
2993
3054
  const View = 'quickPick://view';
2994
3055
  const Help = 'quickPick://help';
2995
3056
  const WorkspaceSymbol = 'quickPick://workspace-symbol';
3057
+ const Custom = 'quickPick://custom';
2996
3058
  const GoToLine = 'quickPick://go-to-line';
2997
3059
 
2998
3060
  const getQuickPickProviderId = prefix => {
2999
3061
  switch (prefix) {
3062
+ case ColorTheme:
3063
+ return ColorTheme$1;
3000
3064
  case Commands:
3001
- case Symbol:
3002
- case WorkspaceSymbol:
3003
3065
  case EveryThing:
3004
3066
  case GoToLine:
3005
- case View:
3006
3067
  case Help:
3068
+ case Symbol:
3069
+ case View:
3070
+ case WorkspaceSymbol:
3007
3071
  return EveryThing$1;
3008
- case ColorTheme:
3009
- return ColorTheme$1;
3072
+ case Custom:
3073
+ return Custom$1;
3010
3074
  case Recent:
3011
3075
  return Recent$1;
3012
3076
  default:
@@ -3014,37 +3078,19 @@ const getQuickPickProviderId = prefix => {
3014
3078
  }
3015
3079
  };
3016
3080
 
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
3081
  const loadContent = async state => {
3035
3082
  const {
3036
- uri,
3037
3083
  args,
3038
3084
  fileIconCache,
3085
+ height,
3039
3086
  itemHeight,
3040
- height
3087
+ uri
3041
3088
  } = state;
3042
3089
  const id = getQuickPickProviderId(uri);
3043
3090
  const value = getDefaultValue(id);
3044
3091
  const prefix = getQuickPickPrefix(value);
3045
3092
  const subId = getQuickPickSubProviderId(id, prefix);
3046
- setArgs(subId, args);
3047
- const newPicks = await getPicks(subId, value);
3093
+ const newPicks = await getPicks(subId, value, args);
3048
3094
  array(newPicks);
3049
3095
  const filterValue = getFilterValue(id, value);
3050
3096
  const items = filterQuickPickItems(newPicks, filterValue);
@@ -3052,27 +3098,28 @@ const loadContent = async state => {
3052
3098
  const maxLineY = Math.min(minLineY + state.maxVisibleItems, newPicks.length);
3053
3099
  const sliced = newPicks.slice(minLineY, maxLineY);
3054
3100
  const {
3055
- newFileIconCache,
3056
- icons
3101
+ icons,
3102
+ newFileIconCache
3057
3103
  } = await getQuickPickFileIcons(sliced, fileIconCache);
3058
3104
  const listHeight = getListHeight(items.length, itemHeight, height);
3059
3105
  const finalDeltaY = getFinalDeltaY(listHeight, itemHeight, items.length);
3060
3106
  return {
3061
3107
  ...state,
3062
- picks: newPicks,
3063
- items,
3064
- focusedIndex: 0,
3065
- state: Finished,
3066
- minLineY,
3067
- maxLineY,
3068
- value,
3108
+ args,
3069
3109
  cursorOffset: value.length,
3070
- inputSource: Script,
3071
- focused: true,
3072
3110
  fileIconCache: newFileIconCache,
3111
+ finalDeltaY,
3112
+ focused: true,
3113
+ focusedIndex: 0,
3073
3114
  icons,
3115
+ inputSource: Script,
3116
+ items,
3117
+ maxLineY,
3118
+ minLineY,
3119
+ picks: newPicks,
3074
3120
  providerId: id,
3075
- finalDeltaY
3121
+ state: Finished,
3122
+ value
3076
3123
  };
3077
3124
  };
3078
3125
 
@@ -3135,10 +3182,10 @@ const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
3135
3182
  const sections = getHighlightSections(highlights, visibleItem.label);
3136
3183
  return {
3137
3184
  ...visibleItem,
3138
- posInSet: minLineY + i + 1,
3139
- setSize,
3185
+ highlights: sections,
3140
3186
  isActive: i === focusedIndex,
3141
- highlights: sections
3187
+ posInSet: minLineY + i + 1,
3188
+ setSize
3142
3189
  };
3143
3190
  });
3144
3191
  return visibleItems;
@@ -3157,12 +3204,12 @@ const createQuickPickViewModel = (oldState, newState) => {
3157
3204
  const newFocusedIndex = newState.focusedIndex - newState.minLineY;
3158
3205
  const itemCount = newState.items.length;
3159
3206
  const {
3160
- itemHeight,
3161
3207
  deltaY,
3162
3208
  finalDeltaY,
3163
- minimumSliderSize,
3164
3209
  headerHeight,
3165
- height
3210
+ height,
3211
+ itemHeight,
3212
+ minimumSliderSize
3166
3213
  } = newState;
3167
3214
  const listHeight = getListHeight(itemCount, itemHeight, height);
3168
3215
  const contentHeight = itemCount * itemHeight;
@@ -3170,16 +3217,16 @@ const createQuickPickViewModel = (oldState, newState) => {
3170
3217
  const scrollBarY = getScrollBarY(deltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
3171
3218
  const roundedScrollBarY = Math.round(scrollBarY);
3172
3219
  return {
3173
- visibleItems,
3174
- value: newState.value,
3175
3220
  cursorOffset: newState.cursorOffset,
3176
3221
  focused: newState.focused,
3177
3222
  height,
3178
- oldFocusedIndex,
3179
3223
  newFocusedIndex,
3180
- uid: newState.uid,
3224
+ oldFocusedIndex,
3181
3225
  scrollBarHeight,
3182
- scrollBarTop: roundedScrollBarY
3226
+ scrollBarTop: roundedScrollBarY,
3227
+ uid: newState.uid,
3228
+ value: newState.value,
3229
+ visibleItems
3183
3230
  };
3184
3231
  };
3185
3232
 
@@ -3267,53 +3314,53 @@ const QuickPickItemActive = 'QuickPickItemActive';
3267
3314
  const getQuickPickInputVirtualDom = () => {
3268
3315
  const ariaLabel = typeNameofCommandToRun();
3269
3316
  return {
3270
- type: Input,
3271
- className: InputBox,
3272
- spellcheck: false,
3317
+ ariaAutoComplete: 'list',
3318
+ ariaExpanded: true,
3319
+ ariaLabel: ariaLabel,
3273
3320
  autocapitalize: 'off',
3274
- inputType: 'text',
3321
+ autocomplete: 'off',
3275
3322
  childCount: 0,
3276
- role: ComboBox,
3323
+ className: InputBox,
3324
+ inputType: 'text',
3277
3325
  name: QuickPickInput,
3278
3326
  onBeforeInput: HandleBeforeInput,
3279
3327
  onBlur: HandleBlur,
3280
- onInput: HandleInput,
3281
3328
  onFocus: HandleFocus,
3282
- ariaLabel: ariaLabel,
3283
- ariaAutoComplete: 'list',
3284
- ariaExpanded: true,
3285
- autocomplete: 'off'
3329
+ onInput: HandleInput,
3330
+ role: ComboBox,
3331
+ spellcheck: false,
3332
+ type: Input
3286
3333
  };
3287
3334
  };
3288
3335
 
3289
3336
  const getQuickPickHeaderVirtualDom = () => {
3290
3337
  return [{
3291
- type: Div,
3338
+ childCount: 1,
3292
3339
  className: QuickPickHeader,
3293
- childCount: 1
3340
+ type: Div
3294
3341
  }, getQuickPickInputVirtualDom()];
3295
3342
  };
3296
3343
 
3297
3344
  const getFileIconVirtualDom = icon => {
3298
3345
  return {
3299
- type: Img,
3346
+ childCount: 0,
3300
3347
  className: FileIcon,
3301
- src: icon,
3302
3348
  role: None,
3303
- childCount: 0
3349
+ src: icon,
3350
+ type: Img
3304
3351
  };
3305
3352
  };
3306
3353
 
3307
3354
  const quickPickHighlight = {
3308
- type: Span,
3355
+ childCount: 1,
3309
3356
  className: QuickPickHighlight,
3310
- childCount: 1
3357
+ type: Span
3311
3358
  };
3312
3359
  const getHighlights = (sections, label) => {
3313
3360
  const labelDom = {
3314
- type: Div,
3361
+ childCount: 0,
3315
3362
  className: QuickPickItemLabel,
3316
- childCount: 0
3363
+ type: Div
3317
3364
  };
3318
3365
  const nodes = [labelDom];
3319
3366
  if (sections.length === 0) {
@@ -3335,22 +3382,22 @@ const getHighlights = (sections, label) => {
3335
3382
 
3336
3383
  const getQuickPickItemVirtualDom = visibleItem => {
3337
3384
  const {
3338
- posInSet,
3339
- label,
3340
- setSize,
3341
- isActive,
3342
3385
  description,
3343
- icon,
3386
+ fileIcon,
3344
3387
  highlights,
3345
- fileIcon
3388
+ icon,
3389
+ isActive,
3390
+ label,
3391
+ posInSet,
3392
+ setSize
3346
3393
  } = visibleItem;
3347
3394
  const dom = [{
3348
- type: Div,
3349
- className: QuickPickItem,
3350
- role: Option,
3351
3395
  ariaPosInSet: posInSet,
3352
3396
  ariaSetSize: setSize,
3353
- childCount: 1
3397
+ childCount: 1,
3398
+ className: QuickPickItem,
3399
+ role: Option,
3400
+ type: Div
3354
3401
  }];
3355
3402
  const parent = dom[0];
3356
3403
  if (isActive) {
@@ -3364,9 +3411,9 @@ const getQuickPickItemVirtualDom = visibleItem => {
3364
3411
  } else if (icon) {
3365
3412
  parent.childCount++;
3366
3413
  dom.push({
3367
- type: Div,
3414
+ childCount: 0,
3368
3415
  className: mergeClassNames(QuickPickMaskIcon, MaskIcon, `MaskIcon${icon}`),
3369
- childCount: 0
3416
+ type: Div
3370
3417
  });
3371
3418
  }
3372
3419
  const highlightDom = getHighlights(highlights, label);
@@ -3374,9 +3421,9 @@ const getQuickPickItemVirtualDom = visibleItem => {
3374
3421
  if (description) {
3375
3422
  parent.childCount++;
3376
3423
  dom.push({
3377
- type: Div,
3424
+ childCount: 1,
3378
3425
  className: QuickPickItemDescription,
3379
- childCount: 1
3426
+ type: Div
3380
3427
  }, text(description));
3381
3428
  }
3382
3429
  return dom;
@@ -3385,13 +3432,13 @@ const getQuickPickItemVirtualDom = visibleItem => {
3385
3432
  const getQuickPickNoResultsVirtualDom = () => {
3386
3433
  const noResults$1 = noResults();
3387
3434
  return [{
3388
- type: Div,
3435
+ childCount: 1,
3389
3436
  className: mergeClassNames(QuickPickItem, QuickPickItemActive$1, QuickPickStatus),
3390
- childCount: 1
3437
+ type: Div
3391
3438
  }, {
3392
- type: Div,
3439
+ childCount: 1,
3393
3440
  className: Label,
3394
- childCount: 1
3441
+ type: Div
3395
3442
  }, text(noResults$1)];
3396
3443
  };
3397
3444
 
@@ -3411,15 +3458,15 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3411
3458
  const heightString = px(scrollBarHeight);
3412
3459
  const translateString = position(0, scrollBarTop);
3413
3460
  return [{
3414
- type: Div,
3461
+ childCount: 1,
3415
3462
  className: mergeClassNames(ScrollBar, ScrollBarSmall),
3416
- childCount: 1
3463
+ type: Div
3417
3464
  }, {
3418
- type: Div,
3419
- className: ScrollBarThumb,
3420
3465
  childCount: 0,
3466
+ className: ScrollBarThumb,
3421
3467
  height: heightString,
3422
- translate: translateString
3468
+ translate: translateString,
3469
+ type: Div
3423
3470
  }];
3424
3471
  };
3425
3472
 
@@ -3427,24 +3474,24 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) =>
3427
3474
  const quickOpen$1 = quickOpen();
3428
3475
  const shouldShowScrollbar = scrollBarHeight > 0;
3429
3476
  return [{
3430
- type: Div,
3431
- className: mergeClassNames(Viewlet, QuickPick$1),
3477
+ ariaLabel: quickOpen$1,
3432
3478
  childCount: 2,
3479
+ className: mergeClassNames(Viewlet, QuickPick$1),
3433
3480
  id: QuickPick,
3434
- ariaLabel: quickOpen$1
3481
+ type: Div
3435
3482
  }, ...getQuickPickHeaderVirtualDom(), {
3436
- type: Div,
3483
+ ariaActivedescendant: QuickPickItemActive,
3484
+ childCount: shouldShowScrollbar ? 2 : 1,
3437
3485
  className: mergeClassNames(List, ContainContent),
3438
3486
  id: QuickPickItems,
3439
- role: ListBox,
3440
- ariaActivedescendant: QuickPickItemActive,
3441
- onWheel: HandleWheel,
3442
3487
  onPointerDown: HandlePointerDown,
3443
- childCount: shouldShowScrollbar ? 2 : 1
3488
+ onWheel: HandleWheel,
3489
+ role: ListBox,
3490
+ type: Div
3444
3491
  }, {
3445
- type: Div,
3492
+ childCount: visibleItems.length,
3446
3493
  className: mergeClassNames(ListItems, ContainContent),
3447
- childCount: visibleItems.length
3494
+ type: Div
3448
3495
  }, ...getQuickPickItemsVirtualDom(visibleItems), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarTop)];
3449
3496
  };
3450
3497
 
@@ -3459,18 +3506,18 @@ const renderValue = newState => {
3459
3506
 
3460
3507
  const getRenderer = diffType => {
3461
3508
  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
3509
  case Height:
3471
3510
  return renderHeight;
3511
+ case RenderCursorOffset:
3512
+ return renderCursorOffset;
3472
3513
  case RenderFocus:
3473
3514
  return renderFocus;
3515
+ case RenderFocusedIndex:
3516
+ return renderFocusedIndex;
3517
+ case RenderItems:
3518
+ return renderItems;
3519
+ case RenderValue:
3520
+ return renderValue;
3474
3521
  default:
3475
3522
  throw new Error('unknown renderer');
3476
3523
  }
@@ -3494,8 +3541,8 @@ const applyRender = (oldState, newState, diffResult) => {
3494
3541
 
3495
3542
  const render2 = (uid, diffResult) => {
3496
3543
  const {
3497
- oldState,
3498
- newState
3544
+ newState,
3545
+ oldState
3499
3546
  } = get(uid);
3500
3547
  if (oldState === newState) {
3501
3548
  return [];
@@ -3622,9 +3669,9 @@ const splitLines = lines => {
3622
3669
  const searchFile = async (path, value, prepare) => {
3623
3670
  const ripGrepArgs = getFileSearchRipGrepArgs();
3624
3671
  const options = {
3672
+ limit: 9_999_999,
3625
3673
  ripGrepArgs,
3626
- searchPath: path,
3627
- limit: 9_999_999
3674
+ searchPath: path
3628
3675
  };
3629
3676
  const stdout = await invoke('SearchFile.searchFile', options);
3630
3677
  const lines = splitLines(stdout);
@@ -3632,11 +3679,11 @@ const searchFile = async (path, value, prepare) => {
3632
3679
  };
3633
3680
 
3634
3681
  const searchModules = {
3635
- [Memfs]: searchFile$3,
3682
+ [Default]: searchFile,
3636
3683
  [Fetch]: searchFile$2,
3637
- [Html]: searchFile$1,
3638
3684
  [File]: searchFile,
3639
- [Default]: searchFile
3685
+ [Html]: searchFile$1,
3686
+ [Memfs]: searchFile$3
3640
3687
  };
3641
3688
 
3642
3689
  const listen = async () => {