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

Improved parameter names for call signatures resulting from unions #32056

Conversation

dragomirtitian
Copy link
Contributor

Fixes #31845

@fatcerberus
Copy link

calledUnionsOfDissimilarTyeshaveGoodDisplay.ts

I chuckled a bit at this filename, not sure why.

@dragomirtitian
Copy link
Contributor Author

@fatcerberus It was there when I started, it amused me too 😄

@dragomirtitian
Copy link
Contributor Author

dragomirtitian commented Jul 11, 2019

@weswigham Any thought on this PR since it touches your code ? The issue was that if the methods had different parameter length combineUnionParameters would end up calling getParameterNameAtPosition with an invalid parameter index. getParameterNameAtPosition would just return the string 'unknown' in this case and since this was different from the name in the longer function it would fall back to `arg${i}`.

The fix was to use the name of the parameter in the function with more parameters.

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like an improvement to me ❤️

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.

IntelliSense shows incorrect parameter names (TypeScript)
3 participants