Skip to content

Auto-insert await for property accesses on Promise #31450

Closed
@DanielRosenwasser

Description

@DanielRosenwasser
async function foo(x: Promise<string>) {
  x./**/
}

Go to the /**/ marker and request completions.

The proposal here is that all the completions for string should show up. When the user selects a string member, we should automatically await the value, so selecting toLowerCase changes the code to (await x).toLowerCase.

Metadata

Metadata

Assignees

Labels

Domain: Completion ListsThe issue relates to showing completion lists in an editorEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions