Return package URL from .ps.rpc.pkg_list#1261
Open
bricestacey wants to merge 3 commits into
Open
Conversation
Add a `url` field to each package returned by the packages-pane RPC, taken from the first entry of the DESCRIPTION URL field (conventionally the package's canonical website). Positron's Packages pane renders an external-link button from it and validates the scheme before opening. See posit-dev/positron#13890
jennybc
approved these changes
Jun 10, 2026
jennybc
left a comment
Member
There was a problem hiding this comment.
LGTM!
I made a minor stylistic suggestion that leans more into letting NA do its job (indicating missing data), but this isn't a big deal.
I would have thought sending back the same shape all the time might be useful (so always sending url even if it's empty), but having an optional url must be better on the other side.
For any package that is on CRAN, if DESCRIPTION doesn't list a URL, you could fallback to https://cran.r-project.org/package={package}, but then you'd have to determine if it's on CRAN or not, which is extra work. But if you already have easy access to this info, this is an idea.
Co-authored-by: Jennifer (Jenny) Bryan <jenny.f.bryan@gmail.com>
Co-authored-by: Jennifer (Jenny) Bryan <jenny.f.bryan@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.ps.rpc.pkg_listnow returns aurlfield for each installed package,taken from the first entry of its DESCRIPTION
URLfield (conventionallythe package's canonical website). The field is omitted when a package
advertises no URL.
This feeds the new external-link button in Positron's Packages pane, which
validates the scheme before opening. Multiple / labeled links (repository,
issues, etc.) are left for a future change.
See posit-dev/positron#13890