Skip to content

🧹 Refactor dead code allowance in parse-extended modules - #315

Open
undivisible wants to merge 1 commit into
masterfrom
fix-dead-code-allowance-6891197299170310659
Open

🧹 Refactor dead code allowance in parse-extended modules#315
undivisible wants to merge 1 commit into
masterfrom
fix-dead-code-allowance-6891197299170310659

Conversation

@undivisible

@undivisible undivisible commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🎯 What: Replaced the #[cfg_attr(not(feature = "parse-extended"), allow(dead_code))] workaround with conditional compilation (#[cfg(feature = "parse-extended")]) for extended parser modules in in-cli/src/compiler/tree_front/mod.rs.

💡 Why: When the parse-extended feature was disabled, several language modules were being unconditionally compiled, resulting in legitimate dead code since their extraction functions were never called. Suppressing these warnings with allow(dead_code) hides the issue and compiles unnecessary code. Conditionally compiling these modules entirely removes the dead code, adheres to Rust idioms, and slightly improves compile times when the feature is off.

Verification:

  1. Ran cargo clippy --all-targets --locked -- -D warnings (without feature) and verified that the previously unused modules are no longer compiled and no warnings are emitted.
  2. Ran cargo clippy --all-targets --features parse-extended --locked -- -D warnings and verified that the modules compile cleanly when the feature is enabled.
  3. Ran cargo test in in-cli to ensure no functionality or tests were broken.

Result: The codebase is cleaner, idiomatic conditional compilation is used, and the dead code allowance is removed without introducing new warnings.


PR created automatically by Jules for task 6891197299170310659 started by @undivisible


Note

Low Risk
Build-configuration-only change in parser module wiring; behavior should match existing feature-gated routing in extract.rs.

Overview
Extended Tree-sitter language fronts in tree_front/mod.rs are now gated with #[cfg(feature = "parse-extended")] instead of always compiling those modules and silencing dead-code warnings when the feature is off.

When parse-extended is disabled, parsers such as C#, Dart, Elixir, Erlang, F#, Haskell, Julia, Kotlin, OCaml, PHP, R, Scala, and V are no longer built at all, matching how extract.rs already conditionally wires them. This drops the allow(dead_code) workaround and should trim default compile work.

A pr_description.md file documents the motivation and verification steps (clippy with/without the feature, in-cli tests).

Reviewed by Cursor Bugbot for commit 663d85d. Configure here.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9cd7e50c-24a3-4d9e-8254-49157ad33c85)

@mergify

mergify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant