3 comments

Hi,

You should calculate text range in the host element. There is no common algorithm for it. See com.intellij.lang.injection.MultiHostRegistrar#addPlace Javadoc. It contains an example.

0

Thanks.

according to the example,  the host element should is the  “name” tag value “foo”, but rangeForBody is calc the “body” tag value “System.out.println(42);”,the “body“ tag is out of the range of the "name” tag。

Is it my misunderstanding?

 

0

You can walk the tree and find the elements needed for calculations.

0

Please sign in to leave a comment.