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

Account for type parameters in missing function codefix #49727

Merged

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Jun 29, 2022

In addition to any explicit type parameters, also accounts for any type parameters in the types of arguments.

I noticed both callers of typeToAutoImportableTypeNode use checker.getBaseTypeOfLiteralType, so I deduplicated & moved that inside the function. Edit: no longer true as of #50004. Reverted.

Fixes #49693

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jun 29, 2022
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the codefix-missing-function-generic branch from 107164d to e157bff Compare June 29, 2022 16:29
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review June 29, 2022 16:47
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Initial comments, although I still need to read getArgumentTypesAndTypeParameters more closely

src/services/codefixes/helpers.ts Outdated Show resolved Hide resolved
src/services/codefixes/helpers.ts Outdated Show resolved Hide resolved
src/services/refactors/extractSymbol.ts Outdated Show resolved Hide resolved
src/services/codefixes/helpers.ts Outdated Show resolved Hide resolved
src/services/codefixes/helpers.ts Outdated Show resolved Hide resolved
JoshuaKGoldberg and others added 3 commits July 22, 2022 15:40
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft July 22, 2022 22:32
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review July 24, 2022 14:35
@JoshuaKGoldberg JoshuaKGoldberg requested a review from sandersn July 24, 2022 14:35
@sandersn sandersn merged commit ebd42ab into microsoft:main Jul 26, 2022
@JoshuaKGoldberg JoshuaKGoldberg deleted the codefix-missing-function-generic branch July 26, 2022 22:22
@JoshuaKGoldberg JoshuaKGoldberg restored the codefix-missing-function-generic branch August 8, 2022 04:30
@JoshuaKGoldberg JoshuaKGoldberg deleted the codefix-missing-function-generic branch August 9, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add Missing Function Declaration: Does Not Correctly Declare Generic Function
3 participants