Skip to content

#404c Parse tree-sitter once per file #412

Closed

Description

@ajianaz

Problem

When tree-sitter feature is enabled, ast::extract() is called three separate times for the same file:

  1. extract_symbols() -- discards edges
  2. extract_calls() -- discards nodes, re-parses
  3. extract_edges() -- re-parses again

Each call re-parses the entire source into a new tree-sitter tree.

Location

src/index/extract.rs:198, 513, 595

Solution

Parse once in index_file(), pass (nodes, edges) to all three consumers.

Expected Impact

2-3x reduction in parsing cost for tree-sitter path.

Activity

  1. ajianaz commented on Jul 28, 2026

    @ajianaz
    CollaboratorAuthor

    Superseded. #412 was about parsing tree-sitter 3x per file — PR #422 refactored to single extract() call. Parent tracker no longer needed.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions