Community
Participate
Working Groups
i have this function: function test1() { editor.setContentByPath("sample.html") // Show the editor } now i select the body (so between { and } not including }) then press CTRL-SHIFT-F, then i get this: function test1() { function test1 () { editor.setContentByPath ("sample.html") // Show the editor } } so the contents of the complete file (if i had more functions they would appear also in there) is copied into the lines i selected and pressed format for. second issue is that i loose spaces /** * This is my greatest function */ function test() { } becomes /** * This is my greatest function */ function test() { }
Created attachment 135313 [details] JavaScript formatter patch (fixes 2 bugs) Fixed both bugs - formatting fragments and multi-line comments.
Hi Johan, I will commit this patch. Regards, Alex
Created attachment 135322 [details] JavaScript formatter patch (replacement) Fixed bug with object literals (it didn't work if property name is not identifier)
Committed to HEAD.
Created attachment 135350 [details] JavaScript formatter patch (replacement - 2) Added new feature: function body may be without braces.