redhat-developer / redhat-developer/vscode-xml
Fix CodeAction for `cvc-complex-type.2.4.a` to add `elementFormDefault` to bound XSD
Nobody has claimed this yet.
- 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:

with the following Quick Fix suggestion:

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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