[英]Moving Visual Studio 2012 JavaScript Intellisense Markup to Separate File
I love the intellisense feature of Visual Studio, including the ability to generate my own XML markup for the methods I create. 我喜欢Visual Studio的intellisense功能,包括为我创建的方法生成自己的XML标记的能力。 However, sometimes the comments actually get in the way of seeing what I'm doing (especially when the method is a few lines long and the intellisense for it is three or four times longer than the code itself!)
但是,有时这些注释实际上会妨碍我看到我正在做的事情(特别是当方法长达几行时,它的智能感知比代码本身长三到四倍!)
Under Visual Studio 2012, it should be possible to move the intellisense markup to a separate file, adding .intellisense.js
to the end of the file name and placing the files in the same directory. 在Visual Studio 2012下,应该可以将intellisense标记移动到单独的文件中,将
.intellisense.js
添加到文件名的末尾并将文件放在同一目录中。 Unfortunately, I can't seem to get it to work. 不幸的是,我似乎无法让它发挥作用。
As an example, suppose the file module.js
contains the following code: 例如,假设文件
module.js
包含以下代码:
var module = (function (my) {
/// <summary>Description of the module</summary>
my.action = function(doThis) {
/// <summary>Take an action</summary>
/// <param type="String">Do this action</param>
/// <returns type="String" />
return doThis.toLowerCase();
}
return my;
}(module || {}));
I've tried creating a file in the same directory called module.intellisense.js
and moving the XML comments from module.js
into here: 我尝试在名为
module.intellisense.js
的同一目录中创建一个文件,并将来自module.js
的XML注释module.js
这里:
intellisense.annotate(module, {
'action': function() {
/// <summary>Take an action</summary>
/// <param type="String">Do this action</param>
/// <returns type="String" />
}
});
intellisense.annotate(window, {
'module': function() {
/// <summary>Description of the module</summary>
}
});
After saving the files, I hit Ctrl Shift J to force the intellisense to update, then give it a moment to think. 保存文件后,我按Ctrl Shift J强制智能感知更新,然后给它一点思考。 Afterward, when I type
module.action(
, I get no intellisense assistance. What needs to be done to make functional, custom external-file JavaScript intellisense in Visual Studio 2012? 之后,当我输入
module.action(
我没有得到intellisense帮助。 在Visual Studio 2012中需要做些什么来制作功能性的自定义外部文件JavaScript智能感知?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.