Skip to content

Shared: Move parser-independent extractor code into extractor-common - #23347

Merged
paldepind merged 3 commits into
mainfrom
rust/shared-library
Dec 3, 2026
Merged

paldepind merged 3 commits into
mainfrom
rust/shared-library

Conversation

@paldepind

@paldepind paldepind commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

This PR moves autobuilder, trap, and the parser-independent helpers in extractor from tree-sitter-extractor into extractor-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:

  • No code is changed, things have only been moved.
  • The PR is structured with one commit per moved module.

paldepind and others added 3 commits December 3, 2026 11:46
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
@github-actions github-actions Bot added Ruby QL-for-QL Rust Pull requests that update Rust code Unified labels Dec 3, 2026
@paldepind
paldepind marked this pull request as ready for review December 3, 2026 11:54
@paldepind
paldepind requested review from a team as code owners December 3, 2026 11:54
Copilot AI adaptive review requested due to automatic review settings December 3, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread shared/extractor-common/Cargo.toml Resolved

@tausbn tausbn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. 👍

@paldepind
paldepind merged commit da92276 into main Dec 3, 2026
103 checks passed
@paldepind
paldepind deleted the rust/shared-library branch December 3, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QL-for-QL Ruby Rust Pull requests that update Rust code Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants