I've recently started coding TypeScript in VS Code, but I did thought that the syntax highlighting is really bad. So I started to Google around and found out that at its best it could look like this:
Mine looks like this:
I am using TypeScript 2.0.3 and working on a mac 10.11.6.
Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.
To add a syntax highlighting language, simply check its checkbox in the main list of languages. It will appear with a checkmark in bold font to show that it has been selected but not yet installed.
What helped me was what @Reg1nleifr mentioned in their comment: Switching the color scheme.
Go to Preferences -> Color Theme and change it to Dark+ (default dark).
The syntax highlighting in VSCode is driven by textmate files. This is the repository : https://github.com/Microsoft/TypeScript-TmLanguage/
It recently (16 days ago) went through a massive refactor : https://github.com/Microsoft/TypeScript-TmLanguage/pull/257 so hopefully it should get better if you update to vscode latest.
The best highlighting would come if it was done using the same code the compiler uses to parse the code. That isn't how vscode is architectured at the moment, so I do have my own code that does it : https://basarat.gitbooks.io/alm/content/features/typescript.html#syntax-highlighting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With