Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion Broken When Encountering xs:any #927

Open
BellCubeDev opened this issue Aug 13, 2023 · 2 comments
Open

Completion Broken When Encountering xs:any #927

BellCubeDev opened this issue Aug 13, 2023 · 2 comments

Comments

@BellCubeDev
Copy link

BellCubeDev commented Aug 13, 2023

Reminiscent of #177, it appears that on versions 0.26.1 (stable) and 0.26.2023080404 (pre-release), schema-based completion is broken when an xs:any element is encountered. Instead of showing explicitly-defined elements, it only shows the root tag as an option.

Summary

For a visual demonstration and a reproduction case, skip this header and continue to the detail/summary blocks.

When an xs:any schema element is present, the following is true:

The following features are working:

  • Validation
  • Documentation On Hover
  • Attribute Suggestion

The following feature is NOT working:

  • Tag Suggestion

Demo & Minimal Reproduction XSD

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="root">
        <xs:annotation><xs:documentation>Some documentation for the ROOT ELEMENT</xs:documentation></xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:any minOccurs="0" processContents="skip" />
                <xs:element name="Name" minOccurs="0" maxOccurs="1" type="xs:string">
                    <xs:annotation><xs:documentation>Some documentation for the NAME ELEMENT</xs:documentation></xs:annotation>
                </xs:element>
                <xs:element name="Id" minOccurs="0" maxOccurs="1">
                    <xs:annotation><xs:documentation>Some documentation for the ID ELEMENT</xs:documentation></xs:annotation>
                    <xs:complexType>
                        <xs:simpleContent>
                            <xs:extension base="xs:integer">
                                <xs:attribute name="type" type="xs:string" />
                            </xs:extension>
                        </xs:simpleContent>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Scope of Issue (w/ Images) Using Above XSD

Documentation works on root eement

IntelliSense only shows root element for completion

image

Created element uses type for root element

image

Explicitly-defined elements still have their types applied

image
image

Validation is working

image
image


🔴🎩


@datho7561 datho7561 added bug Something isn't working completion and removed bug Something isn't working labels Aug 24, 2023
@datho7561
Copy link
Contributor

It seems like this is intentional according to eclipse-lemminx/lemminx#612

@datho7561
Copy link
Contributor

(for anyone who wants to see if this can be improved upon)

Here is the relevant section in the specification explaining the semantics of xs:any's processContents: https://www.w3.org/TR/xmlschema11-1/#Wildcard_details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants