Skip to content

TypeScript index coverage gaps — functions and handlers not indexed #384

Closed

Description

@ajianaz

Problem

cora index reports 92 web symbols indexed, but symbol search for common TypeScript patterns returns empty. Arrow functions, named function expressions, and Svelte component handlers are missing from the index.

Reproduction

cora explore 'handler'
# → "No symbols found."

cora explore 'generate'
# → 6 symbols, ALL from Rust crates. Zero from web/ TypeScript files.
# (web has 92 indexed symbols, but none match 'generate')

cora explore 'api_key'
# → 12 symbols, mix of Rust + some TS (data, ApiKey interface)
# But missing: generate handler in web/src/routes/generate/+page.svelte

Expected Behavior

TypeScript/Svelte index should include:

  • Exported functions (export function, export const fn = () =>)
  • Route handlers (+page.svelte, +layout.svelte component functions)
  • Class methods
  • Arrow functions assigned to variables

Root Cause Hypothesis

Tree-sitter TypeScript grammar may only capture export-level declarations. Internal functions (non-exported) and Svelte component <script> blocks may not be parsed.

Environment

  • cora 0.8.1
  • web/ directory: 92 symbols indexed (vs 500 Rust symbols)
  • Files: .ts, .svelte (SvelteKit 5)
  • Tree-sitter: Rust, TypeScript, Svelte (?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions