usethis icon indicating copy to clipboard operation
usethis copied to clipboard

Export `use_rstudio_config()`

Open malcolmbarrett opened this issue 2 years ago • 3 comments

Supercedes #1515 per the discussion in #1516

malcolmbarrett avatar Oct 14 '21 13:10 malcolmbarrett

When this gets done, it's a good time to modernize all code where we work with RStudio prefs. It was originally written when RStudio prefs were much harder to get at programmatically and we probably aren't taking full advantage of the current situation.

As one example, why do we have our own functions for reading/writing RStudio preferences? Why aren't we using rstudioapi::writeRStudioPreference()?

https://rstudio.github.io/rstudioapi/reference/writeRStudioPreference.html

jennybc avatar Oct 14 '21 15:10 jennybc

It will also be important to think about the interface of the exported use_rstudio_config(). There will be the usual decisions re: whether to support use_rstudio_config(name1 = value1, name2 = value2, ...), use_rstudio_config(list(name1 = value1, name2 = value2, ...)), or both.

jennybc avatar Oct 14 '21 15:10 jennybc

This will be fantastic! 🥂

A companion function to use_rstudio_config() to set secondary repositories would also be helpful (e.g. we set our RSPM location at my institution). If a user has never set a secondary repo and the user adds a secondary repository via the GUI, the country is also set (just something to keep in mind if you're adding the repo location).

ddsjoberg avatar Oct 17 '21 16:10 ddsjoberg

I'm not sure about the original justification, but as I attempt to rewrite these functions using just the API there are some pain points, like it's much harder to test what you're doing, and the RStudio API appears to be missing some functionality, like the ability to remove a setting.

hadley avatar Jan 18 '23 18:01 hadley