question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[JavaScript] optional chaining operator breaks highlight

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
marijnhcommented, May 1, 2020

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

0reactions
tophfcommented, May 1, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
The optional chaining (?.) operator accesses an object's property or calls a function. If the object accessed or function called is ...
Read more >
Optional chaining operator support in VSCode - Stack Overflow
VS Code 1.41 supports optional chaining in both JavaScript and TypeScript files. This support includes syntax highlighting and IntelliSense.
Read more >
JavaScript Optional Chaining Operator (?.)
In this tutorial, you'll learn about the optional chaining operator (?.) that simplifies the way to access values through connected objects.
Read more >
What is wrong with optional chaining and how to fix it - DEV ...
The operator tries to address issues of previously used && . This article tries to make a point that JS has Nullable, and...
Read more >
Support optional chaining operator in JS (!21621) - GitLab.org
might break people's editor syntax highlighting. ... Simon Knox changed title from Support optional chaining operator in JS to Support optional?.chaining ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found