-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Rstudio completion with "mrgmod" S4 class object #253
Comments
This is more of an RStudio issue I think. |
HI, I'm not sure if this related (this is all at the edge of my mental pay grade!) but recently magrittr assignment pipe (%<>%) doesn't work - instead of assigning the chain of operations to the LHS object, it instead returns the result in the console. However, I have also recently started using the base R pipe (|>) instead of the magrittr pipe (%>%). When I replace base pipes with magrittr pipes, the assignment pipe works as expected. Is this something that can/should be fixed at your (magrittr team) end, or something for the base R folks? Thanks! |
The quote(a %<>% b() |> c())
#> c(a %<>% b()) So there is no appealing way to make it work in a |
Will be fixed in the next version of rstudio. Thanks for your comment. rstudio/rstudio#10538 |
Hello,
First thank you for these awesome packages. Just reporting a minor issue: Rstudio completion does not work on "mrgmod" S4 class objects when used inside a
%>%
pipe. However, because it works with the base|>
pipe, so I assume the problem is related to magrittr, but maybe I'm wrong.These are quite special S4 objects, since they have
names()
and a$
extraction method.I tried to debug Rstudio completion method with
debug(search_envs()[["tools:rstudio"]]$.rs.getRChainCompletions)
. Just noticed that:%>%
, the valuechainObjectName
was equal to "mod", which triggers a[[ ]]
extraction of each element in names, which is the origin of the error messages. Completion aborts.|>
,chainObjectName
was NULL, thus the aforementioned extraction step is skipped (if(length(chainObjectName))
statement), and the completion is provided by an other part of the code. Named elements never got evaluated and the proposed completion was accurate (i.e. returned the arguments of themrgsim
function, but it is the same for any function).Was this difference between
|>
and%>%
expected at this point? Is it only related to the non-standard construction of these "mrgmod" objects, or could something be fixed on your side? Or do you think it is more related to Rstudio?Many thanks in advance
Félicien
The text was updated successfully, but these errors were encountered: