Trying to override built-in snippets


#1

I am trying to override built-in snippets, I searched for a resolution so I came up with this:

'.text.html.basic, .text.html.php, .text.html.php.blade, .source.smarty':
  'Table cell':
    'prefix': 'td'
    'body': '<td>$1</td>'

'.text.html.basic, .text.html.php, .text.html.php.blade, .source.smarty':
  'Table head':
    'prefix': 'th'
    'body': '<th>$1</th>'

I am testing it in a laravel blade file and while the th snippet works now my way (meaning no new lines, putting everything into the same line) the table cell one doesnt work (still uses the built-in snippet) and I have no idea why.


#2

Are they in your snippets.cson like

'.text.html.basic, .text.html.php, .text.html.php.blade, .source.smarty':
  'Table cell':
    prefix: 'td'
    body: '$1'
'.text.html.basic, .text.html.php, .text.html.php.blade, .source.smarty':
  'Table head':
    prefix: 'th'
    body: '$1'

or

'.text.html.basic, .text.html.php, .text.html.php.blade, .source.smarty':
  'Table cell':
    prefix: 'td'
    body: '$1'
  'Table head':
    prefix: 'th'
    body: '$1'

? Because it should be the second one.


#3

Thanks, that seems to have solved the issue.


#4

You can have duplicate keys across different CSON files in the cascade, but you can’t have duplicate keys in the same file. In this case, the scope definition is a key. This also applies to keybindings and config rules.


#5

Thank you for the explanation. I really do appreciate your help.