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
However, we generally don't want two spaces. If the first argument of the indenting call follows on the same line, we want to indent depending on the length of the indenting token (at least RStudio does that):
The illustrative example above is actual a special case for which it is easy to get the correct indention, since we simply have to check the token length of very_long_call_here (and add two spaces) and we are there. However, the real challenge is to get something like the following right:
a<- call(2,
2
)
Here, we essentially have to know where the token call starts, not just how long it is. We only need to know the position of the token relative to the indention though, which is different from #65, where we probably need to know the absolute position of the token.
Agree that for the tidyverse style guide, only function declarations are relevant. However, I think it is preferable to also implement it for function calls and then add a rule that adds a line break after the opening round brace so we can leave it to the style guide in use whether or not to also indent token-dependent for function calls.
Activity
lorenzwalthert commentedon Jul 5, 2017
The illustrative example above is actual a special case for which it is easy to get the correct indention, since we simply have to check the token length of
very_long_call_here(and add two spaces) and we are there. However, the real challenge is to get something like the following right:Here, we essentially have to know where the token
callstarts, not just how long it is. We only need to know the position of the token relative to the indention though, which is different from #65, where we probably need to know the absolute position of the token.krlmlr commentedon Jul 5, 2017
This is relevant for
function()declarations in the tidyverse style guide.lorenzwalthert commentedon Jul 30, 2017
Similar to #94
lorenzwalthert commentedon Jul 31, 2017
Agree that for the tidyverse style guide, only function declarations are relevant. However, I think it is preferable to also implement it for function calls and then add a rule that adds a line break after the opening round brace so we can leave it to the style guide in use whether or not to also indent token-dependent for function calls.