VS Code Syntax TypeScript Syntax Highlighting

落花浮王杯 提交于 2020-05-13 02:29:06

问题


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.


回答1:


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).




回答2:


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.

More

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



来源:https://stackoverflow.com/questions/39822230/vs-code-syntax-typescript-syntax-highlighting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!