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

XML attribute associated to wrong type from XSD #524

Closed
Nerpson opened this issue Jun 24, 2021 · 2 comments · Fixed by eclipse/lemminx#1480
Closed

XML attribute associated to wrong type from XSD #524

Nerpson opened this issue Jun 24, 2021 · 2 comments · Fixed by eclipse/lemminx#1480
Labels
bug Something isn't working validation xsd
Milestone

Comments

@Nerpson
Copy link

Nerpson commented Jun 24, 2021

Issue Type: Bug

I created an XML schema containing a complexElement with two attributes. The first one is just a simple string, the second one has a custom simpleType inheriting from string but having an additional minLength=1 restriction.

When trying this schema, the first attribute is wrongly associated to the second's custom type.

You can easily reproduce this issue with the linked ZIP archive. It contains a simple schema and an XML file using it and having the described issue.

VSCode_XSD_Bug.zip

In test.xml you'll see that two errors are highlighted where only one should exist, on the Some_Restricted_Value attribute.
image

The helper popup even tells the wrong type.
image

When writing a value in the restricted attribute, both of the errors disappear.
image

Extension version: 0.16.1
VS Code version: Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48, 2021-06-17T13:28:07.755Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2592)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.82GB (17.40GB free)
Process Argv --crash-reporter-id 911c2726-6c6e-4a5a-ae4b-433ecadb690e
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30321513
pythonptprofiler:30281270
vshan820:30294714
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255cf:30323309
vscorehov:30309549
vscod805:30301674
pythonvspyt200:30324779
binariesv615:30325510
vsccppwt:30322536

@fbricon
Copy link
Collaborator

fbricon commented Feb 15, 2023

Weird thing is, it works fine if the "Some_Restricted_Value" attribute is put first:
Screenshot 2023-02-15 at 14 04 37

angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2023
angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2023
@angelozerr angelozerr added this to the 0.25.0 milestone Feb 15, 2023
@angelozerr
Copy link
Contributor

Sorry @Nerpson I skipped your issue -(

The PR eclipse/lemminx#1480 should fix your issue:

image

angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2023
angelozerr added a commit to eclipse/lemminx that referenced this issue Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation xsd
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants