pichillilorenzo / JavaScriptEnhancements

JavaScript Enhancements is a plugin for Sublime Text 3. It offers not only a smart javascript autocomplete but also a lot of features about creating, developing and managing javascript projects (real-time errors, code refactoring, etc.).
MIT License
638 stars 41 forks source link

Overwriting built-in javascript snippets is done wrong #56

Closed rchl closed 4 years ago

rchl commented 6 years ago

You are overriding a bunch of built-in javascript snippets by copying override snippets into user's folder.

The problem with it is that override snippets don't define the context so they are available in all scopes. While you could say that it doesn't matter because they don't have tabTriggers defined, I'd say it does, because that makes them show up in command palette (and for all types of files).

For example, I have if snippet for twig templates and I often trigger it from the command palette but the JS-override-snippet, that you are adding, is also shown and often selected instead of the twig one.

(So the main bug for me is what I've described above but, on semi-related note, I think overriding snippets like that is a bit controversial. I didn't even have your package installed anymore but those overrides were not deleted and were causing problems. And I think you are also not making sure that user's snippets are not overwritten so causing potential data loss.)

pichillilorenzo commented 6 years ago

Ok! I will check about that 👍. Thanks!!