当前位置: 动力学知识库 > 问答 > 编程问答 >

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

Does anyone know how to make VS 2015 play nice (both in syntax highlighting, intellisense, etc) with ES6?

I also modified the file extension to be .JSX and .ES6 in case that would help VS pick up on it. No luck...

网友答案:

If you want IntelliSense for ES6 in a nodejs project, then you need to turn on a particular setting.

Open Tools → Options → Text editor → Node.js → IntelliSense and select the ES6 IntelliSense Preview checkbox.

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.

网友答案:

@Shawn, in order to enable the Node.js options (and ES6 IntelliSense) you need to install the Visual Studio NodeJS Tools: https://www.visualstudio.com/en-us/features/node-js-vs.aspx

分享给朋友:
您可能感兴趣的文章:
随机阅读: