🧹 Refactor dead code allowance in parse-extended modules - #315
🧹 Refactor dead code allowance in parse-extended modules#315undivisible wants to merge 1 commit into
Conversation
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Bugbot couldn't run - usage limit reachedBugbot 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) |
|
Tick the box to add this pull request to the merge queue (same as
|
🎯 What: Replaced the
#[cfg_attr(not(feature = "parse-extended"), allow(dead_code))]workaround with conditional compilation (#[cfg(feature = "parse-extended")]) for extended parser modules inin-cli/src/compiler/tree_front/mod.rs.💡 Why: When the
parse-extendedfeature was disabled, several language modules were being unconditionally compiled, resulting in legitimate dead code since their extraction functions were never called. Suppressing these warnings withallow(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:
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.cargo clippy --all-targets --features parse-extended --locked -- -D warningsand verified that the modules compile cleanly when the feature is enabled.cargo testinin-clito 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.rsare 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-extendedis 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 howextract.rsalready conditionally wires them. This drops theallow(dead_code)workaround and should trim default compile work.A
pr_description.mdfile documents the motivation and verification steps (clippy with/without the feature,in-clitests).Reviewed by Cursor Bugbot for commit 663d85d. Configure here.