@lvce-editor/text-search-worker 7.18.0 → 7.18.1

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.
@@ -1470,7 +1470,7 @@ const getTextSearchProvider = scheme => {
1470
1470
  return get(scheme);
1471
1471
  };
1472
1472
 
1473
- const textSearch$6 = async (root, query, options, assetDir, platform, searchId, uid) => {
1473
+ const textSearch$7 = async (root, query, options, assetDir, platform, searchId, uid) => {
1474
1474
  string(root);
1475
1475
  string(query);
1476
1476
  const scheme = getProtocol(root);
@@ -1559,11 +1559,11 @@ const commandMap = {
1559
1559
  'TextSearch.getPullResults': getPullResults,
1560
1560
  'TextSearch.handlePullResultsFound': handlePullResultsFound,
1561
1561
  'TextSearch.initialize': initialize,
1562
- 'TextSearch.search': textSearch$6,
1562
+ 'TextSearch.search': textSearch$7,
1563
1563
  'TextSearch.searchIncremental': textSearchIncremental
1564
1564
  };
1565
1565
 
1566
- const textSearch$5 = async (scheme, root, query, options) => {
1566
+ const textSearch$6 = async (scheme, root, query, options) => {
1567
1567
  string(scheme);
1568
1568
  string(query);
1569
1569
  const ripGrepArgs = getRipGrepArgs({
@@ -1583,7 +1583,7 @@ const textSearch$5 = async (scheme, root, query, options) => {
1583
1583
  };
1584
1584
  };
1585
1585
 
1586
- const textSearch$4 = async (scheme, root, query, options, assetDir) => {
1586
+ const textSearch$5 = async (scheme, root, query, options, assetDir) => {
1587
1587
  const results = await invoke$3('ExtensionHostTextSearch.textSearchFetch', scheme, root, query, options, assetDir);
1588
1588
  return {
1589
1589
  limitHit: false,
@@ -1591,7 +1591,7 @@ const textSearch$4 = async (scheme, root, query, options, assetDir) => {
1591
1591
  };
1592
1592
  };
1593
1593
 
1594
- const textSearch$3 = async (scheme, root, query) => {
1594
+ const textSearch$4 = async (scheme, root, query) => {
1595
1595
  const results = await invoke$3('ExtensionHostTextSearch.textSearchHtml', scheme, root, query);
1596
1596
  return {
1597
1597
  limitHit: false,
@@ -1599,7 +1599,7 @@ const textSearch$3 = async (scheme, root, query) => {
1599
1599
  };
1600
1600
  };
1601
1601
 
1602
- const textSearch$2 = async (scheme, root, query, options, assetDir) => {
1602
+ const textSearch$3 = async (scheme, root, query, options, assetDir) => {
1603
1603
  try {
1604
1604
  // @ts-ignore
1605
1605
  const result = await invoke$3('ExtensionHostTextSearch.textSearchMemory2', scheme, root, query, options, assetDir);
@@ -1638,7 +1638,7 @@ const getOpenEditorPaths = (root, openEditorUris) => {
1638
1638
  return [...new Set(paths)];
1639
1639
  };
1640
1640
 
1641
- const textSearch$1 = async (scheme, root, query, options, assetDir, _platform, searchId, uid) => {
1641
+ const textSearch$2 = async (scheme, root, query, options, assetDir, _platform, searchId, uid) => {
1642
1642
  const openEditorPaths = options.openEditorUris ? getOpenEditorPaths(root, options.openEditorUris) : undefined;
1643
1643
  if (openEditorPaths && openEditorPaths.length === 0) {
1644
1644
  return {
@@ -1677,6 +1677,26 @@ const textSearch$1 = async (scheme, root, query, options, assetDir, _platform, s
1677
1677
  };
1678
1678
  };
1679
1679
 
1680
+ const textSearch$1 = async (_scheme, root, query, options, assetDir, platform, searchId, uid) => {
1681
+ const workspace = new URL(root);
1682
+ const openEditorUris = options.openEditorUris?.flatMap(uri => {
1683
+ if (!uri.startsWith('remote-ssh://')) {
1684
+ return [];
1685
+ }
1686
+ const editor = new URL(uri);
1687
+ if (editor.host !== workspace.host || editor.username !== workspace.username) {
1688
+ return [];
1689
+ }
1690
+ return [decodeURIComponent(editor.pathname)];
1691
+ });
1692
+ return textSearch$2('file', decodeURIComponent(workspace.pathname), query, {
1693
+ ...options,
1694
+ ...(openEditorUris && {
1695
+ openEditorUris
1696
+ })
1697
+ }, assetDir, platform, searchId, uid);
1698
+ };
1699
+
1680
1700
  const textSearch = async (scheme, root, query) => {
1681
1701
  // TODO ask renderer worker for files
1682
1702
  return {
@@ -1686,13 +1706,14 @@ const textSearch = async (scheme, root, query) => {
1686
1706
  };
1687
1707
 
1688
1708
  const textSearchProviderMap = {
1689
- '': textSearch$1,
1709
+ '': textSearch$2,
1690
1710
  // TODO deprecate/remove workspaces without scheme
1691
- default: textSearch$5,
1692
- fetch: textSearch$4,
1693
- file: textSearch$1,
1694
- html: textSearch$3,
1695
- memfs: textSearch$2,
1711
+ default: textSearch$6,
1712
+ fetch: textSearch$5,
1713
+ file: textSearch$2,
1714
+ html: textSearch$4,
1715
+ memfs: textSearch$3,
1716
+ 'remote-ssh': textSearch$1,
1696
1717
  web: textSearch
1697
1718
  };
1698
1719
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "7.18.0",
3
+ "version": "7.18.1",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"