I'm trying to "beautify" sql code in codeMirror .
Autoformatting in not supported in codeMirror since v2 (current version is v4)
I've tried to use the old module formatting.js with autoFormatRange function ( the previous question on StackOverflow here). It doesn't seem to work properly with SQL. It makes indentation without any linebreaks
Did anyone figure out how to get this feature working on codeMirror v4 with SQL?