posit-dev / posit-dev/positron

Ark: Download package source code from CRAN tarballs

Open
#2,286 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: kernels lang: r
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.