Repository navigation
Shared: Move parser-independent extractor code into extractor-common - #23347
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a445966f-5728-45ed-9071-3ec38b20ab4f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a445966f-5728-45ed-9071-3ec38b20ab4f
Remove the Rust extractor's remaining dependency on tree-sitter-extractor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a445966f-5728-45ed-9071-3ec38b20ab4f
paldepind
marked this pull request as ready for review
December 3, 2026 11:54
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The Rust-analyzer updater’s allowed-files list excludes shared/extractor-common/Cargo.toml, preventing generated PRs from including dependency changes to that manifest.
1 open issue
What changed in this PR
Moves parser-independent utilities into extractor-common, removing the Rust extractor’s dependency on tree-sitter-extractor and reducing release-build overhead.
Changes:
- Relocates autobuilder, TRAP, tracing, and file/location helpers.
- Updates extractor consumers and test imports.
- Aligns Cargo and Bazel dependencies with the new module ownership.
| File | Description |
|---|---|
| unified/extractor/src/languages/swift/swift.rs | Uses the relocated TRAP writer. |
| unified/extractor/src/generator.rs | Uses shared tracing setup. |
| unified/extractor/src/extractor.rs | Updates TRAP and tracing references. |
| unified/extractor/src/autobuilder.rs | Uses the shared autobuilder. |
| unified/extractor/Cargo.toml | Adds extractor-common. |
| unified/extractor/BUILD.bazel | Adds the shared dependency. |
| shared/tree-sitter-extractor/tests/multiple_languages.rs | Updates the TRAP import. |
| shared/tree-sitter-extractor/tests/integration_test.rs | Updates the TRAP import. |
| shared/tree-sitter-extractor/src/lib.rs | Removes relocated module exports. |
| shared/tree-sitter-extractor/src/extractor/simple.rs | Uses shared TRAP types. |
| shared/tree-sitter-extractor/src/extractor/mod.rs | Delegates parser-independent helpers. |
| shared/tree-sitter-extractor/src/extractor/driver.rs | Uses shared TRAP and location helpers. |
| shared/tree-sitter-extractor/src/extractor/desugaring.rs | Updates the TRAP import. |
| shared/tree-sitter-extractor/Cargo.toml | Removes relocated runtime dependencies. |
| shared/extractor-common/src/trap.rs | Hosts TRAP writing utilities. |
| shared/extractor-common/src/lib.rs | Exports the relocated modules. |
| shared/extractor-common/src/extractor.rs | Hosts tracing and file/location helpers. |
| shared/extractor-common/src/autobuilder.rs | Hosts the shared autobuilder. |
| shared/extractor-common/Cargo.toml | Adds required runtime dependencies. |
| shared/extractor-common/BUILD.bazel | Wires third-party dependencies. |
| rust/extractor/src/trap.rs | Uses shared extraction helpers. |
| rust/extractor/src/main.rs | Uses shared tracing configuration. |
| rust/extractor/src/config.rs | Updates the TRAP import. |
| rust/extractor/Cargo.toml | Removes codeql-extractor. |
| rust/extractor/BUILD.bazel | Removes the tree-sitter extractor dependency. |
| rust/autobuild/src/main.rs | Uses the shared autobuilder. |
| rust/autobuild/Cargo.toml | Switches to extractor-common. |
| rust/autobuild/BUILD.bazel | Switches the shared dependency. |
| ruby/extractor/src/generator.rs | Uses shared tracing setup. |
| ruby/extractor/src/extractor.rs | Updates TRAP and helper references. |
| ruby/extractor/src/autobuilder.rs | Uses the shared autobuilder. |
| ql/extractor/src/generator.rs | Uses shared tracing setup. |
| ql/extractor/src/extractor.rs | Updates TRAP and tracing references. |
| ql/extractor/src/autobuilder.rs | Uses the shared autobuilder. |
| ql/extractor/Cargo.toml | Adds extractor-common. |
| misc/bazel/3rdparty/rust_workspace_deps/crates.bzl | Updates generated dependency mappings. |
| Cargo.lock | Reflects the revised dependency graph. |
Review effort: Max (adaptive)
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.

This PR moves
autobuilder,trap, and the parser-independent helpers inextractorfromtree-sitter-extractorintoextractor-common.This removes the Rust extractor's dependency on
tree-sitter-extractor. As a small bonus this makes release builds of the Rust extractor about 9% faster.Note to reviewer: