liamcain / AutoFileName

Sublime Text plugin that autocompletes filenames
515 stars 78 forks source link

How to AutoFileName with file .scss ? #57

Open tf25 opened 10 years ago

tf25 commented 10 years ago

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

alex-martinez commented 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"],
alex-martinez commented 10 years ago

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.

manafire commented 10 years ago

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. :/

alex-martinez commented 10 years ago

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.

sambody commented 10 years ago

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.

stewartduffy commented 8 years ago

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.

Funkaholik commented 7 years ago

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