SCSS and { position

If I start an SCSS file, and type in: ".classname" and press enter, it indents the next line, it is appears like this (| is caret):

.classname
  |

Where I would normally want it to work properly to my coding style to allow me to do:

.classname
{
  |

I have found the location in the preferences where code styles are done, but there is nothing to address this preference.

Is there a way to not assume { is on the same line?

So I do not want to write like this:

.classname {
  |


- zzing.

3 comments

Hi there,

Please check Settings | Code Style | CSS | Other | Braces placement = Next Line

Works fine when manually reformatting the code (Code | Reformat Code...) -- don't know if it will affect actual editing/typing

0

This does indeed work for CSS, but the SCSS support is mixed up on how to behave.

0

First of all -- when you "type ".classname" and press enter" .. the opening brace will NOT be added automatically anyway, regardless of that setting. There is a ticket about adding braces automatically when using Complete Current Statement action (Ctrl+Shift+Enter) -- http://youtrack.jetbrains.com/issue/WEB-7785 . When implemented, it should adhere to that setting, so ".classname and Ctrl+Shift+Enter" should produce the desired for you result.

That ticket mentions CSS .. but I guess it will apply to SCSS as well (since it's very similar in this regard) -- but you better confirm this in that ticket with the developer (maybe separate ticket for SCSS is required).

but the SCSS support is mixed up on how to behave

You are welcome to submit new tickets to the Issue Tracker with your concrete ideas/suggestions/etc about current and desired behaviour: http://youtrack.jetbrains.com/issues/WEB

0

Please sign in to leave a comment.