FlorianWendelborn / atom-sorter

:signal_strength: :atom: package to sort things.
https://atom.io/packages/sorter
MIT License
5 stars 1 forks source link

Can only sort JSON and YAML #5

Closed Xapphire13 closed 6 years ago

Xapphire13 commented 6 years ago

With the recent update for YAML, everything that isn't JSON is sorted as YAML which yields a garbage file.

The culprit is this try/catch

Seems like the solution is to detect if a file is actually YAML, this could easily be done by checking the current grammar of the file.

Note: Kind of a dupe of https://github.com/dodekeract/atom-sorter/issues/4, however the title of that issue is more of feature description rather than symptom description.