{"id":15658884,"url":"https://github.com/trekhleb/vscode-search-tree","last_synced_at":"2025-05-05T17:05:05.374Z","repository":{"id":57892519,"uuid":"526156167","full_name":"trekhleb/vscode-search-tree","owner":"trekhleb","description":"🔎 (Draft!) VSCode extension to show the search results in a tree view","archived":false,"fork":false,"pushed_at":"2022-08-18T11:49:39.000Z","size":1857,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T22:32:20.974Z","etag":null,"topics":["search","searching","tree","tree-structure","treeview","vscode","vscode-extension","vscode-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trekhleb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-18T10:04:05.000Z","updated_at":"2024-10-23T12:31:47.000Z","dependencies_parsed_at":"2022-08-28T23:22:58.663Z","dependency_job_id":null,"html_url":"https://github.com/trekhleb/vscode-search-tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trekhleb%2Fvscode-search-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trekhleb%2Fvscode-search-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trekhleb%2Fvscode-search-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trekhleb%2Fvscode-search-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trekhleb","download_url":"https://codeload.github.com/trekhleb/vscode-search-tree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252542061,"owners_count":21764907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["search","searching","tree","tree-structure","treeview","vscode","vscode-extension","vscode-plugin"],"created_at":"2024-10-03T13:14:18.418Z","updated_at":"2025-05-05T17:05:05.330Z","avatar_url":"https://github.com/trekhleb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-search-tree\n\n🔎 **(Draft!)** VSCode extension to show the search results in a tree view\n\n\u003e The work on this extension is on-pause for now since VSCode team has put the [#20224](https://github.com/microsoft/vscode/issues/20224) issue into their *\"Aug-2022 iteration\"* [#157454](https://github.com/microsoft/vscode/issues/157454) to \"Explore showing search results as a tree view\". If this will be done in a VSCode core it would be ideal solution and this extension won't be needed.\n\n## Issue\n\nCurrently, the search results in VSCode cannot be grouped in a Tree View structure. See https://github.com/microsoft/vscode/issues/20224.\n\nLet me quote some folks:\n\n\u003e - *\"holy sh∗t, how can this still be missing after 5 years... back to eclipse it is\"* - fm-swe [[1](https://github.com/microsoft/vscode/issues/20224)]\n\u003e - *\"Unfortunately no.\"* - leo-diehl [[2](https://stackoverflow.com/questions/54133206/any-way-to-view-vscode-find-in-files-results-organized-by-folder-hierarchy)]\n\n## Suggestion\n\nAdd a possibility to show search results in a tree view, for faster and less overwhelming information lookup.\n\n## Current state of the plugin\n\nThe code is super-raw, not optimized and not tested. Basically it is not ready to be published as of now. \n\nHowever, here is what was done currently\n\n![Extension demo](./assets/demo-01.gif)\n\n- [x] Custom \"Search Tree\" view container in a side-bar\n- [x] Custom command via `Cmd+Shift+P`: \"Search Tree: Search\"\n- [x] Custom Input dialog for the search query\n- [x] Custom hotkey: `Ctrl+Shift+F`\n- [x] Custom search engine: via [fast-find-in-files](https://www.npmjs.com/package/fast-find-in-files) package\n- [x] [Tree view provider](https://code.visualstudio.com/api/extension-guides/tree-view) was used\n    - Custom numbers (of search results)\n    - \"Native\" file icons\n- [x] Open the file line in the code browser\n- [x] Auto-scroll to and auto-highlight the found text\n\n| Search results as a List    | Search results as a Tree    |\n| --- | --- |\n| ![Search results as a List](./assets/search-flat.png) | ![Search results as a Tree](./assets/search-tree.png) |\n\n## Implementation issues\n\nIt is not clear (not possible, or at least not documented) how to do the following:\n\n- [ ] Attach input field to the [TreeView](https://code.visualstudio.com/api/extension-guides/tree-view)\n- [ ] Attach a custom view to the Search [view container](https://code.visualstudio.com/api/references/contribution-points#contributes.views)\n- [ ] Re-use the VSCode Search [API](https://code.visualstudio.com/api/references/vscode-api)\n\n## ToDo\n\n- [ ] Make the Search Tree to be a part of Search view container\n- [ ] Auto-focus on the Search Tree view when pressing `Ctrl+Shift+F`\n- [ ] In-place (non-popup) input field\n- [ ] Collapse/Expand all\n- [ ] Light/Dark mode icons\n- [ ] Search in specific folders (via regexp)\n- [ ] Search in specific files (via regexp)\n- [ ] Optimize search engine for large amount of files\n\n## Developing\n\nInstall dependencies\n\n```\nnpm install\n```\n\nRun the extension in the development mode in VSCode\n\n```\n\"Run and Debug\" → \"Run Extension\"\n```\n\n## Docs\n\n- [VSCode Extension API](https://code.visualstudio.com/api)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrekhleb%2Fvscode-search-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrekhleb%2Fvscode-search-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrekhleb%2Fvscode-search-tree/lists"}