Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store rstudioapi prefs separately; enable access to IDE prefs #5262

merged 4 commits into from Aug 20, 2019


Copy link

commented Aug 19, 2019

Currently, the rstudioapi package has two preference-related methods, readPreference and writePreference. These methods, however, do not allow access to any of the IDE's actual preferences. Instead, they are a mechanism for R code to save and load arbitrary key/value pairs into the IDE's preference store under the rstudioapi namespace.

This isn't ideal for a few reasons. The first is that it's useful to access the IDE's preferences from rstudioapi, especially now that they are formalized. The second is that the core preference system is not a great place to store arbitrary values from R code due to different semantics (overriding/defaults, possibility for corruption, etc).

This change does three things:

  1. Creates a new mini pref system that stores only values from rstudioapi, in a separate file. These prefs are stored in a configurable location that defaults to rstudioapi-prefs.json.
  2. Adds .rs.api methods which enable access to the core RStudio prefs. These will later be used by new rstudioapi methods.
  3. As a proof of concept, adds a new pref that controls the default number of columns displayed in the data viewer, with no UI (so it can currently only be set via the API).
jmcphers added 4 commits Aug 16, 2019
@jmcphers jmcphers requested a review from adamconroy Aug 19, 2019
Copy link

left a comment

Looks good. I think this is a value that is unlikely to be changed often and hopefully something that will feel natural to play around with after a data viewer rework some time in the not too near future. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.