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

Adding closing bracket (>) in attribute quotation marks is causing repeated auto-complete of closing tag. #547

Closed
joshuacookdev opened this issue Jul 9, 2021 · 3 comments · Fixed by eclipse/lemminx#1083 or #550
Assignees
Labels
bug Something isn't working completion
Milestone

Comments

@joshuacookdev
Copy link

joshuacookdev commented Jul 9, 2021

When the extension is enabled (v 0.17.0), if you accidentally type your closing bracket inside of the quotation marks:

<element attribute="value" (i.e. <element attribute="value>"), autocomplete attempts to add the closing tag .

However, it's registering each added closing tag as a new closing bracket and attempting to add more closing tags. This happens repeatedly, and can lead to output similar to the following until the user presses another key:

<element attribute="value></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element></element>" (and continues going).

To prevent this behavior, the extension could either:

  1. Not attempt to auto-close the element in cases where a closing tag is added inside of an attribute value,
  2. Move the curson and place the closing tag outside of the quotation marks, or
  3. Limit itself to one closing tag, if possible.
@joshuacookdev joshuacookdev changed the title Adding closing bracket (>) in attribute quotation marks is causing repeated pasting of closing tag for completion. Adding closing bracket (>) in attribute quotation marks is causing repeated auto-complete of closing tag. Jul 9, 2021
@joshuacookdev
Copy link
Author

Not an urgent fix, since any input to the text stops the repeated auto-complete, but it's probably not desired behavior. I figure that I'm not the only person who has accidentally attempted to close a tag without having the cursor in the right spot.

@datho7561 datho7561 added bug Something isn't working completion labels Jul 9, 2021
@datho7561
Copy link
Contributor

This case also causes the issue:

<root>
  <child attr="value|
</root>

then

<root>
  <child attr="value</|
</root>

@datho7561 datho7561 self-assigned this Jul 9, 2021
@datho7561 datho7561 added this to the 0.17.1 milestone Jul 12, 2021
datho7561 added a commit to datho7561/lemminx that referenced this issue Jul 12, 2021
Fixes redhat-developer/vscode-xml#547

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561
Copy link
Contributor

Thanks for filing this bug! I think this makes sense to fix for the next release, so I've made a PR.

datho7561 added a commit to eclipse/lemminx that referenced this issue Jul 13, 2021
Fixes redhat-developer/vscode-xml#547

Signed-off-by: David Thompson <davthomp@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
Projects
None yet
2 participants