Skip to content

Support option chaining syntax highlighting #522

@mjbvz

Description

@mjbvz

TS and JS Grammar Extension version: 0.0.22 / latest

From microsoft/vscode#34776 (comment)

Feature request
Support highlighting the proposed option chaining syntax for JS/TS

const a = {
  b: {
    c: {
      d: {
        e: 1,
        g: [1, 2, 3],
      },
    },
    f: null,
  },
};

const brokenSyntaxHighlighting = () => {
  const array = a?.b?.c?.d?.g;

  /**
   * No TypeEror, but syntax highlighting is broken
   */
  const test = a?.b?.f?.f;

  for (let i = 0; i < array.length; i++) {
    console.log(array[i]);
  }
};

brokenSyntaxHighlighting();

30707451-31af05c4-9f04-11e7-9b4f-12e6ff3ad2f8

TS support for this is tracked by: microsoft/TypeScript#16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions