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

feat: add a new config that limits workspace checks to single crates #13336

Closed
wants to merge 2 commits into from

Conversation

jkelleyrtp
Copy link
Contributor

@jkelleyrtp jkelleyrtp commented Oct 2, 2022

Allow RA to ignore checking workspaces when single subcrates are open.

When the workspace is open, RA will still check the entire workspace.

But, now when a single crate is open, RA won't check those.

When working in subcrates on large workspaces, my checks go from:

Screen.Recording.2022-10-02.at.3.27.30.PM.mov

To:

Screen.Recording.2022-10-02.at.4.20.19.PM.mov

Solves #12882, #10669

Adds the config flag checkSingleCrate.enable which is passed to flycheck

Allow RA to ignore checking workspaces when single subcrates are open.

When the workspace is open, RA will still check the entire workspace.

But, now when a single crate is open, RA won't check those.
@jkelleyrtp jkelleyrtp closed this Oct 2, 2022
@jkelleyrtp jkelleyrtp reopened this Oct 2, 2022
@jkelleyrtp jkelleyrtp changed the title feat: add a new command that limits workspace checks feat: add a new config that limits workspace checks Oct 3, 2022
@jkelleyrtp jkelleyrtp changed the title feat: add a new config that limits workspace checks feat: add a new config that limits workspace checks to single crates Oct 3, 2022
@Veykril
Copy link
Member

Veykril commented Oct 10, 2022

I'll hold off with reviewing this for a bit as I am currently thinking about config interpolation which might make an extra config for this unnecessary (we'd basically allow setting the overrideCommand to something that uses --manifest-path ${crate-toml} which would imply this behavior.

@jkelleyrtp
Copy link
Contributor Author

I'll hold off with reviewing this for a bit as I am currently thinking about config interpolation which might make an extra config for this unnecessary (we'd basically allow setting the overrideCommand to something that uses --manifest-path ${crate-toml} which would imply this behavior.

This PR kinda-sorta adds this interpolation, but only when using the flag enabled.

Essentially it checks if the root Cargo.toml is the same as the workspace, and if it is, then it uses the workspace Cargo.toml. Otherwise, it tries to check if the root cargo.toml is a single crate, and if it is, then it uses the single crate cargo check.

@bors
Copy link
Collaborator

bors commented Oct 19, 2022

☔ The latest upstream changes (presumably #13128) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril Veykril added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 3, 2022
@Veykril Veykril added S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2023
@jhgg
Copy link
Contributor

jhgg commented May 2, 2023

@rustbot claim

@jhgg
Copy link
Contributor

jhgg commented May 2, 2023

@rustbot release-assignment

oops, clicked into wrong issue, apologies.

@Veykril Veykril unassigned jhgg May 2, 2023
@mikkelens
Copy link

mikkelens commented Aug 11, 2023

What is missing for this to be finalized/merged? I've run into this issue more than once on even small workspaces where I just want to possibly share dependency targets and have a semantic grouping of the crates, but where I only want to check one crate at a time (since only one is open in the editor!) and would love to have this not be super slow.

@sstadick
Copy link

sstadick commented Sep 1, 2023

Seconding what @mikkelens says. If there's any further work to get this over the finish line I'd be willing to put some time in to make it happen.

@Veykril
Copy link
Member

Veykril commented Feb 8, 2024

I've since changed my mind on the interpolation. We might end up having it, but it should not be valid / used for the non-override cargo commands. I'll close this and re-implement the feature in a way that makes use of the -p flag instead of the current dir.

#16510

@Veykril Veykril closed this Feb 8, 2024
bors added a commit that referenced this pull request Feb 8, 2024
feat: Allow cargo check to run on only the current package

cc #13336, #12882
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants