Intellij不尊重工具:自定义Spring命名空间中的期望类型注释

时间:2012-12-01 06:22:44

标签: spring xsd intellij-idea

我创建了一个自定义Spring命名空间。它在正确部署等方面工作正常,但是Intellij没有验证bean引用上的tool:expected-type注释(即我可以引用任何类型的bean,而Intellij不会以红色突出显示该属性,因为它应该)也不提供这些参考文献的任何自动完成。

其他tool功能似乎运行正常,例如tool:exports

Intellij识别我的架构,并提供除期望类型引用之外的所有其他自动完成功能。

在选择Parse custom bean命令时,Intellij还成功将自定义元素解析为各种所需的bean。

这是我想要的精简版,但这正是我目前正在尝试的:

<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。

如果有人能提供一些可能出错的线索或如何修复,那就太棒了。

2 个答案:

答案 0 :(得分:1)

以下是Intellij bugbase中的相​​关错误报告:http://youtrack.jetbrains.com/issue/IDEA-87187

答案 1 :(得分:0)

我升级到IntelliJ 12,这不再是一个问题。所以答案是:升级IntelliJ!