posit-dev / posit-dev/positron

Ark: Debugger: Provide virtual documents for dangling source references

Open
#2,282 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area: debugger lang: r
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 11h
Merged PRs (30d)
206

Description

When a package is bundled with source references, they often point to dangling locations on the build machine. This happens for instance when installing with devtools, see discussion in #1733, but also more generally when a package is shipped with source references by a distributor.

However the source references contain sufficient information to recreate the whole source tree ourselves. To leverage this we could register a document provider (https://code.visualstudio.com/api/extension-guides/virtual-documents) that consults these source references. On the backend side we'll also need to transform the dangling paths to the corresponding vdoc URI scheme, for instance when the jump-to-definition action is invoked.

The goal is two-fold: Allowing navigation across the source files of an installed packages, as well as debugger-stepping in context inside these sources.

Worth noting that in some cases the sourceref data may be preferred to the actual files on disk, for instance if the local repo is visiting a different branch. So even if the location exists, we should check that it's up to date and opt for a virtual source document if not the case.

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 with the VS Code virtual documents extension guide and the discussion in #1733, then trace how source references are handled for jump-to-definition and debugger stepping. A complete implementation should provide vdoc URIs for dangling or outdated sources, enable navigation and stepping through installed-package source trees, and prefer virtual content when disk files are not current.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, 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.