views:

577

answers:

3
function Submit_click()
{
  if (!bValidateFields())
    return;
}

function bValidateFields() {
/// <summary>Validation rules</summary>
/// <returns>Boolean</returns>
...
}

So, when I type the call to my bValidateFields() function intellisence in Visual Studio doesn't show my comments. But according to this it should. Should it?

A: 

Did you try adding the /// <reference> comment at the top of the external library? I've run into this in the past and it resolved my issue.

SaaS Developer
Actually, you should only need this when the function you are calling is outside your current .js file.
SaaS Developer
+1  A: 

I recall an issue where having turned off the Navigation Bar in VS stopped a lot of the JS intellisense from working properly. If you have it turned off, try turning the Navigation Bar on again and see if it helps.

Edit: You may also have to do Ctrl+Shift+J to force the IDE to update the intellisense.

Edit2: As @blub said, if there are any issues with the javascript, the intellisense can break. Visual Studio actually evaluates the javascript to create the intellisense, so if there are syntax errors it can fail and not build the intellisense completely, or at all.

Geoff
JS is good, no errors. Navigation Bar is turned on (won't show up in JS files though, only in ASPX and CS). Both functions in the same file. But intellisence still doesn't work. :(
z-boss
How does one turn on the Navigation Bar in jscript files? It's grayed out in jscript on my machine.
Matthew Lock
The Navigation Bar isn't actually used for javascript, but for some reason it must be activated for intellisense to work right. Tools->Options->Text Editor->All Languages. There was a recommendation to turn the Nav bar off to increase visual studio peformance.
Geoff
+1  A: 

The XML comments have to be inside the function, not above it. In Visual Studio 2008, the XML comment information is only display for files referenced with a /// <reference... item.

Visual Studio 2010 will display XML comment information for functions in the file your are editing and for files you are referencing.

Alan Oursland