P233 / Syntax-highlighting-for-Sass

A Sublime Text 3 package for highlighting both Sass and SCSS syntax.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSS3 doesn't play nice with SASS extension

olivermuc opened this issue · comments

It looks like I can't have the cake and eat it, too.

The problem: CSS3 extension requires the "file type" to be set to CSS3 to take effect.
The same goes for the SASS extension to enable SASS relevant support.

So it appears that both extensions are mutually exclusive, as I can't seem to configure any to also be active when the other file type is being loaded.

Any ideas on how to enable both CSS3 autocompletion + SASS support for a *.scss file?

Thanks!
Oliver

commented

css3 auto complete only work under css3 scopes, check ryboe/CSS3#81

@ctf0 I am not looking for LESS or SASS support to be added to CSS3.

I am looking for a way (it could be a simple code fix to expand scope) to make CSS3 be active on more extensions than just .css

Emmet for instance can easily be configured to hook into any file extension.
Hence I could use Emmet for CSS shortcodes, but to be frank, I hate them :) and would much rather use CSS3‘s drop down list and auto complete.

Edit: If I force a SCSS file to be considered a CSS3 type, it works, but then obviously I don‘t have any SAAS suport. That little test just showed one thing, CSS3 could easily support .scss files if configurations options would allow to set accepted file extensions.
Just like Emmet does.

commented

@olivermuc here is the file responsible for the compilation https://github.com/y0ssar1an/CSS3/blob/master/css3_completions.py as u can see it works based on scopes, so changing the sass file syntax to css3 will work because of the scope names thats why i added the less/sass support ticket link because apparently y0ssar1an doesnt have plans for supporting anything other than its own package

The correct approach to this isn't to add support in the css3 package (it correctly offers its features to code matching the source.css scope), but to change the scope for scss to source.css.scss. This indicates that scss is a superset of css and as such should receive features enabled for css. My pul request #96 makes this change (and a bunch more). FYI, LESS already made the scope change and should be compatible with the css3 package.