Any way to give a data type for "inner" expressions in MultiplePsiFilesPerDocumentFileViewProvider?

I've asked this before but didn't get any traction, so I thought I'd check one more time.  In my custom language plugin, I support an embedded markup language similar to JSP with expressions that can render HTML, evaluate to boolean or numeric values, etc.  I use a MultiplePsiFilesPerDocumentFileViewProvider with HTML as the outer language and my plugin's custom markup expression language as the inner language.  Overall I have this all working well.  However, an issue comes up when one of these markup expressions is used to provide a value for a typed HTML attribute or, in Ultimate Edition, a JavaScript expression, e.g.:

<option selected="{!someBooleanExpression}" .../>


or:

var number = {!someNumericExpression};


IDEA flags each of these as invalid presumably because the outer language doesn't know about the embedded expression (at all, or minimally its data type beyond just string).

Given that IDEA's own JSP support must be doing this, I'm assuming(/hoping?) that there's some way to provide information to the outer language about the data type of a block from the inner language.  Of course, since the JSP stuff is not part of the open source offering, I can't really track that down.

Any tips on how this might be addressed?

Thanks in advance!

0

IntelliJ IDEA does not have any cross-language concept of a "data type" which could be used by one language to inform a different language about the type of something.

You can suppress error highlighting in another language by implementing the HighlightErrorFilter interface; JSP makes use of that mechanism.

0

Thanks! That helps tremendously, Dmitry! I'll implement that EP for my plugin as well.     

0

请先登录再写评论。