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

xsd files can only be edited if useCache is enabled #186

Closed
fbricon opened this issue Oct 31, 2018 · 7 comments
Closed

xsd files can only be edited if useCache is enabled #186

fbricon opened this issue Oct 31, 2018 · 7 comments
Labels
bug Something isn't working completion This issue or enhancement is related to completion support validation XSD
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Oct 31, 2018

Given:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified"
           elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
                               http://www.w3.org/2001/XMLSchema.xsd">

</xs:schema>

when useCache is disabled, the document fails to validate (even if stuff was cached in .lsp4xml before). I get:

  • error: cvc-elt.1.a: Cannot find the declaration of element 'xs:schema'.
  • warning: schema_reference.4: Failed to read schema document 'http://www.w3.org/2001/XMLSchema.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema.

Looks like, by default, if clients don't send the useCache:true, the preference is unmarshalled as false, overriding the server's default value, thus breaking xsd editing.

@fbricon fbricon added bug Something isn't working completion This issue or enhancement is related to completion support validation XSD labels Oct 31, 2018
@fbricon fbricon added this to the v0.0.2 milestone Oct 31, 2018
@fbricon
Copy link
Contributor Author

fbricon commented Oct 31, 2018

No matter what if useCache=false, it should not produce any errors.

@angelozerr
Copy link
Contributor

Thanks for the feedback, I will try that and Im' working on xsd extension in #178

@angelozerr
Copy link
Contributor

@fbricon I think 8967764 should fix a lot of problem that you have with file assocoiation, this issue, the #178 but I'm writing a lot of test to check that

@angelozerr
Copy link
Contributor

@fbricon is 8967764 fix this problem (after waiting for one minute)?

@fbricon
Copy link
Contributor Author

fbricon commented Nov 2, 2018

It works now even if useCache=false. Although it actually use a local cache but my understanding is it just unpacks embedded schemas.

@fbricon
Copy link
Contributor Author

fbricon commented Nov 2, 2018

If you have tests for it, you can close it now

@angelozerr
Copy link
Contributor

It works now even if useCache=false. Although it actually use a local cache but my understanding is it just unpacks embedded schemas.

Yes it's exaclty that, XML Schemas, dtd from classpath https://github.com/angelozerr/lsp4xml/tree/master/org.eclipse.lsp4xml/src/main/resources/schemas are deployed in the cache folder, exactly the same folder when cache is enabled.

Today test disable cache, because using cache means asynch validation, etc

Test for XSD are:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completion This issue or enhancement is related to completion support validation XSD
Projects
None yet
Development

No branches or pull requests

2 participants