Skip to content

AST indexing should run as part of save command #176

@mihaelamj

Description

@mihaelamj

Problem

The AST semantic tools (search_property_wrappers, search_concurrency, search_conformances, search_symbols) return sparse or empty results for common patterns:

  • search_property_wrappers with @Observable → 0 results
  • search_concurrency with actor filtered to SwiftUI → 0 results
  • search_conformances with Sendable → only AV framework protocols

Meanwhile, search_conformances for Sendable did return some results, suggesting partial AST data exists but coverage is incomplete.

The core search + read_document pipeline works excellently (BM25 ranking is accurate, 320K+ docs are well-indexed), so the gap is specifically in AST-extracted symbol data.

Root cause (suspected)

AST indexing currently lives in the index command (sample code only), separate from save (docs indexing). This means:

  1. AST extraction only covers sample code Swift files, not Apple documentation pages that contain code
  2. Users who run save but not index get no AST data at all
  3. Even with index, coverage is limited to samples

Proposal

Integrate AST indexing into the save command so that code blocks within Apple documentation pages are also parsed with SwiftSyntax during the main indexing pass. This would populate doc_symbols, doc_imports, and related tables with symbols extracted from all sources — not just sample code.

This would make the semantic search tools (search_symbols, search_property_wrappers, search_concurrency, search_conformances) significantly more useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions