-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.FixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
Search Terms
asterisk, addMethodDeclaration
Suggestion
When a new method is created that is used by a yield * expression, generated method should have an asterisk before its name.
Use Cases
VSCode would create generator functions when the addMissingMember codefix is applied to an invocation inside a YieldExpression.
Examples
New method created by vscode for this block:
class A {
private *a() {
yield* this.abc();
}
}is:
abc(): any {
throw new Error("Method not implemented.");
}and while it is apparent that return type should be changed, it is not obvious to convert the new abc funciton to a generator function such as:
*abc(): any {
throw new Error("Method not implemented.");
}Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.FixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this