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

Formatter removing necessary semi-colon to concatenate arrays

Open mrazomej opened this issue 1 year ago • 4 comments

As part of my code hygiene customs, I break lines every 79 characters. But the auto-formatting feature of the package doesn't allow me to do it in the following context (the code is irrelevant since what matters is what the autoformatting part does):

I want to concatenate two vectors in the following way:

vector_to_concatenate = [
    repeat([foo], foo_times); 
    repeat([bar], bar_times)
]

But when I save the file, the autocorrect erases the semi-colon; needed for the concatenation. Obviously, in this example, I wouldn't need to break lines since I can write

vector_to_concatenate = [repeat([foo], foo_times); repeat([bar], bar_times)]

But if the variable names are longer, making this line > 79 characters, I would not want to have it as a single line. Is this something that can be easily fixed?

Thanks in advance for your help. I'm a big fan of what you guys are doing!

mrazomej avatar Feb 15 '23 14:02 mrazomej