-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #11075 - epage:feat, r=weihanglo
fix(add): Clarify which version the features are added for ### What does this PR try to resolve? This gives a hint to users that we might not be showing the feature list for the latest version but the earliest version. Also when using a workspace dependency, this is a good reminder of what the version requirement is that was selected. That could also be useful for reused dependencies but didn't want to bother with the relevant plumbing for that. ie we are going from ```console $ cargo add chrono@0.4 Updating crates.io index Adding chrono v0.4 to dependencies. Features: - rustc-serialize - serde ``` to ```console $ cargo add chrono@0.4 Updating crates.io index Adding chrono v0.4 to dependencies. Features as of v0.4.2: - rustc-serialize - serde ``` ### How should we test and review this PR? I'd recommend looking at this commit-by-commit. This is broken up into several refactors leading up the main change. The refactors are focused on pulling UI logic out of dependency editing so we can more easily evolve the UI without breaking the editing API. I then tweaked the behavior in the final commit to be less redundant / noisy. The existing tests are used to demonstrate this is working. ### Additional information I'm also mixed on whether the meta version should show up. Fixes #11073
- Loading branch information
Showing
7 changed files
with
158 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/testsuite/cargo_add/detect_workspace_inherit_features/stderr.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/testsuite/cargo_add/dev_prefer_existing_version/stderr.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. | ||
Features: | ||
Features as of v0.0.0: | ||
- one | ||
- two |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/testsuite/cargo_add/overwrite_inherit_features_noop/stderr.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Adding foo (workspace) to dependencies. | ||
Features: | ||
Features as of v0.0.0: | ||
+ test |
Oops, something went wrong.