Git Product home page Git Product logo

Comments (7)

hyangah avatar hyangah commented on July 19, 2024 1

Thanks @Req23. That's helpful!

I don't know the details on how templ LSP server proxies gopls.
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

  1. update the protocol to support InsertReplaceEdits, or
  2. adjust the client capability so InsertReplaceSupport is unset before forwarding the capability.

Can you please open an issue to the a-h/templ repo? Thanks!

from vscode-go.

hyangah avatar hyangah commented on July 19, 2024

I guess you are using a-h/templ. Isn't the templ extension able to handle auto-complete?

https://templ.guide/commands-and-tools/ide-support/#visual-studio-code

cc @a-h

from vscode-go.

Req23 avatar Req23 commented on July 19, 2024

Yeah I am using a-h/templ along with the vscode-go extension. I followed the guide for VSC with vscode-go + a-h/templ. I thought maybe the go side of it was responsible for the imports, auto completes, etc.

from vscode-go.

Req23 avatar Req23 commented on July 19, 2024

Auto completion is working with:
gopls v. 0.15.3
and
a-h/templ from @main

The newest version of gopls and templ didn't seem to work together. Just letting you know what I found.

from vscode-go.

hyangah avatar hyangah commented on July 19, 2024

I will close this issue since this is beyond the go extension's scope.
Thank you so much for filing the issue in a-h/templ!

from vscode-go.

a-h avatar a-h commented on July 19, 2024

Thanks for raising this. Without this feature, gopls v0.16.x won't work properly with templ.

I've updated protocol in a-h/protocol@1e461c1

And I've updated templ in a-h/templ@26c1d79

from vscode-go.

a-h avatar a-h commented on July 19, 2024

Nice investigation @hyangah!

from vscode-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.