Skip to content

LSP inserts duplicate async keywordΒ #57928

@marvinhagemeister

Description

@marvinhagemeister

πŸ”Ž Search Terms

lsp, intellisense, suggestions, async keyword, autocomplete

πŸ•— Version & Regression Information

  • I was unable to test this on prior versions because I don't have that much time on my hands.

⏯ Playground Link

https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgMQgjgG8AoOOKYJAEzQAoA3TAGwFdgAuOJdgWwBGaADRwIMABZoeAZxhRkAcwCUPAApQI-BLOAAeeYqRKAfAG4yAXzJlsrTLNkEiASX5hWiD62D8aMM6ExOSUAPRhcAAqAJ5geABEjjFI2FQ09FAJcNLUcJh0+di4YPCy7EpKwPIIEEgAdBRwES5QcLLaeNSOdXCucNgFSBLpYFq07LiI8MhwUniemDFKWux0Ik0tguzwg0iI+0yy2BD0cADuCFJz0nCgOGWY-tEAynBMaLK1DU3WQA

πŸ’» Code

export interface Foo {
  render(value: number, other: string): Promise<string>;
}

class FooImpl implements Foo {
  // Type "async render" here and accept suggestion.
  // For some reason I cannot reproduce it in the playground,
  // but can in vscode with the exact same TS version.
  
}

πŸ™ Actual behavior

This was originally discovered in denoland/deno#23046 (comment) . We assumed that it is an issue with the TSC fork in Deno's LSP, but turns out that the same issue exists in tsc itself. Best explained via a video:

deno-lsp-async.mp4

πŸ™‚ Expected behavior

It should not insert duplicative async keywods:

export interface Foo {
  render(value: number, other: string): Promise<string>;
}

class FooImpl implements Foo {
  // only one async keyword
  async render(value: number, other: string): Promise<string> {
    
  }
}

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions