Skip to content

x/tools/gopls: ctrl-click should jump to source, not to autogenerated code #65001

@guettli

Description

@guettli

gopls version

(does not matter here)

go env

(does not matter here)

What did you do?

I use Go, vscode and templ.guide

The tool templ creates Go code from templates.

I am looking at my Go file and I use a function which was auto-generated by templ:

If I ctrl-click on page() then ...

image

then I get to the autogenerated Go code:

image

It would be great if I could get to the templ-file instead:

image

As a user, the experience is not great, because I would like to jump to the original source (the templ template).

Does gpls provide hooks, which templ could implement, so that ctrl-click jumps directly to the templ template?

Related issue: a-h/templ#387

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions