REditorSupport / REditorSupport/vscode-R

Add ability to run code from @examples in Roxygen lines

Open
#147 17 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

In RStudio, a really neat feature is the ability to run code written next to Roxygen tage (#') by using Ctrl (Cmd) + Enter. The Roxygen tags do not get sent to the console. In VSCode I have to highlight the code and hit Ctrl (Cmd) + Enter. Not a particularly huge concern, but a nice to have.

An example:

#' print("hello world")
my_fun <- function() ...

Having the cursor on the first line and hitting Ctrl (Cmd) + Enter would produce [1] "hello world" in RStudio but in VSCode it would send my_fun to the console.

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

The issue names no files or tests; start by tracing the VS Code extension's Ctrl/Cmd+Enter execution path and how it selects runnable Roxygen-tagged text. Done means placing the cursor on the example line executes that code without sending the following non-example line, matching the described RStudio behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.