flesh
flesh

Reputation: 23935

Is there any way to 'hide' a JavaScript file from IntelliSense in Visual Studio 2008?

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?

Upvotes: 3

Views: 406

Answers (4)

AndreasKnudsen
AndreasKnudsen

Reputation: 3491

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(..).

Upvotes: 2

kimsk
kimsk

Reputation: 2231

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

$.getScript("XXX.js");

Upvotes: 1

Alan Oursland
Alan Oursland

Reputation: 727

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.

Upvotes: 9

z-boss
z-boss

Reputation: 17618

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.

Upvotes: 1

Related Questions