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

XSD: IntelliSense and element substitutions #186

Closed
mdschweda opened this issue Oct 2, 2019 · 3 comments
Closed

XSD: IntelliSense and element substitutions #186

mdschweda opened this issue Oct 2, 2019 · 3 comments
Assignees
Labels
bug Something isn't working completion
Milestone

Comments

@mdschweda
Copy link

Version: 0.9.0

IntelliSense doesn't suggest elements of a substitution group.

Considering the following example:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://example/" targetNamespace="http://example/">
    <xs:complexType name="AutomobileType">
        <xs:attribute name="topSpeed" type="xs:float" />
    </xs:complexType>
    <xs:complexType name="TruckType">
        <xs:complexContent>
            <xs:extension base="AutomobileType">
                <xs:attribute name="payloadCapacity" type="xs:float" />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="automobile" type="AutomobileType"/>
    <xs:element name="truck" type="TruckType" substitutionGroup="automobile"/>

    <xs:element name="fleet">
        <xs:complexType>
            <xs:sequence>
                <xs:choice maxOccurs="unbounded">
                    <xs:element ref="automobile" minOccurs="0" maxOccurs="unbounded" />
                </xs:choice>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
<fleet xmlns="http://example/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://example/ fleet-schema.xsd">

</fleet>

IntelliSense inside <fleet/> should offer automobile as well as truck because the former can be substituted for the latter as per the substitutionGroup. The linter recognizes that truck is a valid child element and will report no error, but the element doesn't appear in the IntelliSense list.

@angelozerr
Copy link
Contributor

Indeed it should work like you have explained. I will work on this issue.

angelozerr pushed a commit to eclipse/lemminx that referenced this issue Oct 7, 2019
angelozerr pushed a commit to eclipse/lemminx that referenced this issue Oct 7, 2019
@angelozerr
Copy link
Contributor

This issue should be fixed with eclipse/lemminx#568

@fbricon please review it.

@angelozerr angelozerr self-assigned this Oct 7, 2019
@angelozerr angelozerr added this to the 0.9.1 milestone Oct 7, 2019
@angelozerr angelozerr added bug Something isn't working completion labels Oct 7, 2019
angelozerr pushed a commit to eclipse/lemminx that referenced this issue Oct 7, 2019
@angelozerr
Copy link
Contributor

Fixed with eclipse/lemminx#568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completion
Projects
None yet
Development

No branches or pull requests

2 participants