REditorSupport / vscode-R

R Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=REditorSupport.r
MIT License
1.05k stars 122 forks source link

R helpPanel not able to list packages for "Open help topic using ?" #516

Closed alex-gable closed 3 years ago

alex-gable commented 3 years ago

Describe the bug When clicking "Open help topic using ?" an error is produced.

Additionally, the error message advises that r.helpPanel.rpath ought to be set and pointing to a valid R executable. However, r.helpPanel.rpath is planned to be deprecated, so I'd imagine it should instead refer to r.rpath.* (in my case * = mac)

To Reproduce Steps to reproduce the behavior:

  1. Ensure all rpath settings are set to valid R executable
  2. Open side panel
  3. Click on "Open help topic using ?"

setting.json

  "r.bracketedPaste": true,
  "r.rpath.mac": "/usr/local/bin/R",
  "r.rterm.mac": "/Users/<me>/.local/bin/radian",
  "r.helpPanel.rpath": "/usr/local/bin/R",
  "r.sessionWatcher": true,

Expected behavior Opens QuickPick with all available help aliases

Screenshots If applicable, add screenshots to help explain your problem. You can show the keybord contents by pressing F1 and Developer: toggle screencast mode image

Environment (please complete the following information):

renkun-ken commented 3 years ago

Currently, the error message seems not helpful as the stderr of the R process is not captured. @ManuelHentschel Any idea how we could see what's happening in the background process?

ManuelHentschel commented 3 years ago

@alex-gable Thanks for the detailed bug report! To get an idea what is happening you could try running the script getAliases.R directly in R and check if/why it fails. Do the other help view related commands fail as well or is only this command causing problems?

@renkun-ken I agree that the error message isn't all that useful, I think the best way to improve this would be to show an error message directly from within AliasProvider.readAliases(). Currently this is only done from RHelp.searchHelpByAliases(), which is so far up the call stack that no detailed information about the error is available.

ManuelHentschel commented 3 years ago

The help panel opens a list of packages

Btw, this command is not supposed to open a list of packages, instead it lists all available help aliases (pretty much all functions from all packages) in a quickpick. To open a list of packages, you can expand the entry Help Topics by Package or click the little zap button next to it (Show Quickpick).

renkun-ken commented 3 years ago

@alex-gable WIth #518 merged, you should install the latest development build and then you should be able to see the error message from the R process.

alex-gable commented 3 years ago

Btw, this command is not supposed to open a list of packages, instead it lists all available help aliases (pretty much all functions from all packages) in a quickpick.

I updated the issue description to reflect this. Appreciate the clarification! Incidentally, the QuickPick next to Help Topics By Package works as expected. Search Help Topics Using '??' works as expected as well.

Let me know if I'm looking in the wrong spot, but I don't see the error message from the R process in the Output window. Let me know if I should be trying something different. I confirmed I'm using the 1.6.3 extension fwiw.

Screen Shot 2021-01-10 at 8 25 35 PM
ManuelHentschel commented 3 years ago

To be sure, in order to see the updated error message you need to install the latest development build form the vsix file found here, which will also show as version 1.6.3, but is different from the 1.6.3 on the marketplace (since we don't assign specific version numbers between releases).

Independently from that you could try running getAliases.R and see if it works/what kind of error it produces.

ManuelHentschel commented 3 years ago

Could you please check if the linked PR changes anything? You can install the extension using the .vsix file from the corresponding Action.

alex-gable commented 3 years ago

sorry for the delay. great news! the most recent file seems to be working perfectly. thanks for all the time spent on this