feat(rust): add Rust language extractor - #85
Merged
Conversation
GertL
force-pushed
the
feature/rust-extractor
branch
2 times, most recently
from
July 14, 2026 03:41
67b5469 to
72976e0
Compare
Contributor
Author
|
@dejo1307 quite a lot added here. Worth a review. Also feel free to decrease/highlight complexity if you see it. |
- Implemented comprehensive tests for Rust AST extraction in `rust_ast_test.go`, covering various Rust constructs such as structs, enums, traits, type aliases, constants, and method calls. - Added tests for handling dependencies, including internal and external dependencies, and cross-crate workspace dependencies. - Created utility functions for writing temporary Rust repositories for testing purposes in `rust_test.go`. - Established detection tests for identifying Rust projects with and without `Cargo.toml`, including support for subdirectory monorepos.
…ith macro argument handling
…ing and macro argument handling
…d sibling file submodule handling
…ith Drop and Future method overrides
…stantiation tracking
…pdate cache version to v119
…or test functions and array literals
GertL
force-pushed
the
feature/rust-extractor
branch
from
July 15, 2026 17:11
315160d to
fc7c91d
Compare
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
Adds a Rust extractor (tree-sitter-based:
fn/struct/enum/trait/type/const/static, withimpl/traitand nestedmod { }qualification (<dir>.<mod>.<Type>.<method>).impl Trait for Type→implements, attached toType's own fact via apost-pass so it works even when the impl is declared in a different file
than the type (also avoids double-counting)
use-baseddependencyfacts classifiedinternal/external/stdlib,with cross-crate and submodule resolution for Cargo workspaces.
calls/instantiatesedges (tuple-call and named struct-literalconstruction) and per-function
cyclomaticcomplexity.useimports..route("/path", get(handler)), including chainedverbs like
get(a).post(b)), emittingroutefacts.Adjusted the
config.go(default extractor list,target/**ignore glob),bootstrap.go, with docs updated inREADME.md/ARCHITECTURE.md.Tested on dbt-core and Axum.