简体   繁体   English

VS 2013中的Intellisense用于JavaScript AMD模块

[英]Intellisense in VS 2013 for javascript AMD modules

I'm trying to start programming with Durandal and AMD modules in VS 2013. In c# I'm using intellisense heavily and I would like to use it also in AMD modules. 我试图在VS 2013中开始使用Durandal和AMD模块进行编程。在c#中,我大量使用了intellisense,并且也希望在AMD模块中使用它。 Is there any way to enable this in VS 2013? 有什么方法可以在VS 2013中启用它吗? I have already tried this approach http://landofjoe.com/blog/ill-take-my-durandal-with-intellisense-please but it works only in VS 2012. 我已经尝试过这种方法http://landofjoe.com/blog/ill-take-my-durandal-with-intellisense-please,但仅在VS 2012中有效。

Unfortunately, no. 抱歉不行。 You would have to modify the require.intellisense.js file yourself to get it to work. 您必须自己修改require.intellisense.js文件才能使其正常工作。 This fellow that answered the question linked here seems to have gotten it to work for himself. 回答了此处链接的问题的那个人似乎已经开始为自己工作了。

I've just made intellisense work with Durandal and all other stuff in Visual Studio 2013, Update 5 , after reading this blog post , though it should work with Update 4 too. 阅读此博客文章后 ,我刚刚在Durandal和Visual Studio 2013 Update 5中的所有其他内容上进行了智能感知,尽管它也应该与Update 4一起使用。

Delete that require.intellisense.js from your project, add _references.js if you don't have one into your Scripts folder put into the first line this: 从您的项目中删除那个require.intellisense.js ,如果您的Scripts文件夹中没有_references.js ,请将其添加到第一行:

   /// <reference path="require.js" start-page="/index.html" />

Of course reference path should be correct for your case. 当然,参考路径应适合您的情况。

That's it! 而已! Now you should have intellisense working. 现在您应该具有智能感知功能。

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

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