julia-vscode / DocumentFormat.jl

Auto-formatter for Julia
Other
62 stars 18 forks source link

Formatting broadcasted exponentiation #107

Closed Octogonapus closed 4 years ago

Octogonapus commented 4 years ago

x .^ 2 is formatted as x.^2 (the spaces are removed). Is this a deliberate design decision? I would rather that the operator be spaced like other operators (i.e., x .^ 2).

Octogonapus commented 4 years ago

I reviewed the operator associativities and it seems like it would be better to keep the formatting as-is because ^ and .^ are both right-associative (unlike how .+ becomes left-associative).