Use completions instead of snippets, adding completions of my repository #9
Description
Hey guys,
I’ve written some completions for Angular.js and @ProLoser suggested that I could add some of my efforts to your project.
I propose using completions instead of snippets:
This has benefits for directive completions as ST doesn’t show them for snippets in HTML. Adding the following line to the user’s .sublime-preferences:
"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"}, {"selector": "source.js", "characters": "$." }, {"selector": "text.html meta.tag", "characters": " " } ]
allows completions to show up whenever the user enters a space in tags. In contrast to snippets completions will be fuzzy searched, e.g. 'ctrl' triggers the 'ng-controller' completion.
This also reduces conflicts with snippets by the user or other plugins. Current triggers like 'view' or 'click', are pretty common and may lead to conflicts with other snippets.
Snippets have the highest priority in Sublime Text and could overwrite snippets by the user.
Priority of Sources for Completions
- Snippets
- API-injected completions
- .sublime-completions files
- Words in buffer
If the user doesn’t edit auto_complete_triggers
in his preference file completions may still be triggered by ctrl + space
.
I think it’s best to have completions, which don’t come into the way when the user adds his own snippets. I haven’t tried ST3 though, so I don’t know if they changed this behavior.