You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coding in R and using a pipe (either %>% or |>) results in auto-suggestions suggesting the first argument of the function. Almost always, the first argument does not need to be specified since it's piped into the function (screenshot 1 -- I'm entering name but the board argument is highlighted).
I looked back to RStudio's behaviour and there's no argument highlighting so it's not as in your face, which is probably why I haven't noticed this before (2).
I don't explicitly name arguments in data transformation scripts, especially when using dplyr. When you do specify the argument it highlights the correct argument (3).
In certain situations, I don't think you can specify the correct argument even if you wanted to (4 -- most dplyr situations).
What did you expect to happen?
Suggestions recognizing there is a preceding pipe and highlighting the most likely argument (usually the second argument of the function).
Were there any error messages in the output or Developer Tools console?
No.
The text was updated successfully, but these errors were encountered:
For what it's worth - we're currently chasing down a set of tricky issues in RStudio with pipes, as a result of some of the first vs second argument being hidden, shown, etc: rstudio/rstudio#13613
Users seem to be surprised by the behavior in both directions (first vs second argument preference).
Also, both the magrittr pipe and the base R pipe allow for piping to arguments beyond the first as well.
In theory, because the R kernel has a proper AST it can examine, we could handle each of these cases -- this is something that's much harder to do in RStudio.
Positron Version:
Positron Version: 2023.09.0 (Universal) build 143
Code - OSS Version: 1.79.0
Commit: 8277b72
Date: 2023-09-14T02:38:05.517Z
Electron: 22.3.10
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.6.0
Steps to reproduce the issue:
Coding in R and using a pipe (either
%>%
or|>
) results in auto-suggestions suggesting the first argument of the function. Almost always, the first argument does not need to be specified since it's piped into the function (screenshot 1 -- I'm enteringname
but theboard
argument is highlighted).I looked back to RStudio's behaviour and there's no argument highlighting so it's not as in your face, which is probably why I haven't noticed this before (2).
I don't explicitly name arguments in data transformation scripts, especially when using
dplyr
. When you do specify the argument it highlights the correct argument (3).In certain situations, I don't think you can specify the correct argument even if you wanted to (4 -- most
dplyr
situations).What did you expect to happen?
Suggestions recognizing there is a preceding pipe and highlighting the most likely argument (usually the second argument of the function).
Were there any error messages in the output or Developer Tools console?
No.
The text was updated successfully, but these errors were encountered: