automatic insertion of closing brace?

since formatting fails with a missing brace

This is a key and true point. The formatter often simply crashes on brace mismatch errors, which makes it doubly hard to track down these errors for beginners.