Skip to content

Fixes rust-analyzer include_dirs for crates with generated sources - #3840

Merged
UebelAndre merged 1 commit into
bazelbuild:mainfrom
csmulhern:include
Jun 10, 2026
Merged

Fixes rust-analyzer include_dirs for crates with generated sources#3840
UebelAndre merged 1 commit into
bazelbuild:mainfrom
csmulhern:include

Conversation

@csmulhern

Copy link
Copy Markdown
Contributor

When a crate contains generated sources, include_dirs needs to include BOTH the root_module directory, and the generated sources directory.

When include_dirs is empty, the inclusion of the root_module directory is done automatically, but when setting include_dirs, this needs to be done manually.

See:
https://github.com/rust-lang/rust-analyzer/blob/a84d92ff213e30fb00d7b812e07c4f67e99dcd29/crates/project-model/src/project_json.rs#L123-L131

@csmulhern

Copy link
Copy Markdown
Contributor Author

@UebelAndre is there someone that can take a look at this?

@csmulhern

Copy link
Copy Markdown
Contributor Author

@UebelAndre fyi this is a simple change building on #3836. I've just rebased it so it should be mergable.

@csmulhern

Copy link
Copy Markdown
Contributor Author

I've rebased this change so it can be cleanly merged.

@csmulhern

Copy link
Copy Markdown
Contributor Author

@UebelAndre this is up to date again if there's someone who can take a look.

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you! And sorry for the delay!

@UebelAndre
UebelAndre added this pull request to the merge queue Jun 10, 2026
Merged via the queue into bazelbuild:main with commit 301d425 Jun 10, 2026
3 checks passed
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.

2 participants