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

Quick fix at await to make current function async #21034

Closed
jwbay opened this issue Jan 5, 2018 · 3 comments · Fixed by #21069
Closed

Quick fix at await to make current function async #21034

jwbay opened this issue Jan 5, 2018 · 3 comments · Fixed by #21069
Labels
Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@jwbay
Copy link
Contributor

jwbay commented Jan 5, 2018

TypeScript Version: 2.7.0-dev.201xxxxx

Code

function foo() {
  await/*1*/ bar();
}

Expected behavior:
At 1, offers a code action that converts the innermost function to async:

async function foo() {
  await bar();
}

Actual behavior:
Error at 1 with no quick fix offered

@mhegazy mhegazy added Suggestion An idea for TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this labels Jan 6, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jan 6, 2018

A PR for adding the new quick fix would be appreciated. should be a simple one to add.

@mhegazy mhegazy added the Domain: Quick Fixes Editor-provided fixes, often called code actions. label Jan 6, 2018
@mhegazy mhegazy added this to the Community milestone Jan 6, 2018
@srolel
Copy link
Contributor

srolel commented Jan 8, 2018

I'd like to work on this, I think I have all I need (taking examples from the files in src/services/codefixes).

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jan 10, 2018
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.7 Jan 10, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jan 10, 2018

thanks @mohsen1 !

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants