This PR adds a specific test for the availability of the rstudioapi::getThemeInfo() function before checking for the IDE theme colors.
There are scenarios where rstudioapi::isAvailable() will return TRUE, but getThemeInfo() isn't available. In those cases, rs_theme_colors() will error and thematic will fail ungracefully.
This PR adds a check using rstudioapi::findFun("getThemeInfo") and then for extra safety wraps the whole thing in a tryCatch() in a new try_get_theme_info() helper function.
This PR adds a specific test for the availability of the
rstudioapi::getThemeInfo()
function before checking for the IDE theme colors.There are scenarios where
rstudioapi::isAvailable()
will returnTRUE
, butgetThemeInfo()
isn't available. In those cases,rs_theme_colors()
will error and thematic will fail ungracefully.This PR adds a check using
rstudioapi::findFun("getThemeInfo")
and then for extra safety wraps the whole thing in atryCatch()
in a newtry_get_theme_info()
helper function.