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 when changing a tag inserts wrong closing tag #122

Closed
felixfbecker opened this issue Sep 14, 2018 · 12 comments
Closed

Completion when changing a tag inserts wrong closing tag #122

felixfbecker opened this issue Sep 14, 2018 · 12 comments
Assignees
Labels
bug Something isn't working completion This issue or enhancement is related to completion support

Comments

@felixfbecker
Copy link
Contributor

felixfbecker commented Sep 14, 2018

2018-09-14 13 07 37

The tag already has a closing tag, and I am within a starting tag, so it should insert one.

@angelozerr
Copy link
Contributor

@felixfbecker I don't understand how you do that with vscode: you select a tag name and you type some content and it updates the end tag too?

Could you explain me please?

Please note that you have a rename feature which supports that.

@angelozerr
Copy link
Contributor

Perhaps its' an extension that you have installed?

@felixfbecker
Copy link
Contributor Author

Oh, that's a different extension: https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag

It should not affect the bug because the autocompletion is provided by vscode-xml.

I use that extension because in JSX, when you rename an element, it will rename the referenced component (everywhere), not change which component is referenced. The equivalent in vscode-xml would be if it changed the name attribute for the xs:element is the referenced XSD. So I just trained myself to not use rename for this.

@angelozerr
Copy link
Contributor

lsp4xml gives the capability ro rename the start/end tag element (not the whole document).

I will try to install your extension and play with it. I don't know if it's an hard task to do.

@felixfbecker
Copy link
Contributor Author

To be entirely clear: This bug has nothing to do with the extension. It happens without the extension too.

2018-09-14 13 40 49

@angelozerr
Copy link
Contributor

I understand your problem and it should be cool to fix it, but I think it's an hard task because in your case you need to detect that </ListItem> is an end element which have no opened element and which be replaced with the opened <TableColumnItem>.

Today the tolerant XML parser ignore the end element which have no opened element (it's the same logic than the HTML Language Server of vscode).

I keep opened this issue, but I don't know when (and if) it will be fixed. Changing the XML parser (which is a translate of HTML Language Server of vscode) scares me. Any contribution are welcome!

@felixfbecker
Copy link
Contributor Author

Awesome. If rename works, there are definitely more important priorities like #117, redhat-developer/vscode-xml#17

@angelozerr
Copy link
Contributor

Awesome.

Glad it pleases you:) The only think with rename is that you have not completion.

If rename works, there are definitely more important priorities like #117, redhat-developer/vscode-xml#17

I have an idea how to do fix it, just find time to do it:)

@angelozerr
Copy link
Contributor

@felixfbecker I'm not sure, but perhaps the future settings autoCloseTags in #130 could fix your problem.

@felixfbecker
Copy link
Contributor Author

Yeah, I think I would prefer tags to not be autoclosed, since it's easy to manually close a tag by invoking autocompletion and selecting the suggestion to close the tag.

@angelozerr angelozerr self-assigned this Aug 27, 2020
@fbricon fbricon added bug Something isn't working completion This issue or enhancement is related to completion support labels Sep 17, 2020
@fbricon
Copy link
Contributor

fbricon commented Feb 15, 2023

Looks to me this is working as expected now (with "editor.linkedEditing":true):

Feb-15-2023 13-22-47

@felixfbecker can we close this issue?

@angelozerr
Copy link
Contributor

Indeed I worked on this usecase, we can close this issue.

@fbricon fbricon closed this as completed Feb 15, 2023
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
Projects
None yet
Development

No branches or pull requests

3 participants