Skip to content

Wrong JavaScript (and TypeScript) syntax highlight of keyword operand in ternary operator for particular styling. #724

@escKeyStroke

Description

@escKeyStroke
  • VSCode Version: 3.31.1
  • OS Version: Windows 10.0.17134 Build 17134

See the second method below for the syntax highlighting bug.

class C {

  a(){return false}
  b(){return false}

  Works(){
    return this.a()
    ? true
    : this.b()
      ? false
      : true;
  }

  doesNotWork = () =>
    this.a()
    ? true
    : this.b()
      ? false
      : true; // fails for apparently any keyword, e.g. "undefined", "null", ...

  alsoWorks = () =>
    this.a() ? true : this.b() ? false : true;

}

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions