Javascript and VS2012 Intellisense

人盡茶涼 提交于 2019-12-12 04:14:27

问题


I am new to Visual Studio 2012 and Javscript coding. I have two questions i could not find answers on the web:

  1. i have a webforms project and added some js-files to the sript-folder (http://raphaeljs.com/). Now i want to have Intellisense support for that js-library i added. Is that possible?

  2. for what is the "_references.js" file in the scripts folder? I added all the js-library files to that file but it doesn't enable intellisense.

regards


回答1:


I'm not sure about Visual Studio 2012, but in 2010, if you drag one JavaScript file onto another one it will add a /// <reference name="MyScript.js" /> line at the top of the second file. If the file being referenced is documented you will get quite useful intellisense, though it is still handy even if not for just being able to explore the surface of the API.

There is some good information in this question: IntelliSense for Ajax and JavaScript libraries in Visual Studio




回答2:


To put it short, Visual Studio is terrible at intelli-sense for javascript. It is still light years behind other IDEs like IntelliJ & WebStorm.

A work around to slap it in line would be to use ReSharper which is a plugin but you need to pay for the license :(

Hope that helps.



来源:https://stackoverflow.com/questions/12769258/javascript-and-vs2012-intellisense

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!