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

[XML] Support for autoCloseTags #143

Closed
angelozerr opened this issue Mar 12, 2019 · 9 comments · Fixed by #865
Closed

[XML] Support for autoCloseTags #143

angelozerr opened this issue Mar 12, 2019 · 9 comments · Fixed by #865

Comments

@angelozerr
Copy link
Contributor

XML language server supports a custom command to manage auto close tag (which is very nice when you are editing XML content).

I have started to implement this feature with org.eclipse.ui.genericeditor.autoEditStrategies:

 <extension
         point="org.eclipse.ui.genericeditor.autoEditStrategies">
      <autoEditStrategy
            class="org.eclipse.lsp4e.xml.CloseTagAutoEditStrategy"
            contentType="org.eclipse.core.runtime.xml">
      </autoEditStrategy>
   </extension>

See https://github.com/angelozerr/lsp4e-xml/blob/master/org.eclipse.lsp4e.xml/plugin.xml#L139 and https://github.com/angelozerr/lsp4e-xml/blob/7e14cc109c2bcc80809c6625d310568f8052f421/org.eclipse.lsp4e.xml/src/org/eclipse/lsp4e/xml/CloseTagAutoEditStrategy.java

To be honnest with you, I don't remember if it works well, but vscode-xml consumes it and works well.

@yanxi0830 is there any chance that you could work on this issue? Thanks!

@yanxi0830
Copy link
Contributor

Sure thing! I'll take a look.

@mickaelistria
Copy link
Contributor

I'd rather not rely on custom commands. LSP offers the workspace/applyEdit server to client message for auto-edits. This is standard and already supported in LSP4E. I don't think we need anything else to cover tis job, so let's stick to standard.

@angelozerr
Copy link
Contributor Author

Sure thing! I'll take a look.

Thanks!

I'd rather not rely on custom commands. LSP offers the workspace/applyEdit

I don't remember how it works, but if lsp4xml needs some change, please create an issue for that with some explanation. Thanks!

@mickaelistria
Copy link
Contributor

I don't remember how it works, but if lsp4xml needs some change, please create an issue for that with some explanation.

Ok, I will.
I suggest we do not change anything in Wild Web Developer and get it more mainstream in LSP4XML then.

@mickaelistria
Copy link
Contributor

See eclipse-lemminx/lemminx#324

@angelozerr
Copy link
Contributor Author

@mickaelistria we have a lot of discussion about this feature but IMHO I think WWD should provide this custom auto close tag request for XML and HTML both (see #208)

I'm not sure that HTML LS will provide this feature with workspace/applyEdit and we have a lot of users who complains about this missing feature which I think it's very important when you write XML or HTML.

@mickaelistria
Copy link
Contributor

How does HTML LS implement it?

@angelozerr
Copy link
Contributor Author

angelozerr commented Jan 31, 2022

I noticed that HTML LS provides now a new custom request (I think we should do the same thing for XML). See https://github.com/microsoft/vscode/blob/5323a5374639a302e00d77c0ff2f9027826ad9eb/extensions/html-language-features/client/src/htmlClient.ts#L46

@mickaelistria
Copy link
Contributor

Can you please remind me why onTypeDocumentFormatting can't do that already?

angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Sep 8, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Sep 8, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Sep 13, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 18, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 19, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 19, 2022
angelozerr added a commit to angelozerr/wildwebdeveloper that referenced this issue Oct 19, 2022
mickaelistria pushed a commit that referenced this issue Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants