Live Template in language injection throw RangeMarkerWindow[invalid,184,313] exception randomly

Answered

Hi 
I'm developing a plugin that will inject sql language to xml tag.

I have a live template in sql context that will add some xml tag to the editor.

here is my live template 

<template name="co"
value="&lt;foreach item=&quot;item&quot; index=&quot;index&quot; collection=&quot;$var1$&quot; open=&quot;(&quot; separator=&quot;,&quot; close=&quot;)&quot;&gt;&#10;
$var2$
&#10;
&lt;/foreach&gt;$END$"
description="mybatis foreach collection statement" toReformat="true">
<variable name="var1" expression="collectionName" defaultValue="" alwaysStopAt="true"/>
<variable name="var2" expression="" defaultValue="#{item}" alwaysStopAt="true"/>
<context>
<option name="MybatisSql" value="true"/>
</context>
</template>
It will add some xml tag to the injected sql language.

The live template could add text to editor. But some case will show an error.

When completion item exist and press tab will work fine.
When completion item exist and press enter error will show.
When completion item not exist and press tab error will show.


Here is the pic


Is there anyway to solve this, just to make the error disappear. or may be i should implement my own completion contributor?




 

1 comment
Comment actions Permalink

Please post bug report with _exact_ steps to reproduce and/or source code required to reproduce. Thanks. https://youtrack.jetbrains.com/issues/IDEA

0

Please sign in to leave a comment.