Skip to content

x/tools/gopls: add refactoring capabilities for plumbing context.Context #60081

Description

@fantapop

Is your feature request related to a problem? Please describe.
As we add things like logging and tracing to more places in the codebase, I find I'm often plumbing the context.Context to new areas of the code. It's relatively straightforward but in a large codebase it can take a while.

Describe the solution you'd like
It would be great if there was refactor support for plumbing context back upwards through the function stack. I think its fairly standard to have ctx context.Context as the first item in a parameter list. I'd like to be able to put in a nested function call and then right click on the undefined variable error and have an error resolution be "plumb context from parent".

Describe alternatives you've considered
The only alternative I've considered is the refactor with some mixture of search/replace and manual fixes . I keep imagining one day I should be able to tell an LLM to do it for me. I searched through the vscode marketplace and didn't see anything that would do what I want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.RefactoringIssues related to refactoring toolsgoplsIssues related to the Go language server, gopls.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions