Login Register
Finding and Validating: workspace.index and workspace.diagnose

Using workspace.index for Code Search

Estimated reading: 0 minutes 9 views

The workspace.index command builds a searchable index of all C# code in your project. Instead of scanning every file to find a class name, Vex queries the pre-built index and gets results instantly. Think of it like a phone book for your code.

What gets indexed:

  • Class names and their namespaces
  • Method names and signatures
  • Field names and types
  • File paths where each element is defined

Three actions:

  • action="status" — Check whether the index exists and is current. Always start here.
  • action="rebuild" — Rebuild the index from scratch. Never rebuild when is_running=true.
  • action="query" — Search for classes, methods, or fields by name.

Smart workflow:

  1. Check status first
  2. If stale: rebuild and wait
  3. Then query: workspace.index action="query" query="PlayerController"

Example: You say “Find the PlayerController class.” Vex queries the index and gets: “PlayerController found in Assets/Scripts/Player/PlayerController.cs.” Instant and precise.

Index vs. find: Use workspace.index for code elements (classes, methods). Use workspace.find for files and folders by name pattern. The index is faster for code because it is pre-built.

Cache: The index rebuilds automatically when file changes are detected. Manual rebuild is available in Dashboard Settings. Typical rebuild time is a few seconds for normal projects.

When to use workspace.index vs. workspace.find:

Use workspace.index when you are searching for code elements — class names, method names, field names. The pre-built index makes these searches much faster than scanning files individually. Use workspace.find when searching for files and folders by name pattern, regardless of whether they contain code. Both are part of the DISCOVER step in DAP, but they serve different purposes.

Index management:

The index is cached locally and rebuilds automatically when file modifications are detected. Typical rebuild time is a few seconds for normal-sized projects. You can trigger a manual rebuild from Dashboard Settings AI tab or by asking Vex to rebuild the index. The critical rule: never start a rebuild when one is already running (is_running=true). Vex always checks status before rebuilding to avoid this problem.

Smart rebuild behavior:

The index detects file changes automatically and marks itself as stale. Vex checks freshness before querying and rebuilds only when needed. You can also trigger manual rebuilds from the Dashboard Settings AI tab.

Share this Doc

Using workspace.index for Code Search

Or copy link

CONTENTS
Antimanual

Ask our AI support assistant your questions about our platform, features, and services.

You are offline
Chatbot Avatar
What can I help you with?