nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
368 stars 19 forks source link

Could not find the function .vsc.browser #117

Closed barbosawf closed 2 years ago

barbosawf commented 2 years ago

Describe the bug

Could not find the function .vsc.browser

image

Environment

R.profile

Firstly, I use the following code to give access to Rprofile

usethis::edit_r_profile()

then, in Rprofile I wrote the following code:

if (interactive() && Sys.getenv("TERM_PROGRAM") == "vscode") {
  if ("httpgd" %in% .packages(all.available = TRUE)) {
    options(vsc.plot = FALSE)
    options(device = function(...) {
      httpgd::hgd(silent = TRUE)
      .vsc.browser(httpgd::hgd_url(), viewer = "Beside")
    })
  }
}
eitsupi commented 2 years ago

I don't think this is a httpgd problem. Where did your Rprofile code come from? The .vsc.browser function does not seem included in vscode-R. https://github.com/REditorSupport/vscode-R/blob/c76d3dfe81d265ccbde9d8314cc39f6601e1d758/R/session/vsc.R

barbosawf commented 2 years ago

Hello! It comes from here: https://renkun.me/2020/06/16/using-httpgd-in-vscode-a-web-based-svg-graphics-device/ Which code could I write in .Rplofile?

eitsupi commented 2 years ago

Sorry, .vsc.browser exist here. https://github.com/REditorSupport/vscode-R/blob/3e483c311798e2136ee36bb18ef0f9374d281e60/R/session/init.R#L64

Anyway, this is not a httpgd issue but a vscode-R configuration, so I suggest you close this issue and ask your question in the vscode-R repository.

barbosawf commented 2 years ago

Ok! Thanks!

jiangfenglyu commented 1 year ago

hope this issue link could give you some help. https://github.com/REditorSupport/vscode-R/issues/1094

best regards