-
Notifications
You must be signed in to change notification settings - Fork 93
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
Download external resources preference #1155
Download external resources preference #1155
Conversation
This PR requires the vscode-xml PR redhat-developer/vscode-xml#640 It starts working with DTD referenced in DOCTYPE. I need to support correctly DTD inside xml-mode, and referenced XSD. After that I will need to support XSD and DTD validation (I mean NOT XML validation based on DTD, XSD) . |
32d6478
to
700704b
Compare
At first please don't see my ugly code, it's not cleaned and a lot of tests are failing. I improved dragisticly the cache resource manager. Now the error is (should be) displayed on the referenced grammar and not in the XMLroot element (when there are loading information or error of downloading). I introduced a new settings When Here a demo with XML which references a maven XSD. My current context is:
It should work for XML with DOCTYPE, xsi:schemaLocation, and xml-model -for XSD and DTD both. I need to work for XSD, DTD files (when XSD file references another XSD, DTD) |
700704b
to
74805a5
Compare
...lemminx/src/main/java/org/eclipse/lemminx/uriresolver/CacheResourceDownloadingException.java
Outdated
Show resolved
Hide resolved
...clipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/xerces/LSPXMLEntityResolver.java
Show resolved
Hide resolved
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/ContentModelPlugin.java
Outdated
Show resolved
Hide resolved
Seems to be working, though as you've mentioned, XSD and catalogs don't yet respect the option. |
b5b2576
to
dd76228
Compare
I cannot customize this message because I need the original exception of the error (to know if it's a loading exception, download which is disabled, or a bad url,etc). Xerces doesn't report error with the |
dd76228
to
cd11e56
Compare
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/ContentModelPlugin.java
Outdated
Show resolved
Hide resolved
if (contentModelManager.isDownloadExternalResources() != downloadExternalResourcesEnabled) { | ||
contentModelManager.setDownloadExternalResources(downloadExternalResourcesEnabled); | ||
// Validate all opened XML files | ||
validateAllOpenedDocument(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if download is now disabled, why do we need to revalidate everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you have an XML which references a bad DTD, when you refresh the settings, the error message is different. So we need to revalidate.
.../java/org/eclipse/lemminx/extensions/contentmodel/participants/diagnostics/LSPSAXParser.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/lemminx/extensions/contentmodel/participants/diagnostics/LSPSAXParser.java
Outdated
Show resolved
Hide resolved
...in/java/org/eclipse/lemminx/extensions/xerces/AbstractReferencedGrammarLSPErrorReporter.java
Outdated
Show resolved
Hide resolved
...in/java/org/eclipse/lemminx/extensions/xerces/AbstractReferencedGrammarLSPErrorReporter.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/XMLDiagnostics.java
Show resolved
Hide resolved
...inx/src/main/java/org/eclipse/lemminx/services/extensions/diagnostics/DiagnosticsResult.java
Show resolved
Hide resolved
...inx/src/main/java/org/eclipse/lemminx/services/extensions/diagnostics/DiagnosticsResult.java
Outdated
Show resolved
Hide resolved
...lipse.lemminx/src/main/java/org/eclipse/lemminx/uriresolver/URIResolverExtensionManager.java
Outdated
Show resolved
Hide resolved
cd11e56
to
dd207f4
Compare
tests fail:
|
969c420
to
9113c4b
Compare
Once the test failure is addressed I think this is probably ready to merge. Just confirm the settings for external entity resolution and external resource downloading are what you want them to be based on what the client expects. |
9113c4b
to
7f373b6
Compare
Signed-off-by: azerr <azerr@redhat.com>
7f373b6
to
3819f05
Compare
Download external resources preference
Signed-off-by: azerr azerr@redhat.com