views:

288

answers:

4

I have a third party JavaScript plug-in but including the file breaks IntelliSense for jQuery amongst other things. The only way I can get IntelliSense back working with jQuery is by commenting out the plug-in. Is there a way I can hide the plug-in file from the IntelliSense parser?

+2  A: 

You could always load it from your code-behind instead of the scriptmanager in your aspx/master. That way the IntelliSense doesn't know it's there. Using ScriptManager.RegisterClientScriptInclude(..).

AndreasKnudsen
+1  A: 

It could be that third party JavaScript plugin you're using has some errors in it.
I would check the code in JSLint and directed this question to the author of the plugin.
As for the question itself: I don't think you can exclude it if it's a part of the project, but go over the MSDN: Using IntelliSense to prove it.

z-boss
it does and i have :)
flesh
+9  A: 

Service Pack 1 added the following feature:

If you "anyfile.js" and "anyfile-vsdoc.js" in the same directory, then any references to "anyfile.js" will automagically be converted to a reference to "anyfile-vsdoc.js" behind the scenes.

Add an empty file next to your plugin with "-vsdoc" appended to the filename. That should "hide" the plug-in from the external javascript processor.

Alan Oursland
yep that did it, thanks
flesh
+1  A: 

Since you mentioned jQuery, you could also load the troublesome script during runtime.

$.getScript("XXX.js");

kimsk