Hi,
I’m currently working on a Tumblr Theme sugar. Created a bunch of CodeSenseLibraries and a simple provider, auto completion works fine.
But I now want to narrow it to a more context view, so I added some syntaxes and providers. As the wiki is lacking some more examples, I inspired myself with the CSS and HTML sugars. (See below)
Unfortunately, either the syntaxes or the providers are not working. Any help on this would be greatly appreciated.
Here is my syntax file, that should match {TAG} or {block:BLOCK}{/block:BLOCK}
<?xml version="1.0"?>
<syntax name="com.tumblr.themes.syntax">
<zones>
<zone name="com.tumblr.themes.syntax.tag">
<starts-with>
<expression>(\{)([a-zA-Z][a-zA-Z0-9:_]*)</expression>
<capture number="1" name="com.tumblr.themes.syntax.tag.punctuation.begin"/>
<capture number="2" name="com.tumblr.themes.syntax.tag.name"/>
</starts-with>
<ends-with>
<expression>(\})</expression>
<capture number="1" name="com.tumblr.themes.syntax.tag.punctuation.end"/>
</ends-with>
<!--<subzones>
<include collection="com.tumblr.themes.syntax.attribute"/>
</subzones>-->
</zone>
<zone name="com.tumblr.themes.syntax.block.open">
<starts-with>
<expression>(\{)block:([a-zA-Z0-9_]*)</expression>
<capture number="1" name="com.tumblr.themes.syntax.block.punctuation.begin"/>
<capture number="2" name="com.tumblr.themes.syntax.block.name"/>
</starts-with>
<ends-with>
<expression>(\})</expression>
<capture number="1" name="com.tumblr.themes.syntax.block.punctuation.definition.end"/>
</ends-with>
</zone>
<zone name="com.tumblr.themes.syntax.block.close">
<starts-with>
<expression>(\{/)block:([a-zA-Z0-9_]*)</expression>
<capture number="1" name="com.tumblr.themes.syntax.block.punctuation.begin"/>
<capture number="2" name="com.tumblr.themes.syntax.block.name"/>
</starts-with>
<ends-with>
<expression>(\})</expression>
<capture number="1" name="com.tumblr.themes.syntax.block.punctuation.definition.end"/>
</ends-with>
</zone>
</zones>
</syntax>
And the provider file. As you can expect, the first one works great but the second doesn’t.
<?xml version="1.0" encoding="UTF-8"?>
<codesense>
<provider>
<selector>*</selector>
<completions>com.tumblr.themes.set.blocks</completions>
<complete-match capture="0">[A-Za-z_{][A-Za-z0-9_:]*</complete-match>
</provider>
<provider>
<--<selector>tumblr.block:capture(name)</selector>
<completions>com.tumblr.themes.set.${name}</completions>-->
<selector>tumblr.block</selector>
<completions>com.tumblr.themes.set.likes</completions>
<complete-match capture="0">[A-Za-z_{][A-Za-z0-9_]*</complete-match>
</provider>
</codesense>
Thanks
