Is it possible to customize Eclipse Formatter to avoid mangling sass (.scss)

I am very pleased with Eclipse over everyone, and I use it and the CLI (for NPM tidy and GIT), however I noticed some rather unpleasant things when editing sass files (using .scss flavor, I haven \ 't explored .sass flavor).

The first is a minor, inconvenience actually, and everything that follows the "}" is displayed as green, I felt that I could ignore it, since this is a fairly direct incorrect application of the rule, which makes sense in simple CSS, But CTRL + SHIFT + F completely breaks, and I suspect it's reasonable ... it does what makes sense in CSS, but not in sass. For instance:

/* _structure.scss, include in style.scss html { height: 99%; min-width: 18em; max-width: 60em; margin: 0 auto; } body { height: 100%; background-color: $bg_dark; } .main { position: absolute; top: 0; bottom: 0; text-align: center; background-color: $bg_medium; @include wb($bishop) { left : 10%; right: 10%;} @include wb ($queen) { left: 20%; right: 20%;} & h1 { top 2rem; color: $text_light; font: { size : 4rem; } line-height: 3rem; } & h2 { color: $text_medium; font: { size : 3rem; } line-height: 7rem; } } 

which needs to change is very small:

 /* _structure.scss, include in style.scss html { height: 99%; min-width: 18em; max-width: 60em; margin: 0 auto; } body { height: 100%; background-color: $bg_dark; } .main { position: absolute; top: 0; bottom: 0; text-align: center; background-color: $bg_medium; @ include wb($bishop) { left : 10%; right: 10%; } @ include wb ($queen) { left: 20%; right: 20%; } & h1 {top 2rem; color: $text_light; font: { size : 4rem; } line-height : 3 rem ; } & h2 { color: $text_medium; font: { size : 3rem; } line-height : 7 rem ; } } 

I found this question: Is there an Eclipse editor for scass Sass files or a plugin for syntax coloring? which talks about part of the problem, but does not solve all of this. I suspect there is some way to get into xml that specifically regulates this behavior, but since I am neither a hardcore XML nor a hardcore eclipse, I would prefer a simpler solution.

+4
source share

Source: https://habr.com/ru/post/1487959/


All Articles