简体   繁体   English

VS代码语法TypeScript语法突出显示

[英]VS Code Syntax TypeScript Syntax Highlighting

I've recently started coding TypeScript in VS Code, but I did thought that the syntax highlighting is really bad. 我最近开始在VS Code中编写TypeScript,但我确实认为语法突出显示非常糟糕。 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. 我正在使用TypeScript 2.0.3并在mac 10.11.6上工作。

What helped me was what @Reg1nleifr mentioned in their comment: Switching the color scheme. 帮助我的是@ Reg1nleifr在评论中提到的:切换配色方案。

Go to Preferences -> Color Theme and change it to Dark+ (default dark) . 转到首选项 - >颜色主题并将其更改为暗+(默认为暗)

The syntax highlighting in VSCode is driven by textmate files. VSCode中的语法突出显示由textmate文件驱动。 This is the repository : https://github.com/Microsoft/TypeScript-TmLanguage/ 这是存储库: 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. 它最近(16天前)经历了一个巨大的重构: https//github.com/Microsoft/TypeScript-TmLanguage/pull/257所以如果你更新到最新的vscode,它希望它会变得更好。

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 这不是vscode目前架构的方式,所以我确实拥有自己的代码: https ://basarat.gitbooks.io/alm/content/features/typescript.html#syntax-highlighting

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM