MarioRicalde / SCSS.tmbundle

The TextMate SCSS Official Bundle. Now Compatible with SublimeText2.
834 stars 110 forks source link

Sass 3.3 &__ and &-- selectors compatibility #167

Closed pepelsbey closed 10 years ago

pepelsbey commented 10 years ago

This block (which output .block__element) is not highlighted properly: &

.block {
    &__element {
        }
    }

screen shot 2014-03-01 at 13 04 57

strann commented 10 years ago

+1

Would love to have this highlight properly.

ghost commented 10 years ago

+1

I would love to see this worked on, too.

joshmatz commented 10 years ago

+1

joshmatz commented 10 years ago

Actually, rather than just mindlessly asking for someone else to do the hard work, I'm going to do some exploring for this. I've never created or modified a Sublime plugin, so bare with me. I'm more hoping someone smarter than I can come along with this info and help out.

This file seems to reference all the highlighting rules. Within it there is a group of rules that are directed towards SCSS selectors.

It just so happens that one of these rules references #tag_parent_reference, which is the &. It appears this rule is set to only match to <string>\&amp;</string>.

There's also a number of other examples for selector matching, like placeholder and classes.

My thinking is that we can modify the #tag_parent_reference to match anything connected to it that is not another selector... Unfortunately this is where I'm stuck on how to do :\

Any thoughts?

ghost commented 10 years ago

Josh, I've never done this before, but I'll look into it as well. I just made a comment today because I upgraded to 3.3 and can't find anything that supports the highlighting the way I'd like it to and wanted to bring attention to this.

pepelsbey commented 10 years ago

@kyleatfine, guys: I have switched to P233/Syntax-highlighting-for-Sass a while ago and don’t have any problems… well, I have some, but not so annoying.

ghost commented 10 years ago

Yes, but that requires switching the default .scss file to use .sass highlighting. Plus I don't need/want the other features that package has. I'd prefer to just have the .scss highlighting upgraded to match Sass 3.3, and considering 3.4 is out now, it's just a good idea to keep updating this one, rather than have to switch packages entirely.

MarioRicalde commented 10 years ago

I'm more than happy to open up this repository to contributions. I've been looking for someone to take over the development of this project for quite some time.

Maybe someone is willing to help?

MarioRicalde commented 10 years ago

For the record - @EnriqueCanals is taking over the project, I just paired with him to get this fixed.

Cheers.

joshmatz commented 10 years ago

Awesome! Thanks for the update :)

ghost commented 10 years ago

Thank you @EnriqueCanals for the update.

yukulele commented 9 years ago

Thank you it's works but their is now a bug with @media (@ highlight syntax error) I use Sublime text 2

otherwise, I cant get this update via package control, I must edit SCSS.tmLanguage manually.