Access the RStudio API (if available) and provide informative error messages when it's not.
This version of rstudioapi can be found in the following snapshots: