a-h / templ

A language for writing HTML user interfaces in Go.
https://templ.guide/
MIT License
7.14k stars 236 forks source link

Investigate issue raised in vscode-go #814

Closed Req23 closed 20 hours ago

Req23 commented 1 week ago

The following comment from vscode-go

Link to the comment

gopls v0.16.0+ started to use InsertReplaceEdits if the client sets the capability. (https://github.com/golang/tools/blob/master/gopls/internal/protocol/tsprotocol.go#L1024).
If the templ LSP relies on github.com/a-h/protocol, I see that it does not handle InsertReplaceEdits type yet
(https://github.com/a-h/protocol/blob/b4eec67c1c223e5a747d39f3d07f62d25236aa4a/language.go#L260).

I think the templ LSP server needs to either

update the protocol to support InsertReplaceEdits, or
adjust the client capability so [InsertReplaceSupport](https://github.com/a-h/protocol/blob/b4eec67c1c223e5a747d39f3d07f62d25236aa4a/capabilities_client.go#L433) is unset before forwarding the capability.
Can you please open an issue to the a-h/templ repo? Thanks!
a-h commented 20 hours ago

Thanks for raising this.

I've updated protocol in https://github.com/a-h/protocol/commit/1e461c188041cecf07f6e39ac25503a1ac1b0513

And I've updated templ in https://github.com/a-h/templ/commit/26c1d79761e7800837caffdd3c8c2abab96e0794