Add links to help pages in hover#578
Conversation
|
@ManuelHentschel I guess we could move this feature to CodeActions so that hover from languageserver will not already appear above these help links? |
|
Looks like the CodeActions may not be a proper place to do this as it does nothing to the source code. |
I didn't manage to add the help links anywhere in the language server, since commands in markdown links only work if |
|
That does look nice. How does the communication between languageserver and helppanel work here? Providing these links from within the languageserver might also allow us to only show relevant links (e.g. if the ls knows, which package the function is from, or if the currently selected word is inside a string). |
|
It is not provided by languageserver. I just switch from |
|
In this case, I'm not sure if the setting |

What problem did you solve?
This PR adds a hover provider that that shows links to matching help pages when hovering over names of R functions.
How can I check this pull request?
Hover over the name of a (documented) R function, wait for hover to show up and check if a link to a help page shows up.
Limitations:
On my machine the link shows up below other hovers, which can be a bit cumbersome if a large help page is shown e.g. by the languageserver.
The hover can be a bit eager, e.g. showing
dplyr::nwhen hovering over a singlen. This would be rather hard to solve properly, since the hover is unaware of any tokenization or other languageserver functions. If this is too annoying, the hover can be disabled completely usingr.helpPanel.enableHoverLinks = false