tidyverse / tidyr

Tidy Messy Data
https://tidyr.tidyverse.org/
Other
1.38k stars 418 forks source link

Re-enable autocompletion for pivot_wider and pivot_longer #1540

Closed olivroy closed 7 months ago

olivroy commented 8 months ago

Autocompletion text in RStudio doesn't currently work for pivot_longer() and pivot_wider(). It seems to be due to the fact that the S3 method is not present in the Rd file.

This PR seems to fix that. I am not sure if this is the right fix, or it is with roxygen2 or RStudio itself..

I installed this version locally and it works.

image

With the current cran version, when tidyr is loaded, the autocompletion doesn't show any text, only the parameters image

It seems that if the method is not in an Rd, RStudio doesn't know where to look for the help text.

If I typed F1 (help) before this PR, I would get the message:

No documentation for ‘pivot_wider.data.frame’ in specified packages and libraries:
you could try ‘??pivot_wider.data.frame’
olivroy commented 7 months ago

No longer needed with RStudio 2024.04.0+426 as a hack was added to fallback on generics to autocomplete methods if the generic is not documented.