posit-dev / posit-dev/positron
Ark: Download package source code from CRAN tarballs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
-
Having access to the source code of package dependencies is crucial for the goal of using static analysis in the LSP: #2321. Without the source code it's impossible to figure out statically what symbols are in a namespace and what
declare()annotations they are associated with. -
It's also helpful for step-debugging in context. With #2285 implemented, we have makeshift source references from deparsed code. But these have limitations: some objects are not parseable, including expression trees containing complex literals, and we don't know the original file organisation of the namespace objects. It would be better to create source references from an actual copy of the repo.
We could potentially do this with pak::pkg_download() which is able to download source tarballs and has the very nice property that downloads are cached on disk. This makes it reasonable to download sources when needed and build the source references from there. Then the user is able to navigate foreign code in the original context. This would only work when pak and Internet (or the cache) is available, so the makeshift source refs are still useful to provide generalised source availability.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Ark work described in #2321 and #2285, then read the pak::pkg_download() documentation linked in the issue. Done means CRAN dependency source tarballs can be obtained from the Internet or cache for original-context source references, while the existing makeshift references remain available when pak or network access is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100