Dynamic help

I had an attendee come up to me today asking if they could talk to someone from VS-Core. 'Core' is the name that we use for the team that is responsible for the VS infrastructure that is shared amongst all languages. An example of this would be the editor. While the C# team is responsible for the C# editing experience, we fulfill that experience by sitting on top of the interfaces provided by Core. Of course, this isn't a hard rule. The debugger is shared by all languages, however they're contained with the C# team.

He was happy with VS as a whole, but wanted to give some critical feedback about Dynamic Help. The basic problem was that while he used (and liked) DH he didn't like how having it open could affect the start-up time of VS. I agreed that that sort of a delay is quite frustrating and that we should work hard to fix up that issue. I also pointed him to Stephanie (a PM on the Core team) to let him talk to her directly about these issues

It got me thinking and had me start asking attendees what they used DH for. It turns out that big part of it is to get information about the structure of a class. I.e. if they type: "IList list", then they'll get the help on IList (using DH) so that they can know all about that class in a way that completion lists fail. They can see all the information at once, rather than just 8 lines as a time. They can see inheritance relationships and casts. They can see all the docs at once rather than method by method.

Well, it turns out that we've added something into the C# editing experience to help accomplish all these needs. It's called the "Code Definition" window and it works like this: When your cursor is on a identifier we automatically determine the definition of that identifier and we show the code where that thing is defined in this window. For example of you have:

 
IList snarf;
//lots of code
Console.WriteLine(snarf);

If you then have your cursor on the 'snarf' identifier in the last line, then the code definition window will show the source code for this file centered on the line containing 'IList snarf'. So right then and there you know what snarf is.

Another case is where you have your cursor on 'IList' in the case above. We'll then show you the code for IList in the definition window. Now, chances are you don't have the source code for IList, so what we'll do instead is take the metadata for System.Collections.IList and we'll convert it into pseudo-C#. We'll even take the XML doc comments and we'll insert it above all the class/method definitions. I call is pseudo-xml because while it's grammatically correct, it's uncompilable. For example, say you're looking at the definition of ArrayList. We'll spit out something like:

 
public class ArrayList : //some bases and interfaces
{
      //lots of stuff

      int Count { get; set; }

      //lots of stuff
}

i.e. we'll spit out the signatures of methods, but not the bodies (although that would be a fun project decompiling IL).

Having this capability seemed to meet all the needs of how people tended to use DH. The places where it doesn't are when you want help to stay up in a separate window and you don't want it to change when you move around in your file. It also doesn't help when you are looking for things that are help only (like examples). So I was wondering how people here felt about DH. Do you love it/hate it? Either way, why? I'll work on getting some images up of the Code Definition window, but before i do that, feel free to give me some thoughts on if you like the idea, or are looking for something else.