[英]Javascript reference and Intellisense in Visual Studio 2013 .coffee files
Just started using Web Essentials and love its support of .coffee files. 刚开始使用Web Essentials并喜欢它对.coffee文件的支持。 Big problem however: In Visual Studio, if you add the following reference to the top of a .js file, Visual Studio will include intellisense for the items in the referenced file:
但是,最大的问题是:在Visual Studio中,如果将以下引用添加到.js文件的顶部,Visual Studio将在引用文件中包括项目的智能感知:
/// <reference path="../../js/knockout-3.1.js" />
So, while writing my code I can type something like ko.
因此,在编写代码时,我可以输入类似
ko.
and intellisense shows me all the functions knockout has to offer. 而intellisense向我展示了淘汰赛必须提供的所有功能。
However the above XML reference is not allowed in .coffee files and in fact keeps them from being compiled. 但是,.coffee文件中不允许使用上述XML参考,并且实际上使它们无法编译。 I can put the following in a .coffee file:
我可以将以下内容放入.coffee文件中:
# @reference ../../js/knockout-3.1.js
This will compile but I lose the intellisense in Visual Studio. 这样可以编译,但是我在Visual Studio中失去了智能。
How can I "include" other .js files as a reference and trigger intellisense in a .coffee file? 我如何“包含”其他.js文件作为参考并在.coffee文件中触发智能感知?
This is not currently supported. 当前不支持此功能。
See this stack overflow question: CoffeeScript Intellisense 看到以下堆栈溢出问题: CoffeeScript Intellisense
Also see this suggestion from web essentials: https://webessentials.uservoice.com/forums/140520-general/suggestions/3782958-coffeescript-intellisense 另请参阅以下来自网络基本知识的建议: https : //webessentials.uservoice.com/forums/140520-general/suggestions/3782958-coffeescript-intellisense
I use VS2015. 我使用VS2015。 The way i do it is update the "references.js" file (right click on that file and click update) see screenshot
我这样做的方式是更新“ references.js”文件(右键单击该文件,然后单击“更新”), 请参见屏幕截图
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.