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.

Bug: Syntax highlighter has a bug

See original GitHub issue

Describe the bug The syntax highlighter used has a bug with backticks.

To Reproduce Add the following to a file and run typescript-coverage-report. Open the html file and you’ll see the highlighting breaks

/**
 * see #54
 */
export type Path<T, Key extends keyof T = keyof T> = Key extends string
 ? T[Key] extends Record<string, any>
   ?
       | `${Key}.${Path<T[Key], Exclude<keyof T[Key], keyof any[]>> & string}`
       | `${Key}.${Exclude<keyof T[Key], keyof any[]> & string}`
       | Key
   : never
 : never;

export type PathValue<T, P extends Path<T>> = P extends `${infer Key}.${infer Rest}`
 ? Key extends keyof T
   ? Rest extends Path<T[Key]>
     ? PathValue<T[Key], Rest>
     : never
   : never
 : P extends keyof T
 ? T[P]
 : never;

Expected behaviour It to not break.

Screenshots Screen Shot 2021-05-01 at 10 59 28 pm

Environment

  • Tool version: 0.6.0
  • OS: N/A
  • Node version: N/A
  • Browser (if applicable): [e.g. chrome, safari] N/A

Additional context Same issue in all browsers leading me to believe it’s an issue with the code on generation but I could be wrong.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
alexcanessacommented, May 12, 2021

@OmgImAlexis yes seems to be the exact issue.

1reaction
alexcanessacommented, May 11, 2021

If I paste the same code in this codemirror playground I get the same. Even trying to upgrade to the latest version of codemirror.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Razor Syntax highlighter bug - Visual Studio Feedback
In the existing editor, it's an implementation limitation that we won't be able to fix. As a workaround, please consider these two possibilities:...
Read more >
Weird Bug with Highlight.js - Perishable Press
The bug is that Highlight.js is applying syntax highlighting, even when the element does not include the required language- class. So a code ......
Read more >
Awalys show "Syntax highlighting has been temporarily ...
Every time I write code, I will prompt this error after a while, and then the smart prompt and syntax highlighting are turned...
Read more >
Possible bug in syntax highlighter? - Google Groups
1.) There is different (green) highlighting for the middle term when you have two divisions in a row but only when the third...
Read more >
536806 – new Photon syntax highlighting has delay - Bugs
So basically: * Eclipse Photon was released with an obvious syntax highlighting bug that affects almost every typed letter. * The bug has...
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