Code Monkey home page Code Monkey logo

Comments (4)

joerdav avatar joerdav commented on August 26, 2024

From my basic understanding I think this will involve supporting "codeActionLiteralSupport", this allows actual page edits to be returned from the textDocument/codeAction request.

from templ.

joerdav avatar joerdav commented on August 26, 2024

After some more investigation, this is nothing to do with the above! The problem is that gopls does not do organizeImports on generated files, the string at the top of our go files DO NOT EDIT means that it is ignoring the request.

I tried removing it in our cached version of the go file, however it seems that gopls is still reading the disk version of the file, therefore it still contains the comment.

One solution would be to remove this comment entirely, @a-h do you think that is sensible, as organize imports is a fairly requested feature?

from templ.

joerdav avatar joerdav commented on August 26, 2024

I have now managed to get gopls to respond to the request. However, now when mapping to the templ file the code becomes mangled, it tries to convert it to a multiline import as the generated file contains multiple imports even if the templ file only has one.

The way I can think to do this, is apply the change to the generated imports list, remove the "implicit" imports and then create our own change list for the templ file.

from templ.

a-h avatar a-h commented on August 26, 2024

Released in https://github.com/a-h/templ/releases/tag/v0.2.731

from templ.

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.