Open Rohanator9000 opened 4 years ago
@Rohanator9000 implementing this is a little bit tricky, not because it hard to implement but because its hard to implement while not changing the behaviour of other parts in the formatter.
it might take a while to implement, if you want to continue to use the formatter with angular custom elements you can use //R
second part of the comment shows how to use //R
.
Understood, thanks for the information. How can I help to implement this?
@Rohanator9000 if you want to try, you need to download the repo then npm i
, then change the src/index.ts:SassFormatter.isBlockHeader
method, the job of the isBlockHeader
method is to return a boolean if the current line is a class, id, mixin etc, so for angular elements the method needs to return true
if its an angluar element or class, id etc and false
when the line is a property or variable or anything else that doesn't determine the indentation of the next line.
you should ignore the commented lines they are just there so i know what i already tried, you can delete them if you want to.
to run the tests run npm run test:watch
Describe the bug The formatter doesn't treat Angular elements like HTML elements.
To Reproduce Create a new .sass file with some angular elements. Then, format.
Expected behavior I expect the formatter to treat the Angular elements properly.
Screenshots Before formatting:
After formatting:
Desktop (please complete the following information):
Additional context Based on the syntax highlighting, it seems like the extension is recognizing the Angular elements as values.