Visual Studio 2015中对es6(默认参数)的语法支持 [英] syntax support for es6 (default params) in visual studio 2015

查看:100
本文介绍了Visual Studio 2015中对es6(默认参数)的语法支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用javascript函数参数中的默认参数

I am trying to use the default parameters in the javascript function parameters

  var _BindAddNewPipelineButton = function(pipeId = undefined, enableEditMode = false) {

它无法识别正确的语法高亮并破坏了我的JavaScript文件.

Its not recognizing proper syntax highlighting and breaking my javascript file.

请让我知道任何可用的插件来支持这种突出显示

Please let me know any plugins available to support this kind of highlighting

不能看到语言服务.请看截图

Cant see the Language Service. Please see screenshot

推荐答案

对于VS2015:

打开工具>选项>文本编辑器> Node.js> IntelliSense,然后选择ES6 IntelliSense预览复选框.

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

也许您必须在执行此操作之前先安装TypeScript 1.6: https://github.com/Microsoft/nodejstools/wiki/ES6-IntelliSense-Preview-in-NTVS-1.1

Maybe you will have to install TypeScript 1.6 before doing this: https://github.com/Microsoft/nodejstools/wiki/ES6-IntelliSense-Preview-in-NTVS-1.1

对于VS2017:

您是否已选中启用新的JavaScript语言服务"(选项">文本编辑器">"JavaScript/TypeScript">语言服务")?

Have you checked 'Enable the new JavaScript language service' (Options > Text Editor > JavaScript/TypeScript > Language Service)?

由于性能问题,我一次禁用了此功能,而我也遇到了与您相同的问题.

I disabled this once because of low performance issues and I had the same problem as you.

这篇关于Visual Studio 2015中对es6(默认参数)的语法支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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