Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Folder Scoped SearchNew to Visual Studio Code? Get it now.
Folder Scoped Search

Folder Scoped Search

Gerard Medina

|
7 installs
| (1) | Free
Smart search scoping for multi-root workspaces and monorepos. Automatically scopes search to the workspace folder (multi-root) or top-level project folder (monorepo). Toggle with status bar indicator.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Folder Scoped Search

Automatically scope your global search to the relevant folder of the active file. Perfect for multi-root workspaces or monorepos where you want to focus searches on a specific project.

Features

  • Smart Scope Detection: Automatically determines the best search scope based on your workspace configuration
    • Multi-root workspaces: Scopes to the workspace folder of the active file
    • Single-root workspaces (monorepos): Scopes to the top-level project folder containing the active file
  • Easy Toggle: Switch between folder-scoped and full workspace search with a single command
  • Status Bar Indicator: Always know which search mode you're in with a clear status bar icon
    • 📂 Folder Search: Search is scoped to the current project folder
    • 🌍 Workspace Search: Search covers all workspace folders
  • Click to Toggle: Click the status bar item to quickly switch modes
  • Customizable Keybinding: Remap Ctrl+Shift+F to any key combination you prefer
  • Per-Workspace Settings: Each workspace remembers its own search mode preference

Usage

Basic Usage

  1. Open a file in any workspace folder or project
  2. Press Ctrl+Shift+F to open the search panel
    • If Folder Search is enabled:
      • Multi-root workspace: Search scoped to ./workspace-folder-name/**
      • Single-root workspace: Search scoped to ./project-folder/** (top-level folder)
    • If Workspace Search is enabled: Search covers all folders

Toggle Search Mode

  • Via Command Palette: Ctrl+Shift+P → "Toggle Folder Scoped Search"
  • Via Status Bar: Click the status bar indicator (bottom-right corner)

The status bar shows:

  • $(folder) Folder Search - Searches limited to current workspace folder
  • $(globe) Workspace Search - Searches all workspace folders

How It Works

  • The extension overrides Ctrl+Shift+F to provide folder-scoped search functionality
  • When enabled, it intelligently determines the search scope:
    • Multi-root workspaces: Uses the workspace folder containing the active file
    • Single-root workspaces (monorepos): Uses the first-level subfolder from workspace root
      • Example: If your file is workspace/project-a/src/index.ts, search is scoped to ./project-a/**
  • When disabled, it behaves like the default VS Code search
  • The search mode preference is saved per workspace

Keybindings

Default:

  • Ctrl+Shift+F: Open folder-scoped search (or normal search if disabled)

Customize:

  1. Open Keyboard Shortcuts: Ctrl+K Ctrl+S
  2. Search for "Folder Scoped Search"
  3. Assign your preferred keybinding

Commands

  • folderScopedSearch.search: Open search with folder scope (if enabled)
  • folderScopedSearch.toggle: Toggle between folder-scoped and workspace search

Requirements

  • VS Code version 1.107.0 or higher

Extension Settings

This extension does not add any VS Code settings. The enabled/disabled state is stored per workspace automatically.

Known Issues

None at this time. Please report issues on the GitHub repository.

Release Notes

0.0.1

Initial release:

  • Smart folder-scoped search functionality
    • Multi-root workspace support
    • Single-root workspace (monorepo) support with top-level folder detection
  • Toggle command with status bar indicator
  • Per-workspace state persistence
  • Customizable keybindings
  • Comprehensive test suite

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft