Difference between *.intellisense.js and entry in _references.js - javascript

I've noticed in Visual Studio 2015 that, when creating a new ASP.NET MVC Web project, it automatically adds a jquery-1.10.2.intellisense.js file. Reading Microsoft's documentation on *.intellisense.js files provided me no clarity, and I'd like to know what this really does. If it adds intellisense into Visual Studio, then how is it different from the /// <reference path="jquery-1.10.2.js" /> entry in _references.js?

The _references.js file would give the user intellisense for what's in that file, which would be function names and signatures (parameter names).
The intellisense file contains additional XML comments that Visual Studio can read to give the user more information. E.g., it can add a ///<summary></summary> line to summarize the function, a list of ///<param name="">description</param> to give additional information for parameters, etc.
Since not all people use jQuery in a Visual Studio Environment, the intellisense file was created later after VS added in better support for JavaScript.
Here's an example of creating JavaScript XML comments for VS intellisense: https://msdn.microsoft.com/en-us/library/bb514138.aspx

Related

Visual Studio: Cleaning up abandonent javascript functions

I have a web application in visual studio, it has several JavaScript, jQuery files, third libraries and custom files.
I am looking for any tool which will help me remove methods are not called anywhere. This is for custom code files added by another coder.
Current Approach
Copy function name - search for it, and remove methods manually.

Reference javascript files to use visual studio 2010 intellisense

I have a website with very heavy (long javascript > 100KB + JQuery). So, for making the javascript re-useable, I want to separate the logic in different javascript files.
So, I want to make an aggregated javascript file
Please tell me how (I even want to use the VS2010 intellisense in my main JS file about the functions of the other JS files.)
Javascript Intellisense tends to be extremely unreliable as some updates broke it some updates fixed it, and there are a lot of extensions around it, breaking each other.
Still there is a /// <reference> element for cases like this.
See MSDN article and add line:
/// <reference path="otherscript.js" />
at the top of your script file.
Try to test it with the jQuery vsdoc and your other script files.
Also installing MVC4 installed some dependency or whatever that more-or-less fixed javascript intellisense for me.
I would recommend Resharper: http://www.jetbrains.com/resharper/whatsnew/
You can separate your Javascript files and use SquishIt to concatinate and compress/minify them all into one single file to reduce the file size and the number of requests.
I don´t know of any solution that allows you to work in both the concatinated file as well as each separated file ...and I don´t understand why anyone would want to.
IMO, Visual Studio has a quite poor intellisense for Javascript.

How to comment for ReSharper so Intellisense displays documentation?

I want to see my methods' documentation when I use CTRL-space on a method name while coding.
How should I format comments in my JavaScript methods and classes for re#er?
ReSharper 6 added support for JavaScript, CSS and HTML. ReSharper is using the same XML documentation annotations that are driving the JavaScript IntelliSense in Visual Studio. The XML format is an extension of the format that C# and VB.NET are using so it should look familiar to .NET developers. The main differences are the additional attributes that have been added to convey the (optional) type information that is not provided by the language itself and the place where those comments are written.
For more information take a look at these pages:
The format for JavaScript doc comments
VS 2008 JavaScript Intellisense
AjaxDoc: Generates documentation for JavaScript script libraries

Generate Javascript intellisense file for a .NET Class

I have a .net control which is intended for use as an ActiveX control in web pages, instantiated thus:
<object id="TheControl" name="TheControl" classid="clsid:012937D0-E1D8-4a80-A17F-DEADBEEFF00D"></object>
Is there a way to take the XML documentation generated by Visual Studio for TheControl and transform it into a .js file that Visual Studio could then consume to provide intellisense for an instance of the control in a page?
You would either have to use .NET Reflection to get a list of all properties and methods, or write an XML parser tool to get the same list, and then generate .JS source code from it.
I think both of these would take about the same effort to write, but the Reflection approach can also be used with just the ActiveX file- if you don't have Visual Studio handy to generate the documentation XML.
If all you want is an "empty shell" .JS file for the properties and methods, then the code in this article should provide a good basis:
http://www.codeproject.com/KB/dotnet/Reflection.aspx

How can I get Aptana's code assist to work with Google Maps API v3?

There's a Google Maps API v3 Visual Studio Intellisense Helper, which presumably works great for Visual Studio, but Aptana (based on Eclipse) uses a different JavaScript documentation format - ScriptDoc (.sdoc files). ScriptDoc is also the name of a VS utility to convert JS files with Intellisense comments into XML, just to confuse things.
I've tried adding the Intellisense files as file / global references in Aptana, but all this gives is completion for the word google and no completion or documentation in the google namespace.
Possible solutions:
Find someone who's already done this for Aptana. I've Google'd quite a bit already but couldn't find anything.
Convert the Visual Studio Intellisense Helper into a format Aptana can understand.
Scrape the API page and convert it into a format Aptana can understand.
Can't you put the JS file in the Project's references ?
I'm using Aptana and ScriptDoc is the worst decision they made and they seem to be attached to it, it's the main reason I have considered switching to Eclipse.
I've been thinking in using jsdoc-toolkit to generate .sdoc files from jsdoc notations (using some type of templates), but to use .sdoc files you must insert #id tags all over your code, and that discouraged me.
This helper is for Visual Studio. I don't think Aptana can work with vsdoc.js files
Aptana Plugin for Eclipse and jQuery code assist
I found this and I'm checking if it helps
http://code.google.com/p/closure-compiler/source/browse/#svn%2Ftrunk%2Fcontrib%2Fexterns%2Fmaps

Categories

Resources