moodymudskipper / nakedpipe

Pipe Into a Sequence of Calls Without Repeating the Pipe Symbol.
69 stars 7 forks source link

column autocompletion? #10

Closed daranzolin closed 4 years ago

daranzolin commented 4 years ago

I am still a convert to nakedpipe, but the one disadvantage I've experienced is the absence of column autocompletion within various tidyverse functions. For example, I get this from the pipe:

col-autocomplete

But nothing from nakedpipe:

noautocomplete

As I tweeted, I'm still loving the coding experience and will continue using it. But the autocompletion would be amazing. Admittedly, I have no idea how it works behind the scenes.

moodymudskipper commented 4 years ago

RStudio have implemented an adhoc behavior for magrittr's pipe, I'm not sure if I can leverage it for the naked pipe, it's probably hardcoded and I don't see them supporting the nakedpipe even when it's on CRAN :). I ll leave this open just in case but don't hold your breath! The thing that annoys me personally is that I get warning icons in the margin for wrong number of arguments, which you don't get with magrittr.

moodymudskipper commented 4 years ago

BTW thanks so much for the exposure on twitter, this really helps

daranzolin commented 4 years ago

Do you think it's worth filing an issue on the RStudio repo? There are numerous issues related to autocompletion.

moodymudskipper commented 4 years ago

Maybe but probably better once the package is on CRAN, for now I don't think it'll be taken seriously. Also I'm not sure what behavior I expect in a more general situation than the example you gave, so I'd need to define those expectations, I'm spending a few days without computer now, writing all this from my phone, I'll take a look when I'm back to geeking.

moodymudskipper commented 4 years ago

I think that what RStudio does is that when the lhs of a pipe chain is a symbol, and this symbol is bound to a list (incl data.frame), an environment, or a named vector, it will add these names to the autocompletion candidates.

In the example below we see that despite the changes being made to keep only the first column, all the columns are still present in the suggestions:

image

oddly enough the functions themselves didn't benefit from that :

image

moodymudskipper commented 4 years ago

closing for now to unclutter the issues as I have no leverage on this

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.