Typescript 1.4:Visual Studio 中错误的语法高亮 [英] Typescript 1.4: Wrong syntax highlighting in Visual Studio

查看:32
本文介绍了Typescript 1.4:Visual Studio 中错误的语法高亮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Typescript 1.4 最近发布,提供了新的可能性,例如联合.

Typescript 1.4 has been released recently, providing new possibilities like unions.

我为 Visual Studio 安装了新版本,但是语法突出显示无法识别联合:

I installed the new version for Visual Studio, however the syntax highlighting doesn't recognise unions:

var member: string|number;

虽然可以毫无问题地编译,但语法检查器会悬停在变量member 的定义和任何用法上.

Although it can be compiled without problems, the syntax checker hovers the definition and any usage of the variable member.

我需要更新什么才能使其正常工作?

What do I need to update to get this working?

推荐答案

您可以将其配置为忽略分析 *.ts 文件中的错误,而不是关闭 Resharper.(Tools -> Options -> Resharper Options -> Code Inspection -> Settings -> 要跳过的文件掩码 -> 添加 *.ts)

Rather than turning off Resharper, you could configure it to ignore analysing errors in *.ts files. (Tools -> Options -> Resharper Options -> Code Inspection -> Settings -> File Masks to Skip -> add *.ts)

通过这种方式,您仍然可以从对其他文件使用 Resharper 中受益,并且您还可以从使用 Resharper 的 TypeScript 中获得代码格式等方面的好处.

This way you still benefit from using Resharper for other files, and you also get the benefits of code formatting and the like for TypeScript using Resharper.

这篇关于Typescript 1.4:Visual Studio 中错误的语法高亮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆