lemminx
lemminx copied to clipboard
Completion when changing a tag inserts wrong closing tag

The tag already has a closing tag, and I am within a starting tag, so it should insert one.
@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.
Perhaps its' an extension that you have installed?
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.
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.
To be entirely clear: This bug has nothing to do with the extension. It happens without the extension too.

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!
Awesome. If rename works, there are definitely more important priorities like #117, https://github.com/redhat-developer/vscode-xml/issues/17
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:)
@felixfbecker I'm not sure, but perhaps the future settings autoCloseTags in https://github.com/angelozerr/lsp4xml/issues/130 could fix your problem.
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.