Skip to content

feat(vscode): index custom subfolders with multi-folder search and excludes#398

Open
talhaanwarch wants to merge 9 commits into
zilliztech:masterfrom
talhaanwarch:pr/custom-index-paths
Open

feat(vscode): index custom subfolders with multi-folder search and excludes#398
talhaanwarch wants to merge 9 commits into
zilliztech:masterfrom
talhaanwarch:pr/custom-index-paths

Conversation

@talhaanwarch

@talhaanwarch talhaanwarch commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Adds three capabilities to the VSCode extension's Semantic Code Search panel so you can index specific subfolders of an open workspace rather than the whole root:

  • Custom index path(s): Open VSCode at a parent folder but index only the subfolder(s) you name. Retrieval comes from the same scope.
  • Multiple subpaths: Index several subfolders at once (e.g. backend, frontend/src). Search fans out across all indexed folders in parallel and merges results by score.
  • Exclude folders: Glob patterns to skip nested directories inside indexed folders.

Two new panel fields drive this:

  • Folder(s) to index — comma/newline-separated paths relative to the workspace root. Empty = whole workspace (unchanged default behavior).
  • Exclude folders — glob patterns applied on top of the defaults.

node_modules was already ignored by default; this PR also adds venv and .venv to the core default ignore list.

Design

  • One collection per indexed folder. Each folder is indexed independently (its own collection keyed by resolved path), so adding/removing a folder doesn't rebuild the others. Search runs one query per folder in parallel (Promise.all) and merges by score. Auto-sync is scoped to the indexed folders, not the workspace root.
  • Folder inputs and the resolved indexed-path list are persisted in workspaceState, so the panel prefills and search/sync know what to target across reloads.
  • Path resolution rejects any path that escapes the workspace root.
  • Search results are tagged with their source folder and carry an absolute path, fixing file-open for results outside the workspace root.

Testing

  • packages/core: build clean, 28 unit tests pass (incl. new default-ignore test).
  • packages/vscode-extension: tsc --noEmit clean; 8 new unit tests for path/result helpers pass.
  • Full pnpm build passes.
  • Manually verified end-to-end against a local Milvus + Ollama setup: indexed two subfolders, confirmed node_modules/venv and unlisted folders are skipped, search results are folder-tagged, and clicking a result opens the correct file and line.

Screenshot

image

🤖 Generated with Claude Code

talhaanwarch and others added 9 commits June 17, 2026 13:25
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…file-open

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…lts UI

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ace root

Auto-sync previously always synced workspaceFolders[0]. With per-subfolder
indexing this left indexed subfolders stale and tried to sync an un-indexed
root. Sync now iterates the saved indexedPaths (falling back to the workspace
root for backward compat), reapplies saved excludes, and skips folders without
an index. State keys are centralized in utils/stateKeys.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant