question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

User friendly error message when vsc.rstudioapi is not set

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
renkun-kencommented, Nov 8, 2020

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.

0reactions
MilesMcBaincommented, Apr 24, 2021

I think whether the API is used or not needs to remain under user control, because the emulation is far from perfect. The user needs to be able to run sessions without it to let certain tools use their fallback behavior for when they detect no API.

It doesn’t make sense to me to have situations where packages can enable the API if the shims are not present in the namespace as you seem to be suggesting.

Definitely things are a bit weird. But we’re pretending to be rstudio here and the API was clearly not designed to be a general addin API, so that kind of comes with that.

I still don’t understand the problem you have. Please spell it out for me in a new issue and I might be able to help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

User friendly error message when vsc.rstudioapi is not set #439
Open VS Code; Press 'F1' to open the command palette; Choose 'R: Launch RStudio Addin'; See error. Do you want to fix by ......
Read more >
Before I Sleep: Adding RStudio Addins to VSCode
My code fell in a heap at library(tidyverse) with an error that was painfully familiar, since I coded the message myself: error: This...
Read more >
Kun Ren - Using R in VS Code - YouTube
Talk delivered October 29, 2021. Visit https://www.nyhackr.org to learn more and follow https://twitter.com/nyhackr.
Read more >
Error in utils::askYesNo(msg) : Unrecognized response "<r ...
Whenever I start my R session on my new M1 mac I get the following ... VS Code options options( vsc.use_httpgd = TRUE,...
Read more >
cli: Helpers for Developing Command Line Interfaces
If this is not set, or set to "auto", then cli tries to detect a dark theme, this works in recent RStudio versions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found