Intellisense 不适用于 Visual Studio 2012 中的 JavaScript [英] Intellisense doesn't work for JavaScript in Visual Studio 2012

查看:21
本文介绍了Intellisense 不适用于 Visual Studio 2012 中的 JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个干净的、开箱即用的 Visual Studio 2012 Web Developer Express 安装,由于某种原因,对 JavaScript(jQuery、jQuery UI 和其他库)的支持已经消失.我相信它之前有效,然后无缘无故"地停止了.

I have a clean, out-of-the-box installation of Visual Studio 2012 Web Developer Express and for some reason the support for JavaScript (both jQuery, jQuery UI and other libraries) has disappeared. I believe it worked before and then for "no reason" it stopped.

我已按预期浏览网页并发现了四个差异.

I've browsed the web as supposed to and discovered four discrepancies.

  1. 我的注册表中没有密钥 HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0JavaScriptLanguageServiceImplicitReferences.事实上,我什至没有 JavaScriptLanguageService 目录.

  1. I don't have the key HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0JavaScriptLanguageServiceImplicitReferences in my registry. In fact, I don't even have JavaScriptLanguageService directory.

我已经检查过引用的文件 domWindows.js 确实是选项指向的位置.

I've checked that the referred file domWindows.js indeed is where the options point to.

JavaScriptLanguageService 下的输出窗口是空的,在我开发和运行应用程序时没有在那里输入任何内容.

The output window under JavaScriptLanguageService is empty and nothing is being typed there while I develop and run my application.

我已经通过选项引用了我正在使用的 jQuery 文件,但它没有产生任何更改.

I've referred to the jQuery-file that I'm using through the options but it didn't produce any changes.

总而言之,我收到错误消息:

All in all I get the error message saying that:

intellisense 无法确定此表达式的准确完成列表,提供的列表包含文件中的所有标识符"

"intellisense was unable to determine an accurate completion list for this expression, The provided list contains all identifiers in the file"

如有任何建议,我们将不胜感激.

Any suggestions would be warmly appreciated.

推荐答案

感谢 CraigTP

总结:

  1. 导航到 [工具] > [选项] > 文本编辑器 > JavaScript > IntelliSense > 参考选项

  1. navigate to the [Tools] > [Options] > Text Editor > JavaScript > IntelliSense > References options

选择隐式(Web)

你可以找到~/Scripts/_references.js"(如果你想把它放在不同的地方,在这里改变它)

you can find "~/Scripts/_references.js" (if you want to put it in different place, change it here)

转到 ~/Scripts 并添加新项目_references.js"

go to ~/Scripts and add new item "_references.js"

在_references.js"中添加///

add /// <reference path="pathjquery-1.7.1.js" /> in "_references.js"

or ///

快乐编码:)

编辑备注:

记得把jquery-1.7.1-vsdoc.js和jquery-1.7.1.js放在同一个文件夹

Remember to put jquery-1.7.1-vsdoc.js in the same folder with jquery-1.7.1.js

进行上述更改后,如果仍然无法正常工作,请尝试重新启动visual studio.

After making above mentioned changes, if it is still not working try restarting visual studio.

这篇关于Intellisense 不适用于 Visual Studio 2012 中的 JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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