-
Notifications
You must be signed in to change notification settings - Fork 211
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 validation errors (incomplete project-based XSD schemas resolution?) #447
Comments
Let me check if I can reproduce this locally. Side note: The project-related XML namespace resolution is not part of the language server, that had to be implemented outside of it as a direct extension to the existing XML infrastructure of the IDE, in this case Eclipse. |
I tried this with the latest Spring Integration guide and tried various things that you describe in the There are two things that we could try:
What do you think? |
Hi Martin, |
It seems like I was able to reproduce: This is a small Eclipse+Gradle project. If you open src/main/resources/foo-cms.xml in it, you'll see the errors. Here is a screenshot: What's interesting is that the errors are reported in the Markers view under the category "Language Servers", and not under XML or such. I can't find anything relevant (at least to me) in the Language Server log. Here is the contents:
|
Do you have additional language servers running in your IDE? Like something that also reacts to XML files, like an XML language server from the Wild Web Developer package, for example? You can check that in the For some background: the XML language server from Wild Web Developer doesn't take our project-specific namespace resolving into account. Our project-specific namespace resolving is implemented as extension for the WTP package in Eclipse. But we have plans to extend the XML language server from Wild Web with our project-specific namespace resolving, but that will not happen soon. |
Good catch Martin... disabling Wild Web Developer language servers and closing and reopening the editor made the errors go away... Just out of my curiosity, why isn't the project-related XML namespace resolution part of Spring Boot language server? Probably because, if it were, you would not be able to override the default WTP XML editor behaviour wrt namespace resolution? |
The namespace resolution is done when the tooling parses the XML source. So wherever that happens, we need to inject our extension for this mechanism. WTP does this inside of its own XML parsing and validation mechanism, so we had to extent that mechanism using the WTP API. Wild Web Developer does this parsing and validation inside of the Wild Web Developer XML language server, so for that case we need to implement an extension for that specific XML language server, using its specific API. |
Hi @martinlippert, I saw the new entry in the "Known limitations and issues" that points here, as discussed in #354 (comment). |
@mauromol We have an internal issue that is tracking the progress towards the project-related XSD namespace resolution, but I think it would be better to have a public GitHub issue for that. I will create one and move the relevant parts over to that one, which is still in progress. We are slowly getting there, but identified a few issues that prevented our implementation to make it into the 4.9.0 release. |
Thanks a lot @martinlippert! I will watch that new issue when it is available. |
@mauromol Here you are... :-) |
Using STS4 4.6.0 in Eclipse.
In #108 project-based XSD schema resolution was implemented. I'm pretty sure I saw this working in other places, but I have a XML file using Spring Integration namespace XML elements for which this resolution seems to (partially) fail.
I have Spring Integration 4.3.21 in the classpath (both core and http modules) and snippets like these:
The above is marked with this error:
Similar errors are given on
<int-http:outbound-gateway>
attributes likehttp-method-expression
orrequest-factory
.I'm using the unversioned namespaces:
If I replace the unversioned XSDs with the versioned (4.3) ones, those errors go away. But I would like to avoid it.
The Spring Boot language server log doesn't show any error/exception. The XML where I have this problem seems to be detected as well as any updates to it:
Basic XML code assist for attribute names work (even for those attributes that are marked in red!), as well as further STS4 code assist within
<bean>
attributes (likeclass
orproperty
).If I right click on the editor and choose "Validate", I get "The validation completed with no errors or warnings", yet I have those errors in the left vertical ruler and attributes are underlined in red.
I tried to:
without success.
Any idea on what is going on?
The text was updated successfully, but these errors were encountered: