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
{{ message }}
Repository navigation
Native Pipe & Diagnostics (Check arguments to R function calls) #10124
It would be great if R Studio could respect the native pipe in the diagnostic: Check arguments to R function calls (Disabling that tick box is not an option)
The behavior right now (native pipe)
Expected behavior (already working using magrittr’s pipe)
@kalaschnik Thank you for raising this! Can you please provide the environment you're working with? I can't reproduce this problem, at least in recent versions of RStudio Desktop such as 2021.09.01+372 on MacOS 12.1 with R 4.1.1.
System details
RStudio Edition : <!-- Desktop or Server -->
RStudio Version :
OS Version :
R Version :
Thanks for reporting this. I've reproduced the issue in 2022.06.0+352
In the meantime, as a workaround, instead of leaving the function call blank, you can use the underscore placeholder. See below
In 2022.02.02 build 485, line 2 does not raise a diagnostic warning, but line 3 still does. Ideally, none of these should raise an issue, as they are all valid code
@jgutman; @kevinushey thanks for checking this. Is the underscore the already implemented feature for named argument coming in R 4.2?
Yes, if an underscore is used as a placeholder with the |> pipe, no diagnostic warning is raised, whether used with a named or unnamed argument. This was added in the latest patch release, see release notes here . We unfortunately neglected to fix the diagnostic issue when no placeholder is used, but thanks for alerting us to this issue, and we plan to add support for this very shortly.
Activity
ronblum commentedon Nov 23, 2021
@kalaschnik Thank you for raising this! Can you please provide the environment you're working with? I can't reproduce this problem, at least in recent versions of RStudio Desktop such as 2021.09.01+372 on MacOS 12.1 with R 4.1.1.
System details
kalaschnik commentedon Nov 24, 2021
I just updated R and RStudio to the latest version. Issue is still persistent.
kalaschnik commentedon May 5, 2022
I just updated R and RStudio to the latest version. Issue is still persistent.
jgutman commentedon May 5, 2022
Thanks for reporting this. I've reproduced the issue in 2022.06.0+352
In the meantime, as a workaround, instead of leaving the function call blank, you can use the underscore placeholder. See below
In 2022.02.02 build 485, line 2 does not raise a diagnostic warning, but line 3 still does. Ideally, none of these should raise an issue, as they are all valid code
kevinushey commentedon May 5, 2022
We might need to update this definition:
rstudio/src/cpp/core/include/core/r_util/RTokenizer.hpp
Lines 563 to 567 in c260961
(note that the old definition tried to capture most variations of the magrittr pipe operator)
kalaschnik commentedon May 6, 2022
@jgutman; @kevinushey thanks for checking this.
Is the underscore the already implemented feature for named argument coming in R 4.2?
jgutman commentedon May 6, 2022
Yes, if an underscore is used as a placeholder with the
|>pipe, no diagnostic warning is raised, whether used with a named or unnamed argument. This was added in the latest patch release, see release notes here . We unfortunately neglected to fix the diagnostic issue when no placeholder is used, but thanks for alerting us to this issue, and we plan to add support for this very shortly.romainfrancois commentedon May 13, 2022
Verified on
main(build not available yet):