JavaScript Intellisense is not working in Visual Studio 2015 - javascript

I know there are ALLOT of duplicates to this problem on SO as well as all over the web. Unfortunately, nothing that was suggested is working. I've done everything with the exception of reinstalling VS'15 (Id rather not if I can help it).
One site I went to: The story behind _references.js and an interesting thing appeared (or rather it didn't) in the JavaScript Intellisense section of the Text Editor in options. The reference to the _references.js file was not there. However after adding this reference, there is still not intellisense.
Is there anything I can do to get my intellisense back?

After many hours of banging my head against my desk, I found the answer to this weird issue. Turns out that the bootstrap.min.js script was interfering with the JavaScript intellisense. So I just commented out the script in my _references.js file. Also, I changed the autosync to false and instantly the intellisense came back.

Try changing the order of plugin references in your _references.js file.
In my case it was the JQuery-UI which I needed to move above the main JQuery reference, as explained in this post: jQuery UI breaks Visual Studio 2015 Intellisense

Related

VS2013 - Web Essentials - "Update All Bundles" does not work

In visual studio 2013 (update 2 or 3) there is a web essentials menu option.
When choosing "update all bundles" from this menu, nothing happens.
Current work around, when i want my javascript to re-bundle i have to edit/save one of the js files.
Anyone know if there's a fix for this, or something i'm just not thinking of?
Just went through a similar problem and found that a developer had checked in an updated .bundle file with the XML formatted differently (they were using 2013). The new structure didn't have an output attribute and I had the same problem as the one you describe.
I put the xml back to how it was and it now builds with 2012 again, I'll try 2013 next.
I had a problem under Visual Studio 2012. The command was there, but Update all bundles wouldn't work, same on build.
Got the source code, debugged and found out that at least for the version I have (3.8) anything under ~/App_Data folder is skipped.
So I moved my bundles and files and it works like a charm now.

Visual Studio prompts me to check out javascript files

So today Visual Studio (2013/Update1) thought it would be amusing to do a checkout every time I open a Javascript file. It only happens with javascript files -- .css and .cs files in the same project work just fine.
I've tried diffing my project file in source control, and I don't see anything that would cause it (there are a lot of changes, because I just updated some nuget packages, but the changes all seemed to just be file includes for the swapped out .js libraries).
I've tried the obvious stuff, like rebooting and deleting my .suo file. For now, I guess it's just a nuisance, but I would like to fix it.
I am running Resharper 8.1, if that could have anything to do with it.
It appears that the latest Web Essentials update, 1.8, has fixed this issue.
This seems to be the bug we were experiencing: https://github.com/madskristensen/WebEssentials2013/issues/596

Visual Studio 2010-intellisense and highlighting in javascript doesn't work

In one of my solutions in javascripts files the intellisense suddenly stopped working.
All of the features are disabled - ctrl+space doesn't bring the list - like this
I took the print screen from another solution
and also the file looks like it was plain text -keywords has no colors.
I tried to open new solution and move the files there - still the same.
Files has intellisense only when I am debugging.
It feels like VS2010 see that those files are text files instead of js files.
It has something to do with tfs because it first happened to another member of the team and as soon as I took latest version of the solution - it happened to me.
When I create new js file - it looks fine , BUT after saving
the file , closing and reopen - again it is not colored
I found out that the problem is in one specific project - if I add js files to another project in the same solution it seems to be ok.
After some research and tests. This problem could be a couple of things:
Your file's extension is not .JS.
You are using an express edition.
You have not installed the Web Developer component on your installation (or removed it).
Let me know if this help you, If not I will look forward something else.
The complete reference about the JScript Intellisense on msdn:
http://msdn.microsoft.com/en-us/library/vstudio/bb385682(v=vs.100).aspx
As you can see in the image below, I just created a single javascript file in my Visual Studio 2010 with Web developers components and it is working:
So I solved this problem ....
I wanted to watch some value with QuickWatch (Shift+F9)
I got the message "Unable to evaluate the expression. The object invoked has disconnected from its clients." I pressed the green icon to refresh the values. After I closed the QuickWatch window I realized that I got the intellisense and highlighting back.
After a checkin to TFS, my colleague pulled the solution and got the intellisense and highlighting back as well.
Probably some weird bug in VS2010.

Eclipse Indigo with Aptana Studio 3 - Code hinting doesn't work when Dojo libraries are local

I've just setup Eclipse with Aptana Studio 3 and have been trying to get code completion / code hinting / autocomplete to work with mixed results.
I've followed the instructions here: http://wiki.appcelerator.org/display/tis/JavaScript+Library+Support
What I have discovered through testing is that when you install the .sdocml file and nothing else in a new project, it works fine.
As soon as I add a local copy of Dojo into the project the code hinting no longer works correctly.
I tried excluding the directory from view with a filter but that excludes it from the server so you can't use it. I've also tried removing the Dojo folder from Indexing but that changes nothing either.
If I load Dojo from a CDN, like Google, then I can use code completion.
The issue is that Eclipse picks up a parsed reference to dojo instead of the one from the sdocml file.
The problem seems, so far, to be confined to typing 'dojo.' but 'dijit.' and 'dojox.' work okay, maybe because of the parent-child relationship between those sub-libraries, if I were to guess.
I don't know if this is an Aptana bug or an Eclipse bug, but either way, it's a problem.
Does anyone know how to prioritize the code hinting sources and / or exclude certain directories from being a hinting source? Or is there another solution?
Thanks in advance,
Ken
Edit: Now that I have more code in the test project hinting does not work at all for 'dojo.' but still works fine for 'dojox.' and 'dijit.'. Only native JS methods hinting is available as a subset of 'dojo.'

Adding additional js files breaks jQuery IntelliSense

I have been using jQuery IntelliSense in VS2008 and it has been great. Recently I added a reference to jQuery UI and since then, the jQuery IntelliSense has went away. I found that once you reference another .js file in your document, the IntelliSense goes away. Any way to avoid this?
If there are errors in any refernced files it will break intellisense for all files references from the same document. The next version of Visual Studio is going to be much more robust in this respect. I apologize directly for this fragility. We made some design decisions early on that we prevented us from making VS9 external references more robust.
In the meantime, use the following workaround. Install SP1 from the link Slace gave you. If you have a reference a file named .js and there is a file named -vsdoc.js in the same location, then JS intellisense will pick up the -vsdoc version. If that script is empty then it won't generate an error. Identify the jquery plugin that is causing intellisense generation to fail and place a -vsdoc version next to it. You won't get intellisense for UI, but you will still get jquery and other plugins that do work.
Anything you put in the vsdoc version will show up in intellisense. You could put spoofed versions of the data structures that you want to display in intellisense if you want to.
It's likely that there's a bug in one of the subsiquiently referenced JavaScript files. Open your JS file and once the "Updaing JavaScript Intellisense" has gone from the status bar of Visual Studio (there is a menu option which will force the JS intellisense to refresh, don't remember where it is, I just created a keyboard shortcut via the Tools -> Options -> Keyboard area) open up your Errors window and under the Warnings you should find the reason why the intellisense has failed to load.
It's generally a bug found when parsing one of the files but I have had stack overflows when I had a lot of files referenced.
Edit: You also should make sure you have this VS patch installed: http://code.msdn.microsoft.com/KB958502 and VS 2008 SP1 (install SP1 first!). Then you just need to have:
/// <reference path="/path/to/jquery-1.3.1.js" />
Ensure that you maintain the -vsdocs on the intellisense file and it will be automatically picked up (as long as it's in the same folder as the file you reference)
The accepted answer helped me fix this issue but didn't resolve the problem. I installed the hotfix: http://code.msdn.microsoft.com/KB958502 but was still receiving an error.
Error:
Error updating JScript IntelliSense: D:\Dev\Test\Scripts\jQuery-1.3.2-vsdoc.js: 'jQuery.support.htmlSerialize' is null or not an object # 1430:4
It appears the addition of the follwing file without the appropriate -vsdoc.js file causes the above issue.
<script src="../../Scripts/jquery-ui-1.7.custom.min.js" type="text/javascript"></script>
I added an empty file "jquery-ui-1.7.custom.min-vsdoc.js" to my scripts folder and the Jscript Intellisense issue went away.
I'd like to present a slightly better solution. A few months ago I tackled this problem and created a very basic vsdoc file for jQuery UI. Here's the link to the blog post (which has the file for download).
I solved this per the advice above with a minor extension: the trick for me was to add a reference on my page to both my jqueryui.com library AND to the blank -vsdoc.js version of the file I created:
<script type="text/javascript" src="../../Scripts/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="../../Scripts/jquery-ui-1.7.2.custom.min-vsdoc.js"></script>
Hope this helps!
Great, the tweak is by creating an empty *-vsdoc.js file for each troublesome *.js files.
I found this error caused by anonymous function e.g. like this:
(function($) {
$.anything...;
})(jQuery);
Hope this caused will help somebody creating the http://code.msdn.microsoft.com/KB958502 and JScript IntelliSense Team.

Categories