redhat-developer / redhat-developer/vscode-xml

Fix CodeAction for `cvc-complex-type.2.4.a` to add `elementFormDefault` to bound XSD

Open
#571 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
328
Forks
101
Avg merge
1d 17h
Merged PRs (30d)
7

Description

Given an XML document, foo.xml:

<foo xmlns="http://foo"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://foo foo.xsd">
    <bar />
</foo>

and an XSD document, foo.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo">
    <xs:element name="foo">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="bar" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

the following error will appear:
Screenshot from 2021-07-30 09-21-49

with the following Quick Fix suggestion:
Screenshot from 2021-07-30 11-34-52

The CodeAction and Diagnostic for the error is currently incorrect/unsupported, and should add the elementFormDefault="qualified" attribute to the xs:schema tag in foo.xsd.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the diagnostic and Quick Fix using the foo.xml and foo.xsd examples in the issue. Trace the CodeAction and Diagnostic handling for cvc-complex-type.2.4.a, then verify that the suggested change adds elementFormDefault="qualified" to the xs:schema tag in foo.xsd.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.