Skip to content

Functions with async keyword don't autocomplete #53074

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
jespertheend opened this issue Mar 3, 2023 · 1 comment Β· Fixed by #53079
Closed

Functions with async keyword don't autocomplete #53074

jespertheend opened this issue Mar 3, 2023 · 1 comment Β· Fixed by #53079
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Help Wanted You can do this
Milestone

Comments

@jespertheend
Copy link
Contributor

Bug Report

πŸ”Ž Search Terms

async function autocomplete

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about async

⏯ Playground Link

Playground Link

πŸ’» Code

type ObjectWithSyncFn = {
    syncFunctionName: () => void;
}

type ObjectWithAsyncFn = {
    promiseFunctionName: () => Promise<void>;
}


const x : ObjectWithSyncFn = {
    sync // <- Function name is autocompleted here
}

const y : ObjectWithAsyncFn = {
    async promi // <- Autocompletions unavailable
}

πŸ™ Actual behavior

When trying to autocomplete promiseFunctionName, autocompletions are unavailable

πŸ™‚ Expected behavior

It would show promiseFunctionName in the autocompletion, similar to how it works with functions without the async keyword.

@gomain
Copy link

gomain commented Mar 3, 2023

Interfaces with classes work, but not with plain objects.

Extended playground

interface InterfaceOfAsyncFunction {
    promiseFunction: () => Promise<void>;
}

class ImplementsInterfaceOfAsyncFunction implements InterfaceOfAsyncFunction {
    async promi  // <- this works
}

const z: InterfaceOfAsyncFunction = {
    async promi // <- this also doesn't
}

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: Completion Lists The issue relates to showing completion lists in an editor labels Mar 3, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants