Snippets don't work (SOLVED)


#1

Me (and another user) are having problems getting custom source.lua snippets to work.
Here’s the snippets file (posted by yet another user for whom it works):

https://stash.reaper.fm/v/32000/snippets.cson

For me (and the other user it isn’t working), the snippets get detected, but not auto-completed.

Screencapture:


#2

Try typing AddMed and then pressing tab.


#3

Thanks, but same result

What might be interesting info,
I tried downloading the ‘language-lua’ package and pasted the snippets from the linked file at the bottom, as suggested here
https://forum.cockos.com/showthread.php?t=173434
(post #14)

but that’s not a good solution in the long run as it wipes the added snippets when the package updates.


#4

Do snippets work for non-Lua files? You can also change ".source.lua" to "*" to apply them to all scopes. From what I can see in this thread, I don’t see anything amiss.


#5

That’s interesting, changing to ‘*’ seems to work, thanks.

So any idea what’s wrong here ?
Getting it work globally is not so bad, making the snippets work correctly (only for Lua files) would be even better of course.


#6

Do you have language-lua (or any other Lua syntax package) installed? I can reproduce your issue without having it installed (and in safe-mode), but everything works fine with the package installed.


#7

Yeah, that’s my first guess, without being able to see the status bar in the provided screenshots.


#8

Do you have language-lua1 (or any other Lua syntax package) installed? I can reproduce your issue without having it installed (and in safe-mode), but everything works fine with the package installed.

Spot on !

I didn’t have any packages installed so far, but now installed language-lua and Bam, it works.
Also with just the ‘.source.lua’: scope and not the global scope.

Thanks a lot !!!
But is this a bug then I wonder ?


#9

Not at all. You needed the language package in order for Atom to know what the .source.lua scope meant.


#10

Oh I see, thank you.