Open PMassicotte opened 2 months ago
Suggestion: could be nice to automatically add the =
character when it is not present in the parameter list (will save some keystrokes :))
I think before it was inserting () and placing the cursor right inside ready to use arguments. It seems that I have to type them manually now.
When I insert the opening parenthesis after a function name, the completion menu with the list of arguments appears immediately.
Suggestion: could be nice to automatically add the = character when it is not present in the parameter list (will save some keystrokes :))
It makes sense. Although the =
character isn't in the output of args()
, if the user is going to type it, the =
character will have to be typed too.
I think before it was inserting () and placing the cursor right inside ready to use arguments. It seems that I have to type them manually now.
When I insert the opening parenthesis after a function name, the completion menu with the list of arguments appears immediately.
yeah me also, but I mean when you select the function, it writes it up in the buffer but without the ()
. Maybe it is just a matter of preference :)
Suggestion: could be nice to automatically add the = character when it is not present in the parameter list (will save some keystrokes :))
It makes sense. Although the
=
character isn't in the output ofargs()
, if the user is going to type it, the=
character will have to be typed too.
For example
[ins] r$> args(lm)
function (formula, data, subset, weights, na.action, method = "qr",
model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE,
contrasts = NULL, offset, ...)
When we build the argument list, we could check if it ends up with =
and if not, insert it?
When we build the argument list, we could check if it ends up with = and if not, insert it?
No need to check. We can simply always insert it unless it is ...
.
yeah me also, but I mean when you select the function, it writes it up in the buffer but without the (). Maybe it is just a matter of preference :)
This would almost always be useful, but not when using a function such as tapply()
which receives a function as its third argument.
yeah me also, but I mean when you select the function, it writes it up in the buffer but without the (). Maybe it is just a matter of preference :)
This would almost always be useful, but not when using a function such as
tapply()
which receives a function as its third argument.
Ah yeah you are right, did not thought about this :) Well I do not have a strong feeling about it :)
Nvim-R's omni completion shows the default value of arguments:
This is useful because the user can immediately realise that there is no need to insert the argument if the argument has a pre-defined value and the value is what he/she would insert. This was the advantage of having the =
sign only for arguments with default values.
ah I see, did not realize it. I will close it as I can see that both ways are perfectly fine.
I think always adding the =
is a good idea, but I have to find the best way of informing cmp-r users the default value of an argument.
ok I will re-open it :) I will think about a good way on my side.
Thank you.
Is it just me, but it seems that the opening/closing parenthesis are not working when selecting a function from the completion menu?
I think before it was inserting
()
and placing the cursor right inside ready to use arguments. It seems that I have to type them manually now.