JuliaFormatter.jl icon indicating copy to clipboard operation
JuliaFormatter.jl copied to clipboard

Odd line breaking in YASStyle

Open YingboMa opened this issue 3 years ago • 2 comments

julia> using JuliaFormatter

julia> str = raw"""
               throw(ExtraEquationsSystemException(
                   "The system is unbalanced. "
                   * "There are $n_highest_vars highest order derivative variables "
                   * "and $neqs equations.\n"
                   * error_title
                   * msg
               ))
       """; print(str)
        throw(ExtraEquationsSystemException(
            "The system is unbalanced. "
            * "There are $n_highest_vars highest order derivative variables "
            * "and $neqs equations.\n"
            * error_title
            * msg
        ))

julia> format_text(str, SciMLStyle()) |> print
throw(ExtraEquationsSystemException("The system is unbalanced. "
                                    *
                                    "There are $n_highest_vars highest order derivative variables "
                                    * "and $neqs equations.\n"
                                    * error_title
                                    * msg))

julia>

julia> format_text(str, YASStyle()) |> print
throw(ExtraEquationsSystemException("The system is unbalanced. "
                                    *
                                    "There are $n_highest_vars highest order derivative variables "
                                    * "and $neqs equations.\n"
                                    * error_title
                                    * msg))

YingboMa avatar May 24 '22 14:05 YingboMa

could be viewed as odd but it's not a bug, that's how YASStyle breaks lines. Since SciMLStyle fallbacks to YASStyle it'll do this, you would have to change this in SciMLStyle for it to be different.

domluna avatar May 24 '22 14:05 domluna

Yeah, I think this is fine. One can always change it manually.

YingboMa avatar May 24 '22 15:05 YingboMa