vscode-R: User friendly error message when vsc.rstudioapi is not set

Describe the bug When I want to use an RStudio Addin from VS Code I receive the following error:

Command ‘R: Launch RStudio Addin’ resulted in an error (ENOENT: no such file or directory, open ‘/tmp/RtmpKarM0O/vscode-R/addins.json’)

I set options(vsc.rstudioapi = TRUE) in my radian profile. This works (checked using getOption("vsc.rstudioapi")).

To Reproduce Steps to reproduce the behavior:

  1. Open VS Code
  2. Press ‘F1’ to open the command palette
  3. Choose ‘R: Launch RStudio Addin’
  4. See error

Do you want to fix by self? (I hope your help!)

No (don’t know how)

Expected behavior I should be able to choose from installed RStudio Addins.

Screenshots image

Environment (please complete the following information):

  • OS: Linux
  • VSCode Version: 1.51.0
  • R Version: 4.0.3
  • vscode-R version: 1.5.2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

r.alwaysUseActiveTerminal is mainly used to support sending code to R terminals started by user as introduced at the wiki. It should not have anything to do with rstudioapi stuff.

If one always starts own R terminals (I always starts radian in a tmux window), then one has to add the source init.R code to the user profile (~/.Rprofile) so that session watcher and rstudioapi emulation could load and attach on each R session startup.

.radian_profile is only sourced by radian on session startup. If the same code appears in ~/.Rprofile, then it should work for all R sessions started with this user profile including radian sessions, and the same code is not needed in .radian_profile. If you only want some code to run on radian startup (instead of R), then you should write it in .radian_profile.