-
Notifications
You must be signed in to change notification settings - Fork 82
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
Autocompletion of attribute values won't display documentation #736
Comments
can you provide a self contained sample reproducing this issue? |
Ok. So it looks like when one or more <xs:enumeration> do not have documentation, it breaks the documentation for all enums for that attribute. Example Document: <?xml version="1.0" encoding="utf-8"?>
<root attribute="value1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd" /> Example Schema: <?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
<xs:annotation>
<xs:documentation>Documentation for root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="attribute">
<xs:annotation>
<xs:documentation>Documentation for attribute</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="value1">
<xs:annotation>
<xs:documentation>Documentation for attribute value1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="value2" /> <!-- this one has no documentation. if you delete this line, documentation displays properly for 'value1' -->
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema> |
So it looks like there are 2 problems:
|
@fbricon Were you able to reproduce the issues with the sample I provided? Thanks for looking into this. |
I can reproduce the problem @bimimicah. Many thanks for your sample. Let us investigate the problem. |
Fixes redhat-developer/vscode-xml#736 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer/vscode-xml#736 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer/vscode-xml#736 Signed-off-by: azerr <[email protected]>
@bimimicah I created a PR which should fix your issue, see demo at: |
Fixes redhat-developer/vscode-xml#736 Signed-off-by: azerr <[email protected]>
I tried the pre-release build of lemminx built 6 days ago, and it looks like problem # 1 has been solved completely! Thank you! However, it looks like that didn't solve the second problem:
For illustration:
Thank you again for your quick solution to the first problem! |
@angelozerr should I make a new issue for the second part that hasn't been solved yet, since this issue is closed? |
I fear that it is not possible to support the second problem because it is not supported by the lsp specification. In otherwise when completion item is applied you can define a simple list of string value called choice but without specifying à documentation. |
I may be misunderstanding, since I am not very familiar with the details of LSP implementations, but shouldn't the process I illustrated above work like this?:
|
I see your idea but it will require some hack on client side so it will require to do this Hack for vscode eclipe sublime etc wuich is not the goal of lsp. Please create an issue for this problem. Perhaps there is a solution that I miss with lsp . We should study in détail the mroblem. |
Thanks. I created #760 to track the second problem. |
Documentation appears properly when autocompleting attribute names:
But when autocompleting attribute values (xs:enumeration), the documentation does not appear:
I think it used to work, but I'm not entirely certain. Has anyone else noticed this issue? Is it working for anyone?
The text was updated successfully, but these errors were encountered: