Skip to content

Parameter Hints for Function Calls #1795

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

Closed
Suraj-Yadav opened this issue Sep 22, 2021 · 3 comments
Closed

Parameter Hints for Function Calls #1795

Suraj-Yadav opened this issue Sep 22, 2021 · 3 comments

Comments

@Suraj-Yadav
Copy link

Is your feature request related to a problem? Please describe.
For function calls, sometimes it becomes quite difficult to tell what a argument actually does. Usually it happens when the arguments passed are boolean/integer. We can hover over the call and it would show the signature, but it would be helpful if we can tell this directly at a glance.

func log(message string, appendTime bool) {
	if appendTime {
		fmt.Print(message, "at", time.Now())
	} else {
		fmt.Print(message)
	}
}

log("Process Started", true)

log("Still Running", false)

Describe the solution you'd like
We can have something like Parameter hints in Webstorm.

Describe alternatives you've considered
The only alternative I see is hover.

Additional context
Image from Webstorm
Image from Webstorm

@gopherbot gopherbot added this to the Untriaged milestone Sep 22, 2021
@suzmue
Copy link
Contributor

suzmue commented Sep 22, 2021

You can enable placeholders to view the function signature inline using:

    "gopls": {
        "ui.completion.usePlaceholders": true
    }

Signature help with usePlaceholders=false:
Screen Shot 2021-09-22 at 10 59 45 AM
Signature help with usePlaceholders=true:
Screen Shot 2021-09-22 at 11 00 12 AM

This feature request sounds like its for inspecting the code, not for help filling in the values, correct?

@hyangah
Copy link
Contributor

hyangah commented Sep 22, 2021

Isn't it a duplicate of #1631?

@suzmue
Copy link
Contributor

suzmue commented Sep 23, 2021

@hyangah Yes it looks like it.

Closing as a duplicate of #1631

@suzmue suzmue closed this as completed Sep 23, 2021
@golang golang locked and limited conversation to collaborators Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants