简体   繁体   English

Visual Studio 2015 - Javascript ES6无法正常工作

[英]Visual Studio 2015 - Javascript ES6 not working

I am playing around with VS 2015 JavaScript/NodeJS IDE and I plan to use ES6 as the language style for JavaScript, however I am noticing that Visual Studio is not recognizing the ES6 (even though I read on various web sites that VS should recognize ES6). 我正在玩VS 2015 JavaScript / NodeJS IDE,我打算使用ES6作为JavaScript的语言风格,但是我注意到Visual Studio没有识别ES6(尽管我在各种网站上看到VS应该识别ES6 )。

Does anyone know how to make VS 2015 play nice (both in syntax highlighting, intellisense, etc) with ES6? 有谁知道如何让VS 2015与ES6一起玩得很好(在语法高亮,智能感知等方面)?

ES6-错误

I also modified the file extension to be .JSX and .ES6 in case that would help VS pick up on it. 我还修改了文件扩展名为.JSX和.ES6,以防有关VS接收它。 No luck... 没运气...

If you want IntelliSense for ES6 in a nodejs project, then you need to turn on a particular setting. 如果您想在nodejs项目中使用IntelliSense for ES6,则需要打开特定设置。

Open Tools → Options → Text editor → Node.js → IntelliSense and select the ES6 IntelliSense Preview checkbox. 打开工具→选项→文本编辑器→Node.js→IntelliSense,然后选择ES6 IntelliSense Preview复选框。

In the December 2015 version of the tools, there is a link to additional notes about the prerequisites, such as having to install TypeScript for Visual Studio 2015 so that ES6 IntelliSense works. 在2015年12月版的工具中,有一个指向前提条件的附加说明的链接,例如必须为Visual Studio 2015安装TypeScript才能使ES6 IntelliSense正常工作。

@Shawn,为了启用Node.js选项(和ES6 IntelliSense),您需要安装Visual Studio NodeJS工具: https//www.visualstudio.com/en-us/features/node-js-vs.aspx

Try install TypeScript for Visual Studio 2015 and restart VS2015. 尝试为Visual Studio 2015安装TypeScript并重新启动VS2015。 https://www.microsoft.com/en-us/download/details.aspx?id=48593 https://www.microsoft.com/en-us/download/details.aspx?id=48593

I resolve many problem with this. 我解决了很多问题。

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

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