User friendly error message when vsc.rstudioapi is not set
See original GitHub issueDescribe 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:
- Open VS Code
- Press ‘F1’ to open the command palette
- Choose ‘R: Launch RStudio Addin’
- 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

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:
- Created 3 years ago
- Comments:16 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

r.alwaysUseActiveTerminalis mainly used to support sending code to R terminals started by user as introduced at the wiki. It should not have anything to do withrstudioapistuff.If one always starts own R terminals (I always starts radian in a tmux window), then one has to add the source
init.Rcode to the user profile (~/.Rprofile) so that session watcher andrstudioapiemulation could load and attach on each R session startup..radian_profileis only sourced byradianon session startup. If the same code appears in~/.Rprofile, then it should work for all R sessions started with this user profile includingradiansessions, 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.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.