Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-integrate examples into the root workspace #1466

Merged
merged 8 commits into from
Mar 10, 2023
Merged

Conversation

jplatte
Copy link
Member

@jplatte jplatte commented Oct 10, 2022

Motivation

Currently, when working on axum (with VSCode), you don't get in-editor errors when working on examples. This was caused by #978 moving examples into their own workspace to make development of axum easier, but I've found the opposite to be true.

Solution

Re-integrate the examples into the workspace, this time also setting default-members so that they don't get built / checked by a regular cargo check / cargo build (only with --workspace). I hope that retains most of the positives of #978 while fixing its downsides.

This was unintentionally restored in an unrelated PR after initial
deletion of the example.
@jplatte jplatte requested a review from davidpdrsn October 10, 2022 09:33
@jplatte jplatte changed the title Examples workspace Re-integrate examples into the root workspace Oct 10, 2022
… as non-default members.

This reverts commit 1fe4558.
@jplatte jplatte force-pushed the examples-workspace branch from aee2c89 to d287571 Compare October 10, 2022 09:46
@davidpdrsn
Copy link
Member

For me rust-analyzer still checks all the examples which I'd like to avoid. I tried a bunch of ways to set overrideCommand (both rust-analyzer.cargo.buildScripts.overrideCommand and rust-analyzer.checkOnSave.overrideCommand) but couldn't get it to stop doing that. Unless there is a way to fix that I don't think we should do this.

@jplatte
Copy link
Member Author

jplatte commented Oct 10, 2022

This seems to work for me on the latest release:

"rust-analyzer.checkOnSave.overrideCommand": [
    "cargo",
    "check", // or clippy
    "--message-format=json",
    "--all-targets",
]

(cc rust-lang/rust-analyzer#10717, which tracks first-class support for this kind of thing)

@davidpdrsn
Copy link
Member

I was able to get it working with that overrideCommand. So let's give this a try and see how it works! I'll deal with the conflicts.

@davidpdrsn davidpdrsn enabled auto-merge (squash) March 10, 2023 10:55
@davidpdrsn davidpdrsn merged commit dc480f7 into main Mar 10, 2023
@davidpdrsn davidpdrsn deleted the examples-workspace branch March 10, 2023 11:02
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