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

Generate parameter name in sighelp when there is no public parameter name #10761

Merged
merged 3 commits into from
Dec 22, 2020

Conversation

cartermp
Copy link
Contributor

This fixes a quirk I noticed when dogfooding the feature in the F# compiler codebase.

In the compiler, we have several functions where the public signature doesn't give a parameter name, but the definition (obviously) has a parameter name. From a caller's standpoint, there is no argument to display, even though it still exists. This leads to tooltips that look like this:

image

The add2 function takes two parameters, but the public signature looks like this:

module internal Math

val add2: int -> int -> int

I would argue that this signature is the actual problem, but we still need to handle it in tools. The approach I went with is to just use a generic argX name:

image

Once the public signature is updated to have names, then those flow through in the tooltip instead.

@smoothdeveloper
Copy link
Contributor

@cartermp, I don't know how related it is, but it would be great if

let f = fun a b -> a + b

would carry the parameter names to f.

@cartermp
Copy link
Contributor Author

It's unrelated, but yeah that'd be cool

@KevinRansom
Copy link
Member

@cartermp conflicts mate.

@cartermp cartermp merged commit 3866910 into dotnet:main Dec 22, 2020
@cartermp cartermp deleted the sighelp-update2 branch December 22, 2020 21:07
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants