correlationfunnel icon indicating copy to clipboard operation
correlationfunnel copied to clipboard

fix: Check `getThemeInfo` existence

Open h4rvey-g opened this issue 6 months ago • 0 comments

In VS Code, loading correlationfunnel will raise error because of rstudioapi::getThemeInfo()

r$> library(correlationfunnel)
Error: package or namespace load failed for ‘correlationfunnel’:
 .onAttach failed in attachNamespace() for 'correlationfunnel', details:
  call: rstudioapi::getThemeInfo()
  error: This {rstudioapi} function is not currently implemented for VSCode.

While R extension in VS Code has supported some of rstudioapi functions, getThemeInfo() is not included. Add rstudioapi::hasFun("getThemeInfo") besides rstudioapi::isAvailable() will solve the error

r$> rstudioapi::isAvailable()
[1] TRUE

r$> rstudioapi::hasFun("getThemeInfo")
[1] FALSE

h4rvey-g avatar Aug 31 '24 07:08 h4rvey-g