Skip to content

Fixes behavior of rust_generated_srcs within the rust-analyzer aspect#3836

Open
csmulhern wants to merge 1 commit intobazelbuild:mainfrom
csmulhern:main
Open

Fixes behavior of rust_generated_srcs within the rust-analyzer aspect#3836
csmulhern wants to merge 1 commit intobazelbuild:mainfrom
csmulhern:main

Conversation

@csmulhern
Copy link
Contributor

The existing rust analyzer aspect does not handle generated files completely.

  1. The aspect does not propagate through the srcs attribute, so on a top level target that uses a generated dependency, the aspect will not run.
  2. For targets with transitive dependencies that contain generated rust sources, the aspect will visit those dependencies, but because rust_generated_srcs is not aggregated onto the top-level target, the files themselves will not be generated. This breaks things like e.g. jump-to-definition if you try to jump to a file that has not yet been generated by bazel.

This PR addresses both these issues.

@csmulhern csmulhern changed the title Fixes paths generated for rust-analyzer discovery Fixes behavior of rust_generated_srcs within the rust-analyzer aspect Feb 3, 2026
@csmulhern csmulhern force-pushed the main branch 3 times, most recently from 761f38f to 7e7a8bb Compare February 3, 2026 20:59
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