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

Adjust range for XML schema errors #72

Closed
angelozerr opened this issue Aug 20, 2018 · 20 comments
Closed

Adjust range for XML schema errors #72

angelozerr opened this issue Aug 20, 2018 · 20 comments
Assignees
Labels
enhancement New feature or request in progress
Milestone

Comments

@angelozerr
Copy link
Contributor

No description provided.

@fbricon
Copy link
Contributor

fbricon commented Sep 11, 2018

@angelozerr what's the status on this one?

@angelozerr
Copy link
Contributor Author

It's not finished. The long task is to write tests (and find usecase).

@fbricon
Copy link
Contributor

fbricon commented Sep 21, 2018

The IBM XML language server has a bunch of test samples that we can use for validating our solution.

We can see that our diagnostic ranges look bad:
screen shot 2018-09-21 at 11 21 21 am

@angelozerr is this something you're still working on or should I ask @NikolasKomonen to take over?

@fbricon
Copy link
Contributor

fbricon commented Sep 21, 2018

Same file validated with IBM's server:
screen shot 2018-09-21 at 11 24 31 am

@angelozerr
Copy link
Contributor Author

Thanks for the info @fbricon I will try to improve this range problem.

angelozerr added a commit that referenced this issue Sep 22, 2018
@angelozerr
Copy link
Contributor Author

@fbricon I have managed selection of error date, but I have not written test. Do you think we can use the IBM Language Server invoice.xsd to write test?

@fbricon
Copy link
Contributor

fbricon commented Sep 22, 2018

I guess you can. Project is EPL. In doubt you can easily create a simple schema with dates

@fbricon
Copy link
Contributor

fbricon commented Sep 22, 2018

So we made some progress but I still see bad ranges at the end of problematic nodes:
screen shot 2018-09-22 at 2 15 35 am

@angelozerr
Copy link
Contributor Author

I guess you can. Project is EPL. In doubt you can easily create a simple schema with dates

Ok thanks, I will create a new file for that according your suggestion

So we made some progress but I still see bad ranges at the end of problematic nodes:

Yes I know that, the error is for cvc-datatype-valid.1.2.1 (I seems that the Xerces version of IBM Language server doesn't manage it).

The sample at https://wiki.xmldation.com/Support/Validator/cvc-datatype-valid-1-2-1 is for element text, but I tell me if for attribute value we can have this error too? I had implemented that in https://github.com/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/contentmodel/participants/XMLSchemaErrorCode.java#L120 (but it's commented). I would like to check if we can hav ethis error for attribute value. Once I will check it, I will write tests for that.

angelozerr added a commit that referenced this issue Sep 22, 2018
@angelozerr
Copy link
Contributor Author

@fbricon now we should have the same thing than IBM XML Language Server.

@fbricon
Copy link
Contributor

fbricon commented Sep 22, 2018

Still seeing bad ranges for invalid attributes content (closing bracket is underlined):
screen shot 2018-09-22 at 7 11 50 pm

@angelozerr
Copy link
Contributor Author

Now it should be better.

@fbricon
Copy link
Contributor

fbricon commented Sep 24, 2018

Nope. Still seeing underline on closing bracket. Range is still wrong:
screen shot 2018-09-23 at 11 49 01 pm

@angelozerr
Copy link
Contributor Author

Nope. Still seeing underline on closing bracket. Range is still wrong:

Are you sure that you are using version from master? Test are https://github.com/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/contentmodel/XMLSchemaDiagnosticsTest.java#L136

@fbricon
Copy link
Contributor

fbricon commented Sep 24, 2018

yes, that's why I made #139, to be sure about the version running

@angelozerr
Copy link
Contributor Author

Sorry @fbricon there were indeed a bug that it should be fixed. Sorry again -(

@fbricon
Copy link
Contributor

fbricon commented Sep 24, 2018

Works now! Thanks @angelozerr !
Are we still missing anything to close this issue?

@angelozerr
Copy link
Contributor Author

Works now! Thanks @angelozerr !

Cool!

Are we still missing anything to close this issue?

I think we can close this issue. I have managed the same adjust ranges than WTP, but as you have seen it missed some case that WTP doesn't manage. I hope we have the same feature than IBM Language Server.

I propose you to close this issue and if we find new bugs, we could create a new issue with the given problem.

@fbricon
Copy link
Contributor

fbricon commented Sep 24, 2018

Fair enough. closing

@fbricon fbricon closed this as completed Sep 24, 2018
@angelozerr
Copy link
Contributor Author

angelozerr commented Sep 24, 2018

@fbricon just for your information, I have played with the XML IBM XML Server and I have fixed few problems with completions and improve code actions.

Here the code actions which are available:

image

image

image

and here completion for attribute name:

image

and for attribute value:

image

The completion on attribute value is bugged when you fill the value, apply value is not well done.

@fbricon fbricon added this to the v0.0.1 milestone Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

3 participants