Home > Back-end >  R in vscode - saving files command
R in vscode - saving files command

Time:11-07

RStudio has an api function rstudioapi::documentSaveAll() which I'm trying to replicate when running R code in VScode - is there something like vscodeapi::documentSaveAll()?

CodePudding user response:

The R extension for VS Code supports many of the {rstudioapi} functions, including documentSaveAll. Install that extension and then add this line to your .Rprofile file as described here:

options(vsc.rstudioapi = TRUE)

Then you should be able to call rstudioapi::documentSaveAll() in your code and have it work in VS Code too.

The list of {rstudioapi} functions currently supported in VS Code is here: https://github.com/REditorSupport/vscode-R/wiki/RStudio-addin-support#implemented-functions

  • Related