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

RNG attribute completion doesn't generate the proper prefix if the namespace is not declared #1489

Closed
angelozerr opened this issue Feb 21, 2023 · 0 comments · Fixed by #1491
Labels
bug Something isn't working completion This issue or enhancement is related to completion support RelaxNG
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Feb 21, 2023

Given this XML file bound to RelaxNG file:

<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<book xmlns="http://docbook.org/ns/docbook">
    <acknowledgements></acknowledgements>
</book>

When completion is triggered on <acknowledgements |> it show attributes, but it doesn't take care of prefix, if the namespace is not declared correctly. For instance it shows actuate although actuate should be linked to http://www.w3.org/1999/xlink namespace by using xlink prefix.

image

Please note that If you declare the xlink namespace

<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" >

The completion shows correctly completion item with xlink:actuate.

image

To fix this issue, it should be nice to get xlink prefix from the grammar, and when completion is applied, it should insert in the book element the proper namespace xmlns:xlink="http://www.w3.org/1999/xlink" like the follwoing demo:

AttrWithPrefixCompletion2

@angelozerr angelozerr added bug Something isn't working completion This issue or enhancement is related to completion support RelaxNG labels Feb 21, 2023
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Feb 22, 2023
namespace is not declared

Fixes eclipse#1489

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Feb 22, 2023
namespace is not declared

Fixes eclipse#1489

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Feb 22, 2023
namespace is not declared

Fixes eclipse#1489

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Feb 22, 2023
namespace is not declared

Fixes eclipse#1489

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Feb 22, 2023
namespace is not declared

Fixes eclipse#1489

Signed-off-by: azerr <azerr@redhat.com>
angelozerr pushed a commit to angelozerr/lemminx that referenced this issue Feb 22, 2023
namespace is not declared

Fixes eclipse#1489

Signed-off-by: azerr <azerr@redhat.com>
@datho7561 datho7561 added this to the 0.25.0 milestone Feb 22, 2023
JessicaJHee pushed a commit that referenced this issue Feb 22, 2023
namespace is not declared

Fixes #1489

Signed-off-by: azerr <azerr@redhat.com>
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 This issue or enhancement is related to completion support RelaxNG
Projects
None yet
2 participants