Skip to content

default keyword is offered in expression-bodied arrow function completions #63463

@DhineshPonnarasan

Description

@DhineshPonnarasan

Bug Report

Search Terms

  • arrow function completion
  • default keyword completion
  • expression-bodied arrow function
  • keyword completions
  • completionListAtEndOfWordInArrowFunction

Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about keyword completions in expression-bodied arrow function contexts.

Playground Link

Playground link with relevant code: https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA

Code

(d, defaultIsAnInvalidParameterName) => d

(d, defaultIsAnInvalidParameterName) => default

Actual behavior

At the expression-bodied arrow function completion position, default is offered as a keyword completion.

Expected behavior

default should not appear as a keyword completion in expression-bodied arrow function expression context.

Additional information about the issue

There are already nearby fourslash tests that appear to acknowledge this behavior as undesirable:

  • tests/cases/fourslash/completionListAtEndOfWordInArrowFunction02.ts
  • tests/cases/fourslash/completionListAtEndOfWordInArrowFunction03.ts

I also traced the completion path locally and confirmed the keyword currently comes from the generic FunctionLikeBodyKeywords filtering path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editor

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions