atom / snippets

Atom snippets package
MIT License
205 stars 100 forks source link

Error when duplicate keys are encountered #250

Closed 50Wliu closed 6 years ago

50Wliu commented 6 years ago

Requirements

Description of the Change

This PR stops the loading of a snippets file if duplicate keys are encountered. As duplicate keys are always a mistake, it makes sense to show an error.

Alternate Designs

Only user snippets should be checked for duplicate keys. Though if all snippets are checked, it's a good way to "shame" package authors into fixing their snippets file (such as core's language-sass). The downside is more issues on atom/atom though as people copy/paste the error into a new issue.

Benefits

Visible error with duplicate keys

Possible Drawbacks

See alternate designs above.

Applicable Issues

Fixes #72