Make VSCode apply syntax highlighting to .tsx files

Viewed 3120

Trying to start a gatsby+react+typescript project and VSCode will only apply syntax highlighting to the HTML in my .tsx files. The typescript code remains a single color. How do I fix this?

Note: I have no plugins installed at the moment and the highlighting works if the file type is set to .jsx

related image

2 Answers

Clicking on the language button in the lower right corner and selecting typescript react fixed the problem.

I faced same problem, even "Typescript React" was selected as the language. I had to click and select the language pack version before getting syntax highlighting working.

vscode select language pack version

Related