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

Discrepancy in completion between prefixed and default namespaces #87

Closed
ralfhandl opened this issue Nov 13, 2018 · 8 comments
Closed
Assignees
Labels
bug Something isn't working completion
Milestone

Comments

@ralfhandl
Copy link

ralfhandl commented Nov 13, 2018

I have XML files that use an "outer" namespace which in turn imports an "inner" namespace.

If the "inner" namespace is declared as the default namespace via xmlns="...", code completion works fine in the "outer" and the "inner" part, e.g.:
image

However if the "inner" namespace is declared with a namespace prefix via xmlns:edm="...", code completion for constructs in the "outer" namespace also shows top-level elements from the "inner" namespace that are not allowed by the "outer" XSD in that place:
image

This effect only shows on "level 1", i.e. directly below the root element of the "outer" namespace, where no elements of the "inner" namespace are allowed at all.

On "level 2", i.e. within children of the root element, code completion works fine and only shows allowed elements.

Test project is attached: vscode-xml-catalog-test.zip

  • examples/mini-catalog.xml works as expected
  • examples/mini-catalog-prefix.xml has the above strange behavior in one place.
@fbricon
Copy link
Collaborator

fbricon commented Nov 13, 2018

Can you provide a sample document reproducing this issue?

@ralfhandl
Copy link
Author

@fbricon is attached now

@fbricon fbricon added bug Something isn't working completion labels Nov 14, 2018
@fbricon
Copy link
Collaborator

fbricon commented Nov 14, 2018

ok, I can reproduce the issue with those samples, thanks!
That should give @angelozerr and/or @NikolasKomonen enough info to find a solution.

@angelozerr
Copy link
Contributor

angelozerr commented Jun 28, 2019

@ralfhandl just for your information this issue should be fixed with my PR eclipse-lemminx/lemminx#478 planned for 0.8.0

@angelozerr
Copy link
Contributor

Fixed by eclipse-lemminx/lemminx#478

@angelozerr
Copy link
Contributor

Thanks @ralfhandl for your great information. It was an hard issue but it is now fixed. Just for your information Completion on 0.8.0 is improved by filtering XML completion item according the existing XML elements of the document. See eclipse-lemminx/lemminx#505

@ralfhandl
Copy link
Author

@angelozerr Cool, thanks!

When will the VS Code XML plugin 0.8.0 be released?

@fbricon
Copy link
Collaborator

fbricon commented Jul 16, 2019

@ralfhandl before the end of the month. Until then, you can try the latest CI build from https://download.jboss.org/jbosstools/vscode-xml/staging/?C=M;O=D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completion
Projects
None yet
Development

No branches or pull requests

3 participants