Clarification on implementing XmlAttribute, etc. in a custom plugin.

已回答

I'm working on implementing the IntelliJ XML API for my XQuery plugin with the intention of getting things like the IntelliJ XMLSchema/RNG element and attribute validation working.

I've raised a bug w.r.t. the XmlAttribute interface (https://youtrack.jetbrains.com/issue/IDEA-276536) that has been resolved as "Worked as intended". Can I have confirmation that this is indeed the case (i.e. I shouldn't be implementing the XML API for XML constructs/fragments in my plugin), and if it is the case, how I can implement:

1. schema-based element validation;

2. XML-based language injections for pre-defined injections like for CSS and JavaScript in XML elements/attributes.

Note: From the reply in https://intellij-support.jetbrains.com/hc/en-us/community/posts/4405169069970-Implementing-the-XML-API-for-a-custom-language I was under the impression that implementing XmlTag, XmlAttribute, etc. is allowed.

My intention is to support direct (XML-like) and constructed elements and attributes, so that mixing the two (e.g. `<a>{ attribute href { "about:blank" }</a>`) can be validated where there is enough information.

The issue I'm having is that constructed attributes can appear outside of XmlTag nodes, as they are dynamically constructed, so the getParent override returning XmlTag can return null in those contexts, breaking the PSI tree for my use case. I'm implementing these as my own elements (CompAttrConstructor).

0

请先登录再写评论。