Open tkf opened 2 years ago
hmmm so what's going on is it thinks the width of the code < the maximum width so it joins the lines which in this case ends up with a strange format.
If you just some 2 multiline strings (no binary op) then it doesn't do this right?
Yeah, I think this is expected:
julia> code = """
f(
\"\"\"
string
\"\"\",
\"\"\"
string
\"\"\",
)
""";
julia> print(code)
f(
"""
string
""",
"""
string
""",
)
julia> print(format_text(code))
f(
"""
string
""",
"""
string
""",
)
My workaround ATM is to put some comments inside:
julia> code = """
f(
# workaround
"a" => \"\"\"
string
\"\"\",
"b" => \"\"\"
string
\"\"\",
)
""";
julia> print(code)
f(
# workaround
"a" => """
string
""",
"b" => """
string
""",
)
julia> print(format_text(code))
f(
# workaround
"a" => """
string
""",
"b" => """
string
""",
)
I couldn't find the issue (maybe #501 is the closest) but I find this behavior strange
Similar with
=>
:I checked this with