Closed DGCK81LNN closed 2 years ago
Experiencing this problem also, see: https://github.com/github/linguist/issues/5794
GitHub syntax highlighting is incorrectly handling template literal types:
Expected behaviour: It should render the same as VS Code does:
Also ran into this issue:
Even TypeScript's team ran into this issue.
Latest master
supports these examples now, as far as I can tell, so I'm closing this.
The following piece of code is valid but it is parsed incorrectly:
The snippet above is valid TypeScript: https://www.typescriptlang.org/play?#code/G4QwTgBALgFglgZwPoQLwQAYYNwChSSIDCA9mGAKYDGUamAZiSTrlAJ4AOFEAQgK5QAKvAR0s2CAHpJAHgC0EenDAJaAIxBUA1lDjaIiCAHd4UCq07cAkggDqYEgDsA5mMbM8uaRACqAWwA6IIgAZRIIKwByPwNHCBBoCj8OABsQMwhVMDgXCDJjGHSAflx8cAhQFL5udAx2LggAQTosnOccKVkFBGonABMIDW1dfUMTODMgA
I was just browsing someone's code on GitHub when I noticed the highlighting was wrong. I tried to reproduce the problem in the snippet above. The first backtick on line 3 seems to have been ignored or what.
The original code I saw looked more like this, actually:
The output ofI didn't know anything about tree-sitter before, and I have been unable to run tree-sitter right now, sorry. I'll come back to this later.tree-sitter parse
is the following: