AutoFileName icon indicating copy to clipboard operation
AutoFileName copied to clipboard

How to AutoFileName with file .scss ?

Open tf25 opened this issue 11 years ago • 7 comments

How to AutoFileName with file .scss ?. I use Sublime text 3 build 3059, win 8.1 64 bit

tf25 avatar Feb 25 '14 16:02 tf25

I second this. I noticed the scopes in the autofilename.sublime-settings has scss within it, but it still isn't working with .scss and .sass

// Specify which scopes will trigger AutoFileName
"afn_valid_scopes":["string","css","sass","less","scss"],

alex-martinez avatar Apr 29 '14 22:04 alex-martinez

Figured out the issue. This might help others. If you have the SASS package installed and have you syntax set to Sass, the autofilename feature doesn't work for some reason. However if you install the SCSS package, it will work with this plugin.

alex-martinez avatar Apr 29 '14 23:04 alex-martinez

This has to do with how the packages handle (or not) the scope. I started to take a crack at it and made some progress but after awhile it got a little hairy. Basically, in CSS the extracted scope from url() is () but in SASS it is url(). You also have to handle cases where it might also include the bracket as well as a single/double quote (e.g url('')).

I got it to a point where it will work except in the case where you use both brackets and quotations (e.g. url("")). It fires at all points within the brackets because the scope extraction is wonky.

If packages like SASS/SCSS supported string.end maybe it might all magically work, but it doesn't appear they do right now. Unfortunately, I don't know enough about Sublime plugin development or have enough time at the moment to dig deeper. :/

manafire avatar Apr 30 '14 00:04 manafire

I see. I appreciate the effort. Thankfully removing the SASS package, and installing SCSS turned out better than I thought. SCSS solved the AutoFileName issue, plus my Emmet issues I've been having.

alex-martinez avatar Apr 30 '14 02:04 alex-martinez

I also tried removing the SASS page and installing SCSS, but it did not make it work for me. Using the package Syntax highlighting for Sass (instead of the SASS package), however, did make the autocompletion work.

sambody avatar Jul 04 '14 17:07 sambody

So I stumbled upon this issue today. Took a few tries to get working, but in the end as @alex-martinez said. Remove all SASS / SCSS packages. Then install this one package https://packagecontrol.io/packages/Sass & it works.

stewartduffy avatar Apr 07 '16 22:04 stewartduffy

None of these works for me .. any suggestions? Cause i need variables badly=)

Funkaholik avatar Mar 27 '17 18:03 Funkaholik