templ icon indicating copy to clipboard operation
templ copied to clipboard

LSP: Enable automatic insertion of HTML close tags

Open a-h opened this issue 4 years ago • 1 comments

As per https://github.com/microsoft/language-server-protocol/issues/715

It looks like it's possible to intercept edits, and then use the https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit feature initiated from the server to insert the end tag, just like the XML example in the issue.

I'm currently working on doing this for the templ language elements, so there will be something to base this on.

a-h avatar May 09 '21 19:05 a-h

See example of automatic insertion added in this commit https://github.com/a-h/templ/commit/a460c0754d61058676f9f35c3feddc40372f7ced

a-h avatar May 16 '21 19:05 a-h

This is done by snippet managers such as vsnip

a-h avatar Apr 24 '23 07:04 a-h