Hirse / brackets-beautify

Brackets Extension to beautify JavaScript, HTML, and CSS files.
MIT License
34 stars 3 forks source link

Miss-formatting LESS file #7

Closed edoher closed 9 years ago

edoher commented 9 years ago

Hi, the plugin so far works great. Today I found an issue that took me a lot of effort to understand.

#main > header.big-menu nav ul.level-3 > li > ul li div a:hover {
    &:extend(#main > header.big-menu nav ul li > a: hover);
}

Beautify added a random space in that piece of code, within a LESS file of over 1000 lines, making it impossible for me to compile it and even harder for me to understand what was wrong.

For some reason, Beautify added a space in "a:hover", making it be "a: hover", therefore rendering it invalid.

Please check that error, because probably I'm not the only one who had a hard time with it.

Thanks!

Hirse commented 9 years ago

I am sorry you are having issues with less formatting. Unfortunately this is caused by issues in the underlying library. There are some issues about less formatting, the one that comes closest to your described behavior is probably https://github.com/beautify-web/js-beautify/issues/631. Please add a comment there or open another issue and feel free to mention me.

Regarding this extension, I can only advise you to not use it for less files at the moment and deactivate Beautify-on-Save for those by adding this to the brackets.json:

{
    "language": {
        "less": {
            "hirse.beautify.onSave": false
        }
    }
}
edoher commented 9 years ago

Thanks, that's working!