Search code examples
jqueryvisual-studiointellisensevisual-studio-2012javascript-intellisense

Intellisense doesn't work for JavaScript in Visual Studio 2012


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. I don't have the key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\JavaScriptLanguageService\ImplicitReferences in my registry. In fact, I don't even have JavaScriptLanguageService directory.

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

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

  4. 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 was unable to determine an accurate completion list for this expression, The provided list contains all identifiers in the file"


Solution

  • Kudos to CraigTP

    Summary:

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

    2. select Implicit (Web)

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

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

    4. add /// <reference path="path\jquery-1.7.1.js" /> in "_references.js"

      or /// <reference path="~\root\path\jquery-1.7.1.js" />

    Edit note:

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

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