Skip to content

feat: OSC 8 link for package name in cargo info - #17710

Merged
epage merged 1 commit into
rust-lang:masterfrom
kutluhaneth46:fix/cargo-add-osc8-crate-links
Nov 11, 2026
Merged

epage merged 1 commit into
rust-lang:masterfrom
kutluhaneth46:fix/cargo-add-osc8-crate-links

Conversation

@kutluhaneth46

@kutluhaneth46 kutluhaneth46 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

Partial progress on #17652 after #17668 covered cargo search.

cargo info now wraps the package name in an OSC 8 link to https://crates.io/crates/<name>/<version> when the package is from crates.io. Keywords were already linked the same way.

I tried the same for the cargo add Adding … status line, but OSC 8 sequences going through shell.status broke the cargo_add stderr.term.svg snapshots under CARGO_TERM_HYPERLINKS=true. Left that for a follow-up with a status-printing path that SVG tests can tolerate.

Notes to reviewers

  1. On a terminal with OSC 8 hyperlinks enabled, run cargo info serde and confirm the package name is clickable to crates.io.
  2. Existing cargo info UI tests should stay green (same hyperlink helpers as keywords).

🤖 LLM involvement: Assisted with locating call sites and drafting the hyperlink wrapper; I selected the cargo info scope after the cargo add status-line approach failed UI snapshots, verified cargo check --lib, and authored the PR text.

@rustbot rustbot added A-interacts-with-crates.io Area: interaction with registries Command-add Command-info S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 11, 2026
@rustbot

rustbot commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @epage (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from Muscraft, epage, weihanglo

@kutluhaneth46 kutluhaneth46 changed the title feat: OSC 8 links for crate names in cargo info and cargo add feat: OSC 8 link for package name in cargo info Nov 11, 2026
@epage

epage commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Per our contrib guide, please clean up the commits for how they should be reviewed and merged, rather than how this was developed.

.unwrap_or_default();
write!(
shell.out(),
"{header}{name_link}{}{name_link:#}{header:#}",

@epage epage Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we also list deps? Should we make those links?

View changes since the review

@epage
epage self-requested a review November 11, 2026 12:39
Wrap the package name in an OSC 8 hyperlink to crates.io when
`cargo info` reports a crates.io package, matching the existing
keyword link style.

OSC 8 on the `cargo add` status line was attempted and reverted
because sequences through `shell.status` broke UI SVG snapshots
under `CARGO_TERM_HYPERLINKS=true`.

LLM involvement: Assisted with locating call sites and drafting the
hyperlink wrapper; I selected the cargo info scope after the cargo
add status-line approach failed UI snapshots, verified the change,
and authored the PR text.

Signed-off-by: KutluhanETH <[email protected]>
@kutluhaneth46
kutluhaneth46 force-pushed the fix/cargo-add-osc8-crate-links branch from 904d56e to cc597ed Compare November 11, 2026 22:09
@kutluhaneth46

Copy link
Copy Markdown
Contributor Author

Thanks @epage. Squashed into a single commit that matches the final cargo info scope (OSC 8 on the package name only) and force-pushed.

@epage epage left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would have assumed a change to cargo info would focus on all of it unless there was a controversial part but some progress is better than waiting forever on perfection.

View changes since this review

@epage
epage enabled auto-merge November 11, 2026 22:15
@epage
epage added this pull request to the merge queue Nov 11, 2026
Merged via the queue into rust-lang:master with commit e715503 Nov 11, 2026
30 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 11, 2026
@kutluhaneth46

Copy link
Copy Markdown
Contributor Author

Thanks @epage for the review and merge. Glad the cargo info package-name link is in.

rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Nov 16, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Nov 17, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
@rustbot rustbot added this to the 1.102.0 milestone Nov 17, 2026
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Nov 19, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
ubiratansoares pushed a commit to ubiratansoares/rust-analyzer that referenced this pull request Nov 19, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Nov 23, 2026
Update cargo submodule

22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20
2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000
- fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742)
- Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735)
- fix(config)!: Polish the API (rust-lang/cargo#17736)
- chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723)
- perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518)
- test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737)
- Reworked output mtime tracking (rust-lang/cargo#17732)
- fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556)
- reference: remove implied meaning (rust-lang/cargo#17731)
- chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722)
- chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724)
- chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725)
- feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714)
- chore(deps): update msrv to v1.100 (rust-lang/cargo#17721)
- chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726)
- chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720)
- chore: fix CI errors due to 1.100 (rust-lang/cargo#17719)
- Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718)
- refactor: Misc cleanup while playing with config (rust-lang/cargo#17713)
- feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710)
- chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712)
- feat(config): Add a generated schema file (rust-lang/cargo#17708)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants