Bug: Syntax highlighter has a bug
See original GitHub issueDescribe 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
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:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@OmgImAlexis yes seems to be the exact issue.
If I paste the same code in this codemirror playground I get the same. Even trying to upgrade to the latest version of codemirror.