Better handling of nested multi-line function definitions, e.g. R6#1290
Conversation
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 635ccb1 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 8cd54b1 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
|
Thanks @MichaelChirico. I feel like what's confusing now is the notion of standard / single / double indent vs hanging / open indent. In the style guide, there is only ever talked about single and handing indent now it seems. Can you please re-name the rule you modified as well as the helper function and test comment to that effect? |
|
Also, if you rebase on |
|
OK, I had a pass at clarifying that, especially in the Rd write-up. pre-commit still stubbornly refuses to pass :) |
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 0272802 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 0ec1076 is merged into main:
Further explanation regarding interpretation and methodology can be found in the documentation. |
|
Can you have a look at my changes @MichaelChirico ? I don't think we actually needed |
|
that's right, I wasn't reading it carefully enough myself. At a glance, my brain morphed it to be EQ_FORMALS but that doesn't make sense. FWIW, we miss cases like function("a"=1) unless styler has already normalized those away by the time we get to this step. I wouldn't stress about it barring a user report. |
|
Thanks. I guess that won't be a problem. |
|
Nice! I assumed it would work since it does in calls: Yet another corner case / inconsistency of the parser to mentally earmark 📝 |
Closes #1136.
Written by Gemini.
One ambiguous case was the existing test case:
styler/tests/testthat/fun_dec/line_break_fun_dec-in.R
Lines 38 to 42 in 290d993
Here, it's a bit tough to decide whether to style this as hanging or "open". I nudged the rule to select "hanging" here because (1)
xandyare in the columns they would be for "hanging" and (2) the)comes on the same line asy. See new test cases for more similar situations.