Snippets: only first declared is operable?


#1

Ok, help me out here; I’m trying to figure out what I"m doing wrong.

When I write my snippets in the cson file, only the first snippet per file extension type is available. The second declared snippet seems unavailable.

if I write this:

'.source.coffee':
  'snip cat':
  'prefix': 'cat'
  'body': 'meow'

'.source.coffee':
  'snip dog':
  'prefix': 'dog'
  'body': 'woof'

Then cat works in .coffee files, but dog doesn’t.

If I reverse the order:

'.source.coffee':
  'snip dog':
  'prefix': 'dog'
  'body': 'woof'

'.source.coffee':
  'snip cat':
  'prefix': 'cat'
  'body': 'meow'

Then dog works, but cat doesn’t.


#2

You should do :

'.source.coffee':
  'snip cat':
    'prefix': 'cat'
    'body': 'meow'
  'snoop dog':
    'prefix': 'dog'
    'body': 'woof'



#3

Thank You! I knew it must be something simple; that makes sense now that I look at it.


#4

As a general rule, you know… for life: If there’s no curly braces to separate blocks, you’ll probably have to look out for indentations.


#5
'.source.coffee':
  'snip cat':
  'prefix': 'cat'
  'body': 'meow'

'.source.coffee':
  'snip dog':
  'prefix': 'dog'
  'body': 'woof'

FYI: this has two object properties with the same name (key). So the first is ignored.