Is it possible to implement code completion for text in xml tag?

In iBATIS SQL Map xml file, there are a lot of tags for SQL sentences wrapper:
insert into person (id, name, password) values(#id#, #name#, #password#) ]]>
These symbols, such as #id#, #name# and #password#, are the fields in com.foobar.Person. When Ctrl+Space pressed, code completion will be display for #<caret. Any idea to implement such feature? Thanks.

1 comment
Comment actions Permalink

In iBATIS SQL Map xml file, there are a lot of tags for SQL sentences wrapper:
<insert id="createPerson" parameterClass="com.foobar.Person">
insert into person (id, name, password) values(#id#, #name#, #password#)
</insert>
These symbols, such as #id#, #name# and #password#, are the fields in com.foobar.Person. When Ctrl+Space pressed, code completion will be display for #<caret. Any idea to implement such feature? Thanks.


Implement PsiReferenceProvider, register it with
ReferenceProvidersRegistry, return your own PsiReference for this tag
with correct range and return your completion elements from its
getVariants() method.

0

Please sign in to leave a comment.