olmokramer / atom-stylus-autocompile

Compile .styl files on save in Atom
MIT License
5 stars 4 forks source link

add multiple grammar scope names support #10

Closed simrobin closed 8 years ago

simrobin commented 8 years ago

Hello !

Since language-stylus package upgraded to 2.*, they changed their grammar scope name ('source.stylus' became 'source.css.stylus').

I updated language-stylus and stylus-autocompile was not working anymore on .styl files, since it's relying on grammar.

I suggested a way to use multiple grammars (for those who still are in 1.* with language-stylus package).

Let me know if it works for you !

olmokramer commented 8 years ago

Hi Simon, thanks for the PR! I see where you're going with this, but I think it's easier to just do

const stylusGrammar = ['source.css.stylus', 'source.stylus']
  .map(scopeName => atom.grammars.grammarForScopeName(scopeName)).find(x => x);

I'll change it right away and publish the new version!

olmokramer commented 8 years ago

This should be fixed as of v0.4.0

simrobin commented 8 years ago

Hi, Seems like your solution is simpler and more elegant ! Works fine for me in 0.4.0 :)