Home Download Buy Blog Forum Support

Snippet error: Empty key

Snippet error: Empty key

Postby jakobud on Wed Feb 17, 2010 9:48 pm

I downloaded some jQuery snippets and upon starting Sublime I get the following errors:

Code: Select all
Error parsing content for snippet Packages/Javascript/$_get.sublime-snippet: Empty key

Error parsing content for snippet Packages/Javascript/$_getIfModifed.sublime-snippet: Empty key


Here is the code for those snippets

Code: Select all
<snippet>
    <content><![CDATA[\$.get('${1:/test/ajax-test.xml}'${2/(.+)/(?1:, function\(xml\){
:)/}${2:alert( $("title",xml).text() )//optional stuff to do after get}${2/(.+)/(?1:;
}:)/});
$0]]></content>
    <tabTrigger>$.get</tabTrigger>
    <scope>source.js.jquery</scope>
    <description>$.get</description>
</snippet>


Code: Select all
<snippet>
    <content><![CDATA[\$.getIfModified('${1:/test/test.cgi}'${3/(.+)/(?1:, function\(data\){
:)/}${3:alert( $"Data loaded: " + data )//optional stuff to do after get}${3/(.+)/(?1:;
}:)/});
$0]]></content>
    <tabTrigger>$.getIfModified</tabTrigger>
    <scope>source.js.jquery</scope>
    <description>$.getIfModified</description>
</snippet>


I've never made changes to snippet files before, so I'm not exactly sure what is wrong with the syntax. Can anyone tell me what the "key" is that its referring to that is empty or missing?
jakobud
 
Posts: 37
Joined: Wed Feb 17, 2010 6:05 pm

Re: Snippet error: Empty key

Postby Shoozza on Mon Mar 29, 2010 8:25 am

Looks like a \ was missing before $:
Code: Select all
<snippet>
    <content><![CDATA[\$.get('${1:/test/ajax-test.xml}'${2/(.+)/(?1:, function\(xml\){
:)/}${2:alert( \$("title",xml).text() )//optional stuff to do after get}${2/(.+)/(?1:;
}:)/});
$0]]></content>
    <tabTrigger>$.get</tabTrigger>
    <scope>source.js.jquery</scope>
    <description>$.get</description>
</snippet>


Code: Select all
<snippet>
    <content><![CDATA[\$.getIfModified('${1:/test/test.cgi}'${3/(.+)/(?1:, function\(data\){
:)/}${3:alert( \$"Data loaded: " + data )//optional stuff to do after get}${3/(.+)/(?1:;
}:)/});
$0]]></content>
    <tabTrigger>$.getIfModified</tabTrigger>
    <scope>source.js.jquery</scope>
    <description>$.getIfModified</description>
</snippet>
Shoozza
 
Posts: 7
Joined: Wed Mar 24, 2010 4:11 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 15 guests