vscode-R: Help not shown when using session watcher

Describe the bug When using the session watcher, R is not able to find the help files. Without the session watcher, I can see the help fine. Plotting and running View() work fine with the session watcher too as they open in a webview, the problem is with the help only.

To Reproduce I don’t understand what is happening, because some times it works, sometimes it doesn’t… but most of the time it doesn’t.

Expected behavior When running help(function) or ?function, it should show the help on this function in a webview panel, but right now it shows an error (see screenshot) Couldn't show help for path: /library/graphics/html/<function>.default.html

Screenshots Screenshot 2021-05-31 at 13 46 02

Do you want to fix by self? I could help if I knew what to do…

My setting.json

// R path for Mac OS X
"r.rterm.mac": "/Library/Frameworks/Python.framework/Versions/3.9/bin/radian",",

// R command line options (i.e: --vanilla)
"r.rterm.option": ["--no-save", "--no restore"],

// An optional encoding to pass to R when executing the file, i.e. 'source(FILE, encoding=ENCODING)'
"r.source.encoding": "UTF-8",

// Keeping focus when running
"r.source.focus": "editor",

// Use active terminal for all commands, rather than creating a new R terminal
"r.alwaysUseActiveTerminal": false,

// Use bracketed paste mode
"r.bracketedPaste": true,

// Enable R session watcher (experimental)
"r.sessionWatcher": true,

My .Rprofile:

options(vsc.plot = FALSE)
options(vsc.browser = "Beside")
options(vsc.viewer = "Beside")
options(vsc.page_viewer = "Beside")
options(vsc.view = "Beside")
options(vsc.helpPanel = "Beside")

Environment (please complete the following information):

  • OS: macOS 11.3
  • VSCode Version: Version: 1.56.2 (Universal) Commit: 054a9295330880ed74ceaedda236253b4f39a335
  • R Version: 4.1
  • vscode-R version: 1.6.8

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Hello all,

I am having a similar problem since I upgraded to R 4.2.1 (on Windows).

With session watcher enabled I get the “Couldn’t show help path” error when using something like ?plot in the terminal. And all of the help features in the R pane return the same / similar path errors. If I disable session watcher, the pane features still don’t work and I get nothing with ?plot.

I am using radian and it doesn’t work whether I set the rterm option or not. .libPaths() returns the right system and user paths for the library. Clearing the cache doesn’t work - seems to hang. Global .Rprofile.

The main difference for me is that it seems to affect all workspaces.

Any ideas? Maybe a permissions thing?

Edit: forgot to say - very similar to #752 as well, except I’m on standard vscode no vscodium.

Edit 2: I’ve also noticed that since the upgrade to R 4.2.1, none of the lintr functionality is working. Seems like maybe there’s a permissions issue or something with R in the background? I tried adding R to path in environment variables, but nothing. I wonder if whatever they had in vscodium that caused the issue in #753 has now made its way to vscode?

Edit 3: I’m a complete moron. I forgot to update Rpath setting! Usually I don’t as it sorts itself out automatically but the last R upgrade I had to set it (and Rterm option, the --binary=etc) for some reason to get everything working. I updated Rterm option this time, but forgot Rpath. Ignore me. FWIW, everything now works again without setting either Rterm option or Rpath. Not sure what about my R 4.2.0 installation caused the initial hiccup.

I had this problem and it turned out I had a typo in r.rpath.windows but not r.rterm.windows (or maybe it was the other way around). So R console, plots, etc. worked fine, it was only the help section that was broken.

It might be helpful for the extension to provide documentation on the difference between these two paths. I don’t really understand why we need to specify both since they point to the same executable.

I didn’t know whether this could help you, I have solved it by adding a argument in r.rterm.option for I used radian terminal ("--r-binary=/usr/lib/R/bin/R").

here is my vscode-server settings.json:

{
    "[r]": {
        "editor.rulers": [
            80 
        ],
        "editor.wordWrap": "bounded",
        "editor.wordSeparators": "`~!@#%$^&*()-=+[{]}\\|;:'\",<>/?",
        "rewrap.autoWrap.enabled": true,
        "rewrap.wrappingColumn": 80,
        "rewrap.doubleSentenceSpacing": true
    },
    "r.lsp.debug": true,
    "r.alwaysUseActiveTerminal": true,
    "r.bracketedPaste": true,
    "r.rpath.linux": "/usr/lib/R/bin/R",
    "r.rterm.linux": "/home/*****/.local/bin/radian",
    "r.rterm.option": [
        "--no-save",
        "--no-restore",
        "--r-binary=/usr/lib/R/bin/R",
        "--local-history"
    ],
    "r.plot.useHttpgd": true,
    "r.session.levelOfObjectDetail": "Detailed",
    "r.session.objectLengthLimit": 100,
    "r.session.viewers.viewColumn": {
        "plot": "Active",
        "viewer": "Active",
        "view": "Active",
        "helpPanel": "Active"
    }
}

It can work for me now.