Repository navigation
Conversation
_rust_collect_type_refs treated every type_identifier as a referenced type, so `R` in `fn spawn<R: Runtime>(..) -> App<R>` produced a references edge to a sourceless `R` stub, or to a real node with that label such as a blanket `impl<T> Trait for T` or a `struct R` in another file. Collect the type and const parameters in scope, which are the item's own list plus the enclosing impl or trait for associated items, and skip them at every call site. The Go, Kotlin, Swift, Scala and C++ extractors already do this. Only a bare name is skipped, because a qualified path such as `tree::Node` cannot name a type parameter. Parameter lists are read in both the tree-sitter-rust 0.23 and 0.24 node shapes. Fixes Graphify-Labs#5677 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the pull request, @Max17190. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify review 
No issues reported · High impact
The Rust extractor now filters generic type and const parameters from collected references across signatures, declared types, trait bounds, and impls.
Code graph · 96 functions depend on this change
- 7 of 666 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed f1c4c7d · 1 earlier finding not re-checked
The built graph keeps one edge per node pair, so a leaked bare `Node` parameter that lands on the same real `Node` struct merged with the qualified `tree::Node` reference and the test could not see it. Count the raw extraction edges by role instead. Refs Graphify-Labs#5677 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
Why
The Rust extractor emitted a
referencesedge for every generic type parameter.R,TandFbecame phantom nodes, or bound to unrelated nodes such as a blanketimpl<T> Trait for T. Fixes #5677.Summary
_rust_type_params_in_scopecollects the type and const parameters of an item, plus those of the enclosing impl or trait for associated items._rust_collect_type_refsskips those names when they appear bare, so a qualified path such astree::Nodeis still referenced. The Go, Kotlin, Swift, Scala and C++ extractors already skip type parameters.A cold tauri build loses 1268
referencesedges and 321 sourceless nodes, and gains nothing. A cold Django build matches v8 byte for byte.Limitations: existing graphs keep the old edges for unchanged Rust files until those files are extracted again, because the AST cache version is unchanged. Open #2963 skips
Selfin the same function, so whichever lands second needs a small rebase.Test plan