Bug Report
After taking the VS2022 update 17.5.0 on 2/28/2023, syntax highlighting in Typescript became wonky. The issue is still present after taking the 17.5.1 update today (3/1/2023). My coworker who didn't take the 17.5.1 update was able to rollback to 17.4.x to confirm that everything works fine there.
Steps to reproduce:
- Create an empty
*.ts file
- Open the file in Visual Studio 2022 v17.5.0+
- Copy the code below into the contents of your new
.ts file
export class MyClass {
public myProperty: any;
constructor() {
let myVar = <string>this.myProperty;
//some comments
//some more comments
//ya ya
for (let i = 0; i < 100; i++) {
console.log(i.toString());
}
}
}
Notice incorrect syntax highlighting here:

But if I change let myVar = <string>this.myProperty; to let myVar = this.myProperty;, the issue goes away:

🔎 Search Terms
visual studio, 17.5.0, 17.5.1, typescript syntax highlighting
🕗 Version & Regression Information
Issue exists in Visual Studio versions 17.5.0 and 17.5.1 but not 17.4.4.
If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: typescript@next
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
^I just tried this with the same issue.
- This changed between versions 17.4.4 and 17.5.0
Bug Report
After taking the VS2022 update 17.5.0 on 2/28/2023, syntax highlighting in Typescript became wonky. The issue is still present after taking the 17.5.1 update today (3/1/2023). My coworker who didn't take the 17.5.1 update was able to rollback to 17.4.x to confirm that everything works fine there.
Steps to reproduce:
*.tsfile.tsfileNotice incorrect syntax highlighting here:

But if I change
let myVar = <string>this.myProperty;tolet myVar = this.myProperty;, the issue goes away:🔎 Search Terms
visual studio, 17.5.0, 17.5.1, typescript syntax highlighting
🕗 Version & Regression Information
Issue exists in Visual Studio versions 17.5.0 and 17.5.1 but not 17.4.4.
^I just tried this with the same issue.