posit-dev / posit-dev/positron

Provide command (and button) in R extension to jump to `.md` snapshot from test file

Open
#6,249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In an R package, it is very common to have a test file that is connected to a .md snapshot file. Here, the markdown in tests/testthat/_snaps/board_s3.md is generated by the tests in tests/testthat/test-board_s3.R:

Image

These files are stored in standard spots within an R package. We have gotten feedback that it would be great to provide a button on the editor action bar for the .R file to open up the connected .md file.

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 in the R extension's editor action bar implementation and trace how commands identify the active test file. Use tests/testthat/test-board_s3.R and tests/testthat/_snaps/board_s3.md as the concrete pair. Done means the command and editor action button open the connected snapshot file from the test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.