Open tf25 opened 10 years ago
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"],
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.
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. :/
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.
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.
None of these works for me .. any suggestions? Cause i need variables badly=)
How to AutoFileName with file .scss ?. I use Sublime text 3 build 3059, win 8.1 64 bit