YASStyle + variable_call_indent is quite largely implemented by deferring to DefaultStyle (this is in both p_call and n_call!). However, this leaks quite a fair bit of DefaultStyle formatting decisions through. For example:
julia> s = "f(a, b)"
julia> ft(s, YASStyle()) |> println
f(a, b)
julia> ft(s, YASStyle(); margin=1) |> println
f(a,
b)
julia> ft(s, YASStyle(); margin=1, variable_call_indent=["f"]) |> println
f(
a,
b,
)
I would expect the last two to give the same results. The issue here is that DefaultStyle will insert placeholders after the opening paren and before the closing paren:
julia> fs(:fst, s, YASStyle(); margin=1, variable_call_indent=["f"])
TopLevel 1 lines=1-1 indent=0 len=7
nest_behavior=AllowNest extra_margin=0
└── [1] Call 10 lines=1-1 indent=0 len=7
nest_behavior=AllowNest extra_margin=0
├── [1] IDENTIFIER lines=1-1 val="f"
│ line_offset=1 indent=0
├── [2] PUNCTUATION lines=1-1 val="("
│ line_offset=2 indent=0
├── [3] PLACEHOLDER lines=1-1 val=""
│ line_offset=-1 indent=0
├── [4] IDENTIFIER lines=1-1 val="a"
│ line_offset=3 indent=0
├── [5] PUNCTUATION lines=1-1 val=","
│ line_offset=4 indent=0
├── [6] PLACEHOLDER lines=1-1 val=" "
│ line_offset=-1 indent=0
├── [7] IDENTIFIER lines=1-1 val="b"
│ line_offset=6 indent=0
├── [8] TRAILINGCOMMA lines=1-1 val=""
│ line_offset=-1 indent=0
├── [9] PLACEHOLDER lines=1-1 val=""
│ line_offset=-1 indent=0
└── [10] PUNCTUATION lines=1-1 val=")"
line_offset=7 indent=0
whereas plain old YASStyle won't.
julia> fs(:fst, s, YASStyle(); margin=1)
TopLevel 1 lines=1-1 indent=0 len=7
nest_behavior=AllowNest extra_margin=0
└── [1] Call 8 lines=1-1 indent=0 len=7
nest_behavior=AllowNest extra_margin=0
├── [1] IDENTIFIER lines=1-1 val="f"
│ line_offset=1 indent=0
├── [2] PUNCTUATION lines=1-1 val="("
│ line_offset=2 indent=0
├── [3] IDENTIFIER lines=1-1 val="a"
│ line_offset=3 indent=0
├── [4] PUNCTUATION lines=1-1 val=","
│ line_offset=4 indent=0
├── [5] PLACEHOLDER lines=1-1 val=" "
│ line_offset=-1 indent=0
├── [6] IDENTIFIER lines=1-1 val="b"
│ line_offset=6 indent=0
├── [7] TRAILINGCOMMA lines=1-1 val=""
│ line_offset=-1 indent=0
└── [8] PUNCTUATION lines=1-1 val=")"
line_offset=7 indent=0
YASStyle +
variable_call_indentis quite largely implemented by deferring to DefaultStyle (this is in bothp_callandn_call!). However, this leaks quite a fair bit of DefaultStyle formatting decisions through. For example:I would expect the last two to give the same results. The issue here is that DefaultStyle will insert placeholders after the opening paren and before the closing paren:
whereas plain old YASStyle won't.