I can not seem to override a built-in snippet.
Using Rails, I want “scope + TAB” to expand to
"scope :named, ->(argument) { where(attribute: argument) }"
but I get the default
scope :name, joins(:table).where('.field = ?', 'value')
I debugged the scopes at cursor where I want the snippet to expand and it’s “source.ruby.rails, meta.rails.model”
So I added in snippets.cson
'.source.ruby.rails':
'scope definition':
'prefix': 'scope'
'body': """
scope :named, ->(argument) { where(attribute: argument) }
"""
But this does not work, “scope + TAB” still gives the default expansion.
Curiously, if I change 'prefix': 'scope'
to 'prefix': 'scx'
, the snippet “scx + TAB” works.
I have tried restarting Atom, no luck. What am I missing?