Repository navigation
Extend symbol graph to Python, Go, TypeScript, JavaScript (PR2) - #442
Merged
Merged
Conversation
…t (PR2) Adds the remaining 4 of the 5 languages find_definition/find_references cover, following PR1's Rust extractor pattern exactly: tree_sitter Query/QueryCursor extraction, honest ambiguity handling, one .scm file per fact type per language. lib.rs's build pipeline generalizes from Rust-only to dispatching on file extension across all 5 languages, grouping symbols per language before a shared cross-language edge- resolution pass. Two real grammar divergences caught by testing and fixed: - Go: struct embedding (implements-by-embedding) needs the `!name` negated-field query predicate to distinguish an embedded field from a named one of the same type. - JavaScript: `class_heritage` wraps the base class expression directly, unlike TypeScript's grammar which wraps it in an `extends_clause` — a naive shared query would have silently returned nothing for JS `extends`. Dogfood-validated: full build of forge's own repo (all 5 languages present) completes in 4.3s in release mode, with every lookup resolving correctly including symbols from this session's own work. Claude-Session: https://claude.ai/code/session_01Tb5bxZgFovoKct29q9VEgs
This was referenced Aug 26, 2026
mohitranka
added a commit
that referenced
this pull request
Aug 26, 2026
* Revert "feat(graph): live watcher, /graph toggle, and AgentSession wiring (PR3) (#443)" This reverts commit aae0844. * Revert "feat(graph): extend symbol graph to Python, Go, TypeScript, JavaScript (PR2) (#442)" This reverts commit a58b6a2. * Revert "feat(graph): add repo-wide symbol graph, find_definition/find_references (PR1: Rust) (#441)" This reverts commit ea4c3b9.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…t (PR2) (#442) Adds the remaining 4 of the 5 languages find_definition/find_references cover, following PR1's Rust extractor pattern exactly: tree_sitter Query/QueryCursor extraction, honest ambiguity handling, one .scm file per fact type per language. lib.rs's build pipeline generalizes from Rust-only to dispatching on file extension across all 5 languages, grouping symbols per language before a shared cross-language edge- resolution pass. Two real grammar divergences caught by testing and fixed: - Go: struct embedding (implements-by-embedding) needs the `!name` negated-field query predicate to distinguish an embedded field from a named one of the same type. - JavaScript: `class_heritage` wraps the base class expression directly, unlike TypeScript's grammar which wraps it in an `extends_clause` — a naive shared query would have silently returned nothing for JS `extends`. Dogfood-validated: full build of forge's own repo (all 5 languages present) completes in 4.3s in release mode, with every lookup resolving correctly including symbols from this session's own work. Claude-Session: https://claude.ai/code/session_01Tb5bxZgFovoKct29q9VEgs
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* Revert "feat(graph): live watcher, /graph toggle, and AgentSession wiring (PR3) (#443)" This reverts commit ec8c1ef. * Revert "feat(graph): extend symbol graph to Python, Go, TypeScript, JavaScript (PR2) (#442)" This reverts commit 0e813ab. * Revert "feat(graph): add repo-wide symbol graph, find_definition/find_references (PR1: Rust) (#441)" This reverts commit e18cf38.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…t (PR2) (#442) Adds the remaining 4 of the 5 languages find_definition/find_references cover, following PR1's Rust extractor pattern exactly: tree_sitter Query/QueryCursor extraction, honest ambiguity handling, one .scm file per fact type per language. lib.rs's build pipeline generalizes from Rust-only to dispatching on file extension across all 5 languages, grouping symbols per language before a shared cross-language edge- resolution pass. Two real grammar divergences caught by testing and fixed: - Go: struct embedding (implements-by-embedding) needs the `!name` negated-field query predicate to distinguish an embedded field from a named one of the same type. - JavaScript: `class_heritage` wraps the base class expression directly, unlike TypeScript's grammar which wraps it in an `extends_clause` — a naive shared query would have silently returned nothing for JS `extends`. Dogfood-validated: full build of forge's own repo (all 5 languages present) completes in 4.3s in release mode, with every lookup resolving correctly including symbols from this session's own work. Claude-Session: https://claude.ai/code/session_01Tb5bxZgFovoKct29q9VEgs
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* Revert "feat(graph): live watcher, /graph toggle, and AgentSession wiring (PR3) (#443)" This reverts commit c8048f9. * Revert "feat(graph): extend symbol graph to Python, Go, TypeScript, JavaScript (PR2) (#442)" This reverts commit b48bbbe. * Revert "feat(graph): add repo-wide symbol graph, find_definition/find_references (PR1: Rust) (#441)" This reverts commit f2acb05.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR2 of 3 for the knowledge-graph feature (PR1: #441). Extends
find_definition/find_referencesfrom Rust-only to all 5 languagesforge-syntaxalready tree-sitter-parses.tree_sitter::Query/QueryCursormatching, one.scmfile per fact type per language, same honest-ambiguity resolution (a name matching multiple candidates returns every real one, never a guess).lib.rs's build pipeline generalized from a Rust-only walker to dispatching on file extension across all 5 languages, grouping symbols per language before a shared cross-language edge-resolution pass.Two real grammar divergences caught by testing, not assumed away:
implementsGo has) needs the!namenegated-field query predicate to tell an embedded field apart from a named field of the same type.class_heritagewraps the base class expression directly, unlike TypeScript's grammar which wraps it in anextends_clause— a shared query would have silently returned nothing for JSextends. Caught immediately by the test suite, fixed, verified.Test plan
cargo fmt --allcleancargo clippy --workspace --all-targetscleancargo test --workspacegreen (full suite, exit 0)forge-graph: per-language extraction correctness (imports/types/impl-or-extends/functions-vs-methods/calls) for all 5 languages, plus a new cross-language integration test building one repo containing all 5 languages together and confirming each resolves without cross-language leakage or collisionGraphHandle,RustExtractor)https://claude.ai/code/session_01Tb5bxZgFovoKct29q9VEgs