redhat-developer / quarkus-ls

Language server for Quarkus tooling
Eclipse Public License 2.0
43 stars 15 forks source link

Update orphan end tag section when completion is applied #806

Closed angelozerr closed 1 year ago

angelozerr commented 1 year ago

Update orphan end tag section when completion is applied

Fixes #805

angelozerr commented 1 year ago

It should start working:

UpdateEndTag

@JessicaJHee could you play with this PR please to see ifit could work with surround.

I need to clean my code and write some again tests.

JessicaJHee commented 1 year ago

This works well for the parent section! But it seems to have some issues when I try with the child section. For example, completion with the when and if sections has unexpected behavior when I surround the child expression. Depending on how many character I enter before hitting tab to complete, the result on the end tag is different.

Peek 2023-02-28 11-19

Peek 2023-02-28 11-51

angelozerr commented 1 year ago

Many thanks @JessicaJHee for your great feedback. It is a really bad news and it seems we have the same problem with XML.

I think the compute of additionnal text edit is computed after the insert of character and provide a wrong result. I have no idea for the moment how to fix that -(

angelozerr commented 1 year ago

@JessicaJHee I asked at https://github.com/microsoft/vscode-languageserver-node/issues/1198

angelozerr commented 1 year ago

Accordding to https://github.com/microsoft/vscode-languageserver-node/issues/1198#issuecomment-1449773256 it seems that it is not possible to update correctly end tag section.

I close this PR for a new PR https://github.com/redhat-developer/quarkus-ls/pull/807 which doesn't update the end tag section