vscode-R
vscode-R copied to clipboard
`R: Open help for selection` fails for some functions
Describe 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
I cannot reproduce what you demonstrate in your screencast. Everything works well here. Not sure what caused this. @ManuelHentschel any idea?
I had the same experience the other day. (Sorry I haven't reported it) At that time, the problem occurred with a package installed from a different repository than the one set as default.
Does calling "Clear Cached Index Files & Restart Help Server" in the R sidebar do anything?
Does calling "Clear Cached Index Files & Restart Help Server" in the R sidebar do anything?
In my case, this fixed the problem!
Does calling "Clear Cached Index Files & Restart Help Server" in the R sidebar do anything?
Yup, this works for me too! Thanks!
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.
@ManuelHentschel Maybe we could put a notice into the error message?
It seems vscode-r don't update the help index for the newly installed packages. I have the same problem for the newly installed packages.
@ManuelHentschel Is it possible to make the background help server more automatic to index the newly installed packages?
I have this same issue. I suspect that this is linked to https://github.com/REditorSupport/vscode-R/issues/1096. When I install new packages, they do not appear in the "Help Topics by Package" list. I have some packages in that list, however, that are both created by myself and installed from CRAN/GitHub so it seems that this just stopped working at some point. I have tried all combinations of "r.helpPanel.cacheIndexFiles": "None"
/"Global"
/"Workspace"
and none of them fix this issue. I even tried reinstalling vscode-r with no luck.
This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.