Vscode-r: Help viewer not working when Session Watcher enabled over Remote SSH

Created on 14 Jul 2020  路  11Comments  路  Source: Ikuyadeu/vscode-R

Describe the bug
I've been using this excellent extension for several weeks now and love the features. I use it both locally and via Remote-SSH session. As of today however, when running over Remote SSH, I am unable to view help when session watcher is enabled. This feature worked previously (used it last week sometime).

If I start an R session without session watcher, and type something like ??magrittr I will see the plain text documentation in my R session. With session watcher enabled, typing ??magrittr outputs:

> ??magrittr
starting httpd help server ... done

And opens a new tab in VSCode, but the contents of the window are blank. If I run wget http://127.0.0.1... (URL in the newly opened window), I get an html file that I can then open in VSCode.

Have reverted all settings to default but still not working. Running extension version 1.4.3 and tried downgrading to 1.4.2 but same result.

Not sure if this is related, but plots still render fine.

To Reproduce
Steps to reproduce the behavior - see above.

Do you want to fix by self? (I hope your help!)

Yes

Happy to help, just not sure how to debug.

Expected behavior
Requesting help in R session should open rendered html view in a new tab.

Environment (please complete the following information):

  • OS: macOS Remote -SSH to Linux host
  • VSCode Version: 1.47.0
  • R Version: 3.6.3
  • vscode-R version: 1.4.3
bug

All 11 comments

I could reproduce this as you described. It looks like VSCode has something changed in the recent version.

I tried and manage to get it work by running

options(vsc.browser=FALSE)
?get
options(vsc.browser="Active")
?get

Then the webview works properly. I'll take a closer look at what makes the initial attempt fail.

This issue seems to occur with all WebView created from calling browser where an iframe is embedded into the browser, including the shiny app under Remote SSH environment:

shiny::runExample("01_hello")

Thanks for the quick help on this. That work around of settings options, then trying, then setting vsc.browser option does work for me too. Also, thanks for filing those upstream bugs.

Happy to help with testing/development/etc. if I can - please let me know.

It is very likely a bug of WebView port mapping introduced upstream in recent release. I guess we could do nothing on our side at the moment.

Looks like we should constantly checkout our functionalities against latest vscode insider builds.

Just wanted to chime in that the same issue occurs when running vscode-R inside a development container and the workaround provided by @renkun-ken above gets everything working again. So it seems this is not just isolated to SSH sessions.

I reviewed the comments in the issues linked above and it was not clear to me if there is any simpler workaround we can employ while we wait for upstream VSCode and/or Electron to resolve it. I'd like to start showing off VSCode with R in a future screencast and while I can employ the workaround from @renkun-ken , it'd be nice to have a simpler method.

I am also experiencing this problem with remote-ssh. VSCode 1.50 released/updated the Webview View API - will this help resolve the issue? I am not familiar with coding VSCode extensions, but I thought maybe it will help resolve this issue.

For now, I am relying on running R in the terminal and using text-based help pages through the terminal, but the downside is that I cannot view plots or open help pages in separate windows/sidebars, like RStudio.

@jonnybaik https://github.com/microsoft/vscode/issues/102449 is the issue to track this bug introduced in an earlier version of vscode. Hopefully it will be resolved in Oct 2020 release. In fact, it is postponed several times already.

The latest vscode has the feature of auto-forwarding ports that appear in the output of the terminal.

image

If some text like http://127.0.0.1:12345 is printed to the terminal, then vscode will detect that text and forwards that port from remote to local and the help viewer, httpgd graphics, and shiny apps could work properly under remote development now even though the native WebView port forwarding is still broken.

We could trigger the auto port-forwarding by inserting a line that prints the URL to the console before sending request to vscode-R, and vscode will capture the URL and start port forwarding if it detects a valid URL with specific port.

@renkun-ken - the latest version of the plugin available at https://github.com/Ikuyadeu/vscode-R/actions/runs/321213341 resolves this issue.

Not sure your process - do you want to first push the new version of the VSCode add-in so it can be installed normally, or just close this issue now?

As this issue is resolved without depending on the upstream fix, I'm closing this now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dee-L picture Dee-L  路  5Comments

bdeshon picture bdeshon  路  3Comments

renkun-ken picture renkun-ken  路  3Comments

Victsz picture Victsz  路  5Comments

nathaneastwood picture nathaneastwood  路  6Comments