-
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
Display no hover if there is no documentation #743
Conversation
@datho7561 it should be better to fix this issue when documentation is generated. I have not tested but I think the correct fix is to move this block code https://github.com/eclipse/lemminx/blob/master/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/utils/XMLGenerator.java#L235-L248 to https://github.com/eclipse/lemminx/blob/03ca39622411febbf13b2721886985e0bcaef44c/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/utils/XMLGenerator.java#L233 For the test:
|
@angelozerr Thanks! The only issue is that this means the completion won't display anything if there is no doc: If this is okay, I'll take this route. Otherwise, I think something more involved might be required. |
Completion and Hover must have the same behavior to be consistent so yes its ok |
8b42164
to
1a0f069
Compare
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/utils/XMLGenerator.java
Outdated
Show resolved
Hide resolved
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/utils/XMLGenerator.java
Outdated
Show resolved
Hide resolved
Given <?xml version="1.0" encoding="UTF-8" ?>
<hazdoc xmlns="foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="foo ./foo.xsd">
<nodoc></nodoc>
</hazdoc> and foo.xsd containing <?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
xmlns="foo"
targetNamespace="foo">
<xs:element name="hazdoc">
<xs:annotation>
<xs:appinfo> I haz appinfo</xs:appinfo>
<xs:documentation source="version">3.0.0+</xs:documentation>
<xs:documentation source="description">
I haz doc
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="nodoc" type="xs:string">
<xs:annotation>
<xs:appinfo> </xs:appinfo>
<xs:documentation source="version"> </xs:documentation>
<xs:documentation source="description">
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema> The |
1a0f069
to
24777ca
Compare
Thanks for point this out! I fixed it and added a test case for it. |
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/utils/XMLGenerator.java
Outdated
Show resolved
Hide resolved
....lemminx/src/main/java/org/eclipse/lemminx/extensions/xsd/contentmodel/XSDDocumentation.java
Outdated
Show resolved
Hide resolved
24777ca
to
f17fc61
Compare
...st/java/org/eclipse/lemminx/extensions/contentmodel/XMLSchemaHoverDocumentationTypeTest.java
Outdated
Show resolved
Hide resolved
f17fc61
to
87ecfaf
Compare
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/StringUtils.java
Show resolved
Hide resolved
If a declared element doesn't have associated `xs:documentation` or `xs:appinfo`, then no hover information is displayed. This also applies to the documentation displayed by the completion as well. Closes redhat-developer/vscode-xml#258 Signed-off-by: David Thompson <[email protected]>
87ecfaf
to
1c48983
Compare
Works like a charm, great job @datho7561 ! |
See redhat-developer/vscode-xml#258
Signed-off-by: David Thompson [email protected]