# Snippets vs Autocomplete: which to choose?

#1

I’ve been trying to think of the best way to get autocomplete behaviour for a language like Latex.

My first approach was to make snippets for all the common commands, but that doesn’t play well with autocomplete-snippets, mainly because it doesn’t allow customised prefix characters, so \ cannot be used in the snippet name (I realise the snippets themselves work, but I’m talking about the popup created by autocomplete+). The other problem with this approach is that autocomplete-snippets has hardcoded the scope blacklist for snippets, which means that any math snippets will not appear in the popup menu (because math is scoped to string in language-latex).

Alternatively, it seems I can make an autocomplete provider directly for autocomplete+. This will allow all my snippets to appear with arbitrary prefixes and locations, solving the two issues with pure snippets. However, this won’t let the autocompleted commands be available as regular snippets, which could be annoying to some users.

Therefore, I’m not sure if I should make them as snippets and hope the issues are fixed by autocomplete-snippets, or as an autocomplete+ provider and not available as regular snippets.

#2

Is there something about latex-autocomplete that doesn’t meet your needs?

#3

It’s missing a lot of commands I would expect, such as \frac and \begin{} \end{} (it does autocomplete the begin environment after it’s been typed out, but that’s not quite what I want/expect), and some useful shortcuts like \figure to make a fully formed figure environment (much like can be done with snippets; eg. the html snippet).

I suppose I could make a pull request though. I think I’ll just give up on autocomplete-snippets, as my understanding from this issue is that they aren’t going to fix it until it can recognise when disabled scopes are changed, but this is not a priority for anyone. I did try and fix the issue, but adding an observe command to update the object value when the config value is changed didn’t work.