Warm tip: This article is reproduced from stackoverflow.com, please click
reactjs tsx typescript visual-studio-code

Make VSCode apply syntax highlighting to .tsx files

发布于 2020-07-24 20:40:56

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

Questioner
APalmer
Viewed
10
APalmer 2019-10-08 23:24

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