Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

[JavaScript] optional chaining operator breaks highlight #6255

Closed

Description

@tophf

I see it's added to the next CodeMirror but what about 5.xx?

Currently, using ?. will break highlighting in seemingly unpredictable ways as seen in the official demo when adding ?.test after context in line 13:

gif

Activity

  1. marijnh commented on May 1, 2020

    @marijnh
    Member

    Are you testing with the current master branch? Because I believe I added this last week.

  2. tophf commented on May 1, 2020

    @tophf
    ContributorAuthor

    No, I tested the official demo (the screenshot is from the online demo) and the latest release.

  3. marijnh commented on May 1, 2020

    @marijnh
    Member

    Try a hard refresh? For me, obj on the line below stays blue when I add the property.

  4. tophf commented on May 1, 2020

    @tophf
    ContributorAuthor

    Retried now with hard refresh in three different browsers as well as tried the master branch locally => still seeing the bug. I'm talking about CodeMirror 5.xx, not the next big thing.

  5. marijnh commented on May 1, 2020

    @marijnh
    Member

    Ah, don't mind me, I had implemented (and was testing) a .? operator, instead of a ?. one. Attached patch should help.

  6. added a commit that references this issue on Oct 31, 2020
    14d7274
  7. added a commit that references this issue on Sep 5, 2024
    a9774d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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