REditorSupport / REditorSupport/vscode-R

Support launching Shiny apps via the run button in VS Code

Open
#1,497 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.

When I try to run a shiny application by clicking the Play/Run button, VS Code opens the R console and executes the line:

source("path/to/app.R", encoding = "UTF-8")

However, this does not actually run the shiny app (I tried from a standalone terminal too with the same result). Instead, it seems like I need to type runApp(path/toapp.R') manually into the VS Code terminal to actually launch the shiny application.

I tried this with a simple skeleton in a file called app.R.

library(shiny)


ui <- fluidPage(
  "Hello, world!"
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Describe the solution you'd like

Something similar to the extension for Shiny for Python (and RStudio), where there is an option to added to the run button which says "Run shiny app".

Describe alternatives you've considered

Typing runApp('app.R') manually into the R console. I maybe bind a hotkey to this, but it would be convenient to have a solution that is there by default, especially when teaching with VS Code for R.

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 run-button path that currently executes source("app.R", encoding = "UTF-8") and compare it with the linked pyshiny-vscode extension's Shiny launch behavior. Done means an app.R Shiny example can be launched from a Run-button “Run shiny app” action, rather than requiring manual runApp('app.R').

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.