Question

I will start by first asking 2 questions so If anyone knows it doesn't have to read this long post:

  1. But how do I suppress enormous list of undesired items in IntelliSense list for a custom JavaScript file (be it .js or .ts - typescript with compilation)?
  2. How can I fine control what I would need? _references.js seems like a good starting point (for global reference)
  3. Can anybody explain how .validate-vsdoc.js and .intellisense.js and ///

When I watched Mads Kristensen's video Visual Studio: C# class Intellisense in JavaScript/TypeScript
I noticed that Mads' Intellisense for his "data" JavaScript variable shows a nice, short list of objects, functions and properties relating to the current context.
JavaScript Intellisense Mads Kristensen

I use defaults from VS 2013 MVC project.
Mine shows a much longer list making Intellisense almost useless: JavaScript Intellisense Mine

In my _references.js I have this (which Mats I suppose have as well)

/// <autosync enabled="true" />
/// <reference path="modernizr-2.6.2.js" />
/// <reference path="jquery-1.10.2.js" />
/// <reference path="bootstrap.js" />
/// <reference path="respond.js" />
/// <reference path="jquery.validate.js" />
/// <reference path="jquery.validate.unobtrusive.js" />
/// <reference path="rads.js" />
/// <reference path="../models/accountviewmodels.cs.js" />

In my JavaScript IntelliSense References section for Implicit (Web) Reference Group I have defaults:

libhelp.js
sitetypesWeb.js
domWeb.js
underscorefilter.js
showPlainComments.js
~/Script/_references.js

All files (except _references.js) are located in this folder (nothing significant about them):

C:\Program Files (x86)\Microsoft Visual Studio 12.0\JavaScript\References\

As you can see from the second image I am getting some method IntelliSense from these files:

Dhtml.js
EcmaScript.js
ecma.js

But where do these properties and methods come from:

$1, $2, ..., $10
ABORT_ERR, ALIASED_LINE_WIDTH_RANGE, ....

When searching the Internet I found Google closure-compiler's file: webgl.js which contains many of these upper cased properties.

I know that JavaScript IntelliSense article talks about how JavaScripts IntelliSense lists the objects, functions, properties, and parameters that are available based on your current context and Extending JavaScript IntelliSense article talks about extending IntelliSense further.

  1. But how do I suppress enormous list of undesired items in IntelliSense list for a custom JavaScript file (be it .js or .ts - typescript with compilation)?
  2. How can I fine control what I would need? _references.js seems like a good starting point (for global reference)
  3. Can anybody explain how .validate-vsdoc.js and .intellisense.js and ///

I am MAD when I see Mads is doing good :) Thanks, Rad

Was it helpful?

Solution

I guess this has something to do with the ReSharper extension and its IntelliSense settings which override Visual Studio's IntelliSense settings.

dhtml.js, for example, is an internal ReSharper file where all standard browser objects and properties are declared. At lest the top X properties/methods in your IntelliSense dropdown dialog are picked up from this file.

OTHER TIPS

Do you have ReSharper installed by any chance? If so try the following steps

  1. Disable javascript intellisense in the ReSharper options dialog.

  2. Explicitly enable Visual Studio's javascript intellisense. (ReSharper would have disabled this option by default).

  3. Restart Visual Studio.

You should now have concise and compact intellisense hint lists.

To improve your intellisense experience, open solution explorer and add a new js file '_reference.js' to the scripts folder. Open this file (with VS), right click anywhere and enable the autosync option.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top