Visual Studio 2012 JavaScript智能感知不起作用 [英] Visual Studio 2012 JavaScript Intellisense Not Working

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

问题描述

我的笔记本电脑和台式机上安装了Visual Studio 2012。在我的桌面PC上,JavaScript intellisense无效。对于它提出的任何方法(即使是标准的JavaScript调用),我收到消息,Intellisense无法确定此表达式的准确完成列表。

I have Visual Studio 2012 installed on my laptop and desktop. On my desktop PC, the JavaScript intellisense is not working. For any method it pulls up (even standard JavaScript calls) I receive the message, "Intellisense was unable to determine an accurate completion list for this expression".

我已经尝试了其他帖子中的所有建议,并尝试了我在Google上找到的所有内容。没有任何效果。它不是没有JQuery Intellisense。我甚至没有得到基本的JavaScript Intellisense。

I've tried all of the suggestions from the other posts and tried everything I could find on Google. Nothing has worked. It isn't about not having JQuery Intellisense. I don't get even basic JavaScript Intellisense.

编辑:

< img src =https://i.stack.imgur.com/oQo8E.jpgalt =我发布了一张图片,但作为新用户,它不会让我。>

上图中的对象很简单字符串,但我没有从Intellisense得到任何帮助。

The objects in the above images are simple strings, yet I don't get any help from the Intellisense.

推荐答案

我有同样的问题:在Visual Studio 2010中我用于在我的javascript文件中添加引用,在顶部,如下所示:

I had the same problem: in Visual Studio 2010 I was used to add a reference in my javascript files, at the top, like this:

/// <reference path="/scripts/jquery-1.7.1-vsdoc.js" />

随着新的Visual Studio 2012不再适用,我环顾四周找到了解决方案/scripts/_references.js中的引用我这样做了,没有工作。

With the new Visual Studio 2012 this was not working anymore, I looked around and found the solution to put the reference in /scripts/_references.js I did so, not working.

我在做什么错误是我引用vsdoc.js文件,或者在编写本文时,nuget下载了jquery 1.9.1包,引用了jquery-1.9.1.intellisense.js,这是错误的。

What I was doing wrong was that I was referencing the vsdoc.js file, or at the moment of writing, nuget downloaded jquery 1.9.1 package, reference to jquery-1.9.1.intellisense.js which is WRONG.

正确参考(如果使用/scripts/_references.js文件)是:

The correct reference (if using the /scripts/_references.js file) is:

/// <reference path="/scripts/jquery-1.9.1.js" />

(不是.intellisense.js或-vsdoc.js文件)

对于适用于所有项目的全局解决方案:复制所有jquery文件(main,minified,map和intellisense) ,确定)在C:\Program Files(x86)\ Microsoft Visual Studio 11.0\JavaScript\References(如果您在其他地方安装了Visual Studio 2012,则调整路径)和Visual Studio中的工具>选项>文本编辑器> Javascript>智能感知>参考>添加对jquery-1.9.1.js的引用(再次,不是vsdoc或intellisense文件,但是主要文件),如解决方案由denas (但没有明确表示不指出vsdoc / intellisense文件)。

For the global solution to work on all your projects: copy all the jquery files (main, minified, map, and intellisense one, to be sure) in C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References (adapt the path if you installed Visual Studio 2012 somewhere else) and in Visual Studio, under Tools > Options > Text Editor > Javascript > Intellisense > References > Add a reference to jquery-1.9.1.js (again, NOT the vsdoc or intellisense file, but the main one) as explained in the solution by denas (but it was not clearly said not to point the vsdoc/intellisense file).

希望这有帮助。

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

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