sublimetext2 - sublime text 2 snippet error - Empty Key? -
here error:
error parsing content snippet packages/user/servlet-definition.sublime-snippet: empty key
and here code:
<snippet> <content><![cdata[ <servlet> <servlet-name>$1</servlet-name> <servlet-class>${2:spray.servlet.servlet30connectorservlet}</servlet-class> <async-supported>${3:true}</async-supported> </servlet> <servlet-mapping> <servlet-name>$1</servlet-name> <url-pattern>$(4:/*}</url-pattern> </servlet-mapping> ${5} ]]></content> <!-- optional: set tabtrigger define how trigger snippet --> <tabtrigger>sdef</tabtrigger> <!-- optional: set scope limit snippet trigger --> <!-- <scope>xml</scope> --> </snippet>
the problem isn't sublime text 2 thinks you're using regular expression, it's $(4:/*}
should enclosed just brackets, not parenthesis , bracket. now, sublime text wondering why $
isn't part of variable. use ${4:/*}
instead, , should fine.
also, can use $0
define the exit position cursor—it looks you're using $5
purpose, problem in future if want add more fields.
Comments
Post a Comment