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

Fix error range for cvc-datatype-valid-1-2-1 #323

Closed
NikolasKomonen opened this issue Mar 12, 2019 · 8 comments · Fixed by #542
Closed

Fix error range for cvc-datatype-valid-1-2-1 #323

NikolasKomonen opened this issue Mar 12, 2019 · 8 comments · Fixed by #542
Assignees
Labels
bug Something isn't working validation
Milestone

Comments

@NikolasKomonen
Copy link
Contributor

NikolasKomonen commented Mar 12, 2019

If only integers are allowed as content and you have:

<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:noNamespaceSchemaLocation="intType.xsd">

  TEXT
  

</a>

with XSD:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="a" type="xs:integer">
  </xs:element>
</xs:schema>

The highlight could be cleaned up to the first and last character of text here:
Selection_050

And in the case a user puts in a tag the highlight, error message should be adjusted to include the first tag it comes across:
Selection_051

@NikolasKomonen NikolasKomonen self-assigned this Mar 12, 2019
@NikolasKomonen NikolasKomonen modified the milestone: v0.5.0 Mar 12, 2019
@angelozerr
Copy link
Contributor

@NikolasKomonen could you please add a simple xml schema and simple xml in this issue to reproduce quickly your issue. It will help too when tests will be written. Thanks!

@fbricon fbricon added enhancement New feature or request validation labels Jul 3, 2019
@fbricon fbricon added this to the v0.8.0 milestone Jul 3, 2019
@angelozerr
Copy link
Contributor

@xorye do you think you could work on this issue for 0.8.0? Otherwise we will change the millestone.

@xorye
Copy link

xorye commented Jul 22, 2019

@angelozerr working on this now

@xorye
Copy link

xorye commented Jul 22, 2019

@angelozerr @NikolasKomonen If there is only whitespace and newlines, is it okay if the error range looks like this?

image.png

@xorye
Copy link

xorye commented Jul 22, 2019

Any opinions on this case? This case is when there is whitespace in the middle of text.

image.png

@fbricon
Copy link
Contributor

fbricon commented Jul 22, 2019

compare with eclipse/idea

@angelozerr angelozerr changed the title Fix cvc_datatype_valid_1_2_1 when no content. Fix cvc_datatype_valid_1_2_1 when no content. Jul 23, 2019
@xorye
Copy link

xorye commented Jul 23, 2019

Eclipse looks like this:
image
Which is what we have already, except that eclipse ignores the newline character.

IntelliJ looks like this:
image
IntelliJ only underlines the parent element.

The IntelliJ way is definitely easier to implement but it's not what was initially desired. (Unless that's open to change)

Referring back to the two screenshots I posted yesterday, should I just keep them as is, for now?

@fbricon
Copy link
Contributor

fbricon commented Jul 23, 2019

yeah keep as-is

@fbricon fbricon modified the milestones: v0.8.0, v0.9.0 Jul 23, 2019
@xorye xorye changed the title Fix cvc_datatype_valid_1_2_1 when no content. Fix error range for cvc-datatype-valid-1-2-1 Jul 24, 2019
@angelozerr angelozerr added bug Something isn't working and removed enhancement New feature or request labels Jul 24, 2019
@fbricon fbricon assigned xorye and unassigned NikolasKomonen Aug 20, 2019
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants