mike7515 / code-beautifier

MIT License
19 stars 5 forks source link

Indentation wrong when using LESS nested mixin content #20

Open richmilns opened 6 years ago

richmilns commented 6 years ago

I'm using VSC 1.23.1 and the latest version of this extension. My settings are:

"beautify.options": {
        "end_with_newline": true,
        "preserve_newlines": true,
        "selector_separator_newline": false
    },

When using a LESS mixin which has the ability to pass in nested rules as the mixin content such as:

.lg-up(@rules) {
    @media screen and (min-width: 900px) {
        @rules();
    }
}

What I would expect the code format to look like:

.lg-up( {
    background: #eaeaea;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 60%);
} );

What is actually happening:

.lg-up( {
    background: #eaeaea;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 60%);
}
);

Basically the final closing bracket gets returned onto the next line.

Is there anything I can do in the config to prevent this, or is this an issue with the extension?

Thanks!