languageserver
languageserver copied to clipboard
Add `::` after the package name
On RStudio or radian, we will see a candidate like package::, and we don't have to type :: ourselves when writing a function name without omitting the package name package::function().

I wonder if languageserver could present such candidates.
It should be an easy pick https://github.com/REditorSupport/languageserver/blob/master/R/completion.R#L65.
If we use ggplot2 as the label but ggplot2:: as the insert text, it would be undesired if the user is typing in function calls like library(ggplot2::).
Also, user typing :: also triggers completion of exported objects in the package, but inserting ggplot2:: will not trigger completion in vscode.
Thank you both !
If we use
ggplot2as the label butggplot2::as the insert text, it would be undesired if the user is typing in function calls likelibrary(ggplot2::).
~~It looks like radian has two independent candidates.~~
Does radian detect the library and change which one to show?
https://github.com/randy3k/radian/blob/ddca690893e7c6197ce7afd2f9f36d52f1201c4d/radian/completion.py#L16-L18


Also, user typing
::also triggers completion of exported objects in the package, but insertingggplot2::will not trigger completion in vscode.
I get it. It would certainly be great to see all the candidates displayed.
However, if we remember the name of the desired function, for example ggplot(), typing g will list the candidates starting with g.

So, I think it will be more convenient in actual use.