Skip to content

Clean up async refactoring #26720

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

Conversation

uniqueiniquity
Copy link
Contributor

Fixes #26374
This PR aims to fix a few issues:

  • Currently, we look to report suggestion diagnostics for the async code fix by checking the signatures of the return type annotation of a FunctionLikeDeclaration. Here, we change it to inspect the signatures of the entire declaration.
  • By doing the above by using the checker in suggestionDiagnostics.ts, we caused undesirable checking behavior in a subsequent full-source-file check. Therefore, this change moves suggestion diagnostic reporting for the async code fix into the checker walk itself and documents a distinction between syntactic and semantic suggestion diagnostic reporting.
  • Currently, if a FunctionExpression that is fixable is the direct child of a VariableDeclaration, then it reports a diagnostic on the variable name. However, triggering the code fix on the variable name will not successfully perform the change. This PR specifically handles this scenario when performing the code fix.
  • We also add test coverage for FunctionExpressions, as well as FunctionLikeDeclarations without a return type annotation.
  • Lastly, we now validate spans that are reported as suggestion diagnostics against what is expected by the test.

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

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

Marking my current review status for bookkeeping purposes based on our conversation yesterday

@uniqueiniquity
Copy link
Contributor Author

There's a much simpler fix. Closing and starting again.

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.

Async / Await Refactoring - Not offered on promise returning functions without an explicit return type
2 participants