Sublime Forum

ST3 JS Snippet

#1

I’m having a slight issue with a snippet in sublime,

this snippet was for qunit just to push in a quick start to a new test model however when I type in the keyword and hit tab, nothing appears and the word vanishes. It shows up in the list of snippets and everything. Just won’t give a value.

The snippet looks like this:

<snippet> <content> <![CDATA[ (function() { var qunit = $('.qunit-fixture'); module("Section Name", { setup: function() { this.instance = true; } }); test("Test name", function() { ok(this.instance, "Placeholder first test"); }); })(); ]]> </content> <tabTrigger>qun</tabTrigger> <description>qUnit Tests Start</description> <scope>source.js</scope> </snippet>
Any help is appreciated! Thanks.

0 Likes

#2

You need to escape the dollar sign:

\$('.qunit-fixture');

That’s because dollar sign is used for tabstops on snippets.

0 Likes

#3

[quote=“iamntz”]You need to escape the dollar sign:

\$('.qunit-fixture');

That’s because dollar sign is used for tabstops on snippets.[/quote]

Duh, I didn’t even notice the dollar sign. Guess it just blurred in with the rest of the snippet at the time. Thanks a ton working good now.

0 Likes