Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: Expect the Implement code action to add the receiver name by default. #64078

Closed
tttoad opened this issue Nov 12, 2023 · 4 comments
Assignees
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@tttoad
Copy link

tttoad commented Nov 12, 2023

I think adding default variable names is helpful in most cases.
If it passes, I will implement this feature.

What did you do?

Call Implement code action

What did you expect to see?

func (l *Logger) DPanicCtx(ctx context.Context, args ...interface{}) {
	panic("unimplemented")
}

// DPanicfCtx implements LoggerCtx.
func (l *Logger) DPanicfCtx(ctx context.Context, template string, args ...interface{}) {
	panic("unimplemented")
}

// DPaniclnCtx implements LoggerCtx.
func (l *Logger) DPaniclnCtx(ctx context.Context, args ...interface{}) {
	panic("unimplemented")
}

What did you see instead?

func (*Logger) DPanicCtx(ctx context.Context, args ...interface{}) {
	panic("unimplemented")
}

// DPanicfCtx implements LoggerCtx.
func (*Logger) DPanicfCtx(ctx context.Context, template string, args ...interface{}) {
	panic("unimplemented")
}

// DPaniclnCtx implements LoggerCtx.
func (*Logger) DPaniclnCtx(ctx context.Context, args ...interface{}) {
	panic("unimplemented")
}
@tttoad tttoad added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Nov 12, 2023
@gopherbot gopherbot added this to the Unreleased milestone Nov 12, 2023
@findleyr findleyr changed the title x/tools/gopls: Expect the Implement code action to add the variable name by default. x/tools/gopls: Expect the Implement code action to add the receiver name by default. Nov 13, 2023
@findleyr
Copy link
Contributor

I suppose so. At the very least, I think it's inconsistent to add names for other parameters but not the receiver parameter.

We will discuss this in our weekly triage meeting. I think this is worth doing, but want to see if the rest of the team agrees. If anyone reading this has an opinion one way or the other, please let us know.

@suzmue suzmue modified the milestones: Unreleased, gopls/backlog Nov 13, 2023
@tttoad
Copy link
Author

tttoad commented Nov 23, 2023

@findleyr Any luck with the discussion?

@findleyr
Copy link
Contributor

Sorry, yes we discussed and agree it makes sense.

@gopherbot
Copy link

Change https://go.dev/cl/544916 mentions this issue: gopls/stub: the implement code action to add the receiver name by default

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 9, 2024
@findleyr findleyr modified the milestones: gopls/backlog, gopls/v0.15.0 Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants