How can I suppress "Wrong attribute value" warning in XML validated against XSD?

In my custom language plugin I've registered additional XSDs that can be used in HTML markup via the FileNsInfoProvider extension point (as well as other EPs).  As expected, these XSDs constrain many of their attribute values as booleans, enums, etc.

I've also used MultiplePsiFilesPerDocumentFileViewProvider/TemplateLanguageFileViewProvider to allow an expression language to be used in these extended HTML files.

When these two meet, a warning is produced.  For example, the following:

<apex:page rendered="{!ISBLANK(someValue)}">

yields a "Wrong attribute value" warning on the entire {!...} expression because it doesn't resolve to the values "true" or "false" required for the "rendered" boolean attribute.

I've tried to see whether I can use an InspectionSuppressor to address this, but I don't see any inspection that's causing the "Wrong attribute value" warning.

Any pointers on how this can be addressed?  It results in many false negatives in my plugin's markup.

0

UPDATE: This error is being added by XmlHighlightVisitor.doCheckRefs() because the XmlAttributeValue PSI element has a reference which resolves to null.  I'm walking this area of the code, but so far I'm not seeing any way to suppress the HighlightInfo that's being added as a result of this, nor a decent way to "erase" it.

I'm hoping that someone will know a way to work around this.  Thanks in advance for any thoughts!

0

Okay, I've solved this now using a LanguageInjector which identifies these expressions inside of XML attribute values.  I'd be curious to know if that's the best solution or not, but for now I think I'm good to go.

0

请先登录再写评论。