Typescript 1.4: Wrong syntax highlighting in Visual Studio

前端 未结 3 1469
我在风中等你
我在风中等你 2020-12-20 11:40

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

I installed the new version for Visual Studio, however the syntax highlighting do

相关标签:
3条回答
  • 2020-12-20 12:11

    I was having a similar issue where Resharper was not recognizing the "const" keyword.

    I fixed this by explicitly telling Resharper what version of TypeScript to use. By default it is set to "auto detection".

    On the menu, go to Resharper > Options > Code Editing > TypeScript.

    Change the Type Script Language Level to "1.5 (experimental)"

    0 讨论(0)
  • 2020-12-20 12:13

    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)

    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.

    0 讨论(0)
  • 2020-12-20 12:13

    I've had the same issue, and for me it was Resharper that was causing the problem.

    If you have Resharper installed then simply disable it while working on TypeScript 1.4, at least until JetBrains releases an update with 1.4 support.

    To disable Resharper: Tools -> Resharper -> General -> Suspend

    0 讨论(0)
提交回复
热议问题