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

Completion for xsd:enumeration inside of text node #632

Merged

Conversation

angelozerr
Copy link
Contributor

xsd:enumeration autocomplete don't work for text node

Fixes redhat-developer/vscode-xml#218

Signed-off-by: azerr [email protected]

@angelozerr
Copy link
Contributor Author

To test this PR, see usecase at redhat-developer/vscode-xml#218 (comment)

  • when you apply completion to insert ACTION-TYPE, it should show choice of xsd:enumeration
  • when you have <ACTION-TYPE>|<ACTION-TYPE> it should show list of xsd:enumeration.

Here a demo which shows in action xs:enumeration on text:

XSDEnumerationOnText

@fbricon
Copy link
Contributor

fbricon commented Apr 13, 2020

Looks promising. Could you plug the "did you mean" feature in? I don't remember if we implemented it in lemminx

@angelozerr angelozerr force-pushed the xsd-enumeration-on-text branch from 521099f to 3494976 Compare April 13, 2020 17:09
@angelozerr angelozerr marked this pull request as ready for review April 13, 2020 17:10
@angelozerr
Copy link
Contributor Author

This PR is ready (there are some tests), the only part which is not managed is the documentation for the xs:enumeration value (see the FIXME).

I don't know how to manage that for the moment. I think we should create an another issue to manage that and support hover together.

@angelozerr
Copy link
Contributor Author

angelozerr commented Apr 13, 2020

Looks promising. Could you plug the "did you mean" feature in? I don't remember if we implemented it in lemminx

What do you mean with Could you plug the "did you mean" feature in?

I don't remember if we implemented it in lemminx

No it was not implemented and my PR implements that.

@angelozerr angelozerr requested a review from fbricon April 13, 2020 17:16
@angelozerr angelozerr force-pushed the xsd-enumeration-on-text branch 4 times, most recently from 895d691 to c312f0c Compare April 13, 2020 17:59
@angelozerr angelozerr added this to the 0.12.0 milestone Apr 14, 2020
@angelozerr angelozerr self-assigned this Apr 14, 2020
@xorye
Copy link

xorye commented Apr 14, 2020

I came across some bugs:
On my machine, there are three failing tests:

[ERROR] Failures: 
[ERROR]   DTDCompletionExtensionsTest.testNoDuplicateCompletionItems:186->testCompletionFor:202 expected: <5> but was: <2>
[ERROR]   DTDCompletionWithCacheExtensionsTest.dtdCache:70 desc should only exist once: Actual: End with '</animate>',End with '</svg>',#region,#endregion,cdata,comment ==> expected: <1> but was: <0>
[ERROR]   XMLSchemaCompletionExtensionsTest.noNamespaceSchemaLocationCompletion:223 expected: <<OutOfBand></OutOfBand>> but was: <<OutOfBand>false</OutOfBand>>

Also, the completion and validation does not seem to work after I open AUTOSAR_00048.xsd:
demo

@angelozerr
Copy link
Contributor Author

Also, the completion and validation does not seem to work after I open AUTOSAR_00048.xsd

Yes please don't open it:) The problem with this XML Schema is that it generates too many symbols (you can exclude the symbols for this files in the settings), but I'm glad that you have seen the problem and now I think you will understand why redhat-developer/vscode-xml#237 is very important :)

@angelozerr
Copy link
Contributor Author

On my machine, there are three failing tests:

That's strange, travis doesnt fail?

@angelozerr angelozerr force-pushed the xsd-enumeration-on-text branch 2 times, most recently from b3dd576 to 0d2c486 Compare April 14, 2020 17:08
@angelozerr
Copy link
Contributor Author

@xorye please retry

@xorye
Copy link

xorye commented Apr 14, 2020

It works!

@xorye
Copy link

xorye commented Apr 14, 2020

Yes please don't open it:) The problem with this XML Schema is that it generates too many symbols (you can exclude the symbols for this files in the settings), but I'm glad that you have seen the problem and now I think you will understand why redhat-developer/vscode-xml#237 is very important :)

I see. I still get this problem when I disable symbols/exclude the file. I can investigate more while taking care of redhat-developer/vscode-xml#237

@angelozerr angelozerr merged commit 24cd010 into eclipse-lemminx:master Apr 14, 2020
@xorye xorye changed the title xsd:enumeration autocomplete don't work for text node Completion for xsd:enumeration inside of text node Jun 10, 2020
angelozerr added a commit to angelozerr/lemminx that referenced this pull request Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completion for xsd:enumeration inside of text node
3 participants