-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to add or at least not remove trailing semi-colons? #565
Comments
can you give an example ?
the semicolons are preserved |
julia> format_text("""
begin
a = rand(100);
sum(a)
end
""") |> println
begin
a = rand(100)
sum(a)
end When debugging, I often run the contents of blocks in my REPL line by line. |
ok ic CSTParser doesn't support semicolons really at all but I think we could do something similar to what we do for inline comments to catch these |
Could we also get have an option we can set in our |
The removal of trailing semicolons can actually break code. Minimal example: julia> code = raw":($([]...);)"
":(\$([]...);)"
julia> code |> Meta.parse |> eval
quote
end
julia> format_text(code) |> Meta.parse |> eval
ERROR: syntax: "..." expression outside call |
When running code in the REPL, I prefer not to have it flooded with text. Especially every time a function returns a long vector.
Yet JuliaFormatter strips semicolons, meaning that is exactly what happens.
Note that code inside various blocks will often be run in the REPL whilst debugging.
The text was updated successfully, but these errors were encountered: