Autocomplete Plus Snippets: How to set leftLabel, leftLabelHTML, etc


I added custom snippets and it’s working fine for the most part.
However, I can’t get to work some optional parameters, namely: leftLabel, leftLabelHTML, rightLabelHTML

description works fine.

Here is the section that describes what I try to do:


That functionality isn’t in Atom stable yet. It was just added as part of:

It should be available in v1.8 (as long as @Pier does the promised autocomplete-snippets PR in time :grinning:).

I will do the PR today, I promise.

BTW @leedohm when is the 1.8 release planned?

@Pier there is currently no ETA for v1.8 reaching either Beta or Stable.

First, thanks for the quick responses.
Is there any way I can use these features once Pier has pushed them?

(I would love to use them as soon as possible)

You would have to build Atom from source:

@frameland another way would be to download the 2 modified packages locally and use apm to enable them as dev packages. Since those modifications are simple it should work fine. I have it working on my machine right now.

The snippets package you can get from the official repo, and my version of autocomplete-snippets will be available in a few hours from my Github. I will post the link once it’s available.

Here is a proof it’s alive!

So here’s the PR:

@frameland here is the modified package:

cool. how do i properly replace atomcpomplete snippets with this version?
I tried cloning, then running apm install, apm link but it seems that doesn’t work.

Have you started Atom in dev mode?

atom -d

I’m not an expert, but I think you should also run apm develop autocomplete-snippets before apm install.

Edit: You can check if Atom has successfully loaded those dev packages in Setting > Packages. Scroll down to the bottom and there is a section called Development Packages.

I don’t have any in my current machine so it looks like this:

The red mark at the bottom indicates this Atom window is in dev mode.

I started atom in dev mode, it shows the package under Development Packages,
but the snippet popup still looks the same.

This is my snippet:

		'prefix': 'AddWidget(Widget)'
		'body': 'AddWidget(${1:widget:Widget}, ${2:name:String = ""})$0'
		'rightLabelHTML': '<span style="color:#ff0">Method</span>'

I’m not sure that the snippet system supports non-word characters in the prefix. Have you tried something like addw?

Yes, that makes no difference.

Are you sure you have the scope correct then? Can you make that snippet work in any grammar?

Everything works, the popup shows up correctly and everything. But setting the leftLabel, etc. properties has no effect.
Maybe I installed the package wrong?

edit: I also tried it with other languages with the same result.

Have you also enabled the snippets package in dev mode?

Yes, it shows up under dev packages as enabled.

Well, if you are using the correct packages I really don’t know what could be the problem.

As you can see both rightLabelHTML and leftLabelHTML do work:

This is the snippet:

		'leftLabelHTML':'<span style="color:#41b883">VUE</span>'
		'rightLabelHTML':'<span style="color:#41b883">VUE</span>'
		'description':'Vue.js v-text directive'
		'prefix': 'vtext'
		'body': 'v-text="$1"$0'

Remember that whenever you change something in a package you have to reload the Atom dev window for changes to take effect.

Here are my dev packages. Since those are local don’t mind the version number.

The packages that you should be using are:

If you’re suggesting that people use, then the suggested command of apm develop autocomplete-snippets won’t work out of the box. The apm develop command only clones from the registered repo for the package in In this case, that would be

1 Like

Ok, sorry for that.

I thought apm develop autocomplete-snippets enabled the package residing in ~/github/ in dev mode…