我创建了一个自定义的Spring命名空间。它在正确部署等方面工作得很好,但是Intellij没有验证bean引用上的tool:expected-type注释(例如,我可以引用任何类型的bean,Intellij不会像它应该的那样用红色突出显示属性),也没有在这些引用上提供任何自动补全。
tool:exports等其他tool特性似乎工作得很好。
Intellij识别我的模式,并提供除预期类型的ref之外的所有其他自动完成功能。
在选择Parse custom bean命令时,Intellij还成功地将自定义元素解析为各种所需的beans。
这是我想要的精简版本,但这是我目前正在尝试的:
<xsd:element name="routed-channel">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation>
<!-- This part works - other bean refs that require a MessageChannel can reference this channel -->
<tool:exports type="org.springframework.integration.core.MessageChannel" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="recipient" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="channel" type="xsd:string" use="required">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<!-- This part does not work - IntelliJ allows a any reference here -->
<tool:expected-type type="org.springframework.integration.core.MessageChannel" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>我使用的是IntelliJ IDEA v11.1.3。
如果有人能提供一些线索,说明哪里可能出了问题,或者如何修复它,那就太好了。
发布于 2013-09-16 11:29:36
我升级到了IntelliJ 12,这不再是问题。所以答案是:升级IntelliJ!
发布于 2012-12-10 20:41:49
以下是Intellij bugbase中的相关错误报告:http://youtrack.jetbrains.com/issue/IDEA-87187
https://stackoverflow.com/questions/13657005
复制相似问题