`R: Open help for selection` fails for some functions
See original GitHub issueDescribe the bug
r.helpPanel.openForSelection
(R: Open help for selection) sometimes fail to work although documentation-on-hovering does.
See the example below where I cannot use the command to open the documentation for glmnet::glmnet()
, although the documentation shows when hovering (via the language server), and also opens up correctly when I execute ?glmnet
. This also happens for instance with the function bag()
from the caret package, so this is not a problem only with functions named exactly as the package. For the built-in function lm()
and also for other functions such as ggplo2::geom_point()
the command works fine.
To Reproduce Steps to reproduce the behavior:
- Open an
.R
file. - Write the name of a function in the file.
- Highlight the function name and select
R: Open help for selection
from the command tool box. - See error
Do you want to fix by self? (We hope your help!)
Yes, I’ll take a look at it.
setting.json
:
{
"r.rterm.linux": <path-to-radian>,
"r.sessionWatcher": true,
"r.rmarkdown.codeLensCommands": [
"r.runCurrentChunk",
"r.runAboveChunks",
"r.runAllChunks"
],
"r.bracketedPaste": true
}
Expected behavior
I expected the documentation to open up.
Environment (please complete the following information):
- OS: Linux
- VSCode Version: 1.56.2
- R Version: 4.0.5
- vscode-R version: 1.6.8
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (9 by maintainers)
Does calling “Clear Cached Index Files & Restart Help Server” in the R sidebar do anything?
Glad to hear this worked. If you frequently run into this issue, you can set
"r.helpPanel.cacheIndexFiles": "None"
(we could also use this as default to avoid confusion, not sure how the performance of the the help viewer is for other users).As a side note, usually you don’t need to select the entire word you want to look up, having the cursor inside the word should be enough.