madskristensen / WebEssentials2012

http://vswebessentials.com
Other
95 stars 46 forks source link

LESS formatter corrupts nesting / hierarchichal structure #54

Open ghost opened 10 years ago

ghost commented 10 years ago

I've been running into this quite a bit lately and it's really starting to negatively impact my workflow. At least 15 times now, I've entered a closing brace "}" or cut / paste a snippet of LESS from one part of my document to another, and suddenly my entire file goes wonky, and I'm now either missing one or more closing braces, or its randomly inserted them at various locations in the file. If I don't catch this right away, I end up having to back-track / undo whatever work I've done until I can find the point that the formatting "broke".

I've noticed two scenarios where this seems to happen. 1. If an ending brace is "highlighted" when I enter another closing brace, and 2. if I have a line of commented "//" text directly after an opening bracket. This causes a bunch of "valid" LESS to randomly get moved up to the "commented" line and become a part of the commented text, thereby breaking the file.

Finally, the LESS formatter seems to be randomly "sorting" my styles. This is not a breaking bug, but it is annoying, as I like my styles to be sorted in a specific order, and this undoes that every time the file gets formatted.

Please take a look at this as soon as possible.