Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

add new snippets #22

Closed
StatelessCat opened this issue Feb 22, 2015 · 4 comments
Closed

add new snippets #22

StatelessCat opened this issue Feb 22, 2015 · 4 comments

Comments

@StatelessCat
Copy link

Hey,
I'm looking for a way to dynamicaly add new snippets to language-xml.cson, is it possible ?
Because when i define some snippets for XML in ~/.atom/snippets.cson, they are not loaded.

Thanks

@lee-dohm
Copy link
Contributor

Yes, you can add snippets for any language in ~/.atom/snippets.cson. A couple things to keep in mind:

  1. CSON is an indentation-sensitive language
  2. CSON, like JSON, is an object notation. This means that if you use the same key multiple times, the last one wins and overwrites the older ones.

If you've double-checked these and you're still having trouble, feel free to post your snippets.cson here or in a Gist and we can perhaps help you debug.

@StatelessCat
Copy link
Author

Thanks for your help, i found the reason of my issue, i was using

'.source.xml':

instead of

'.text.xml':

What is the reason for XML to be treated like "text" ?

@lee-dohm
Copy link
Contributor

It's largely arbitrary and most likely came over from the initial conversion from the TextMate package. If you want a reason, markup languages are not "source" in that they are not "compiled" or "interpreted" into executable code in the traditional sense. Then again, the same can be said of Markdown, but its scope is .source.gfm ... so there you are ... arbitrary 😀

It sounds like this is resolved so I'm going to close it. Let us know if you have any more issues!

@StatelessCat
Copy link
Author

Thanks for the explaination :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants