Monday, September 10, 2007

Visual Studio Hyperlink to Code Addin

CodePlex - HyperAddin: A Visual Studio Addin which adds hyperlinking in your source code

"Visual Studio already had the ability to recognize and quickly navigate (with Ctrl LeftClick) to URLs embedded in the comments of the code. This is great, but what is really needed is a way of referring quickly and easily from one part of the code to another part of the code (or to architectural documents checked in with the code). That is exactly what the HyperAddin does: It makes creating and following hyper-links in your code trivial. Now you only have to explain something once in a comment and refer to it many times (got lots of overloaded methods? They should all refer to the 'master' that does the real work).

Hyperlinks in your source code are one of those features that once you have used it, you wonder how you ever got by without it. If you use Visual Studio, you really should try it. Anyone reading your source code (including yourself!) will thank you for it.

..."

vb:feeds - Hyperlink your source code -> Brad Adams - Hyperlink your source code

"...

Here are a few simple examples:

  • You can refer to a function or type (or any other symbol), but using code:name.  For example
        // In this comment I wanted to talk about the code:MethodTable::Unbox method.
// By Adding a code: hyperlink, readers can quickly navigate to it. Any name
// that can be found using the Edit.FindSymbol (Alt-F12) can be used. If you
// need to refer to an overloaded method, it is best to use an anchor (see below).


  • You can generate your own URL anchors by simply putting #name in the comment somewhere. For example.
        // #mytopic
//
// ...
// Somewhere else in the file you can refer to code:#mytopic. Now readers
// can quickly navigate to the #mytopic anchor.


  • Without further qualification, # anchors only work within a single  file. If you wish to refer to an anchor outside the current file (a common case), then you need to specify some programming symbol that is in the same file as your anchor.  For example:
        // I need to refer to #mytopic but it is not in the current file.  But I
// know that this anchor is related to the class 'MethodTable' and thus will
// be in the same file as that class definition by using code:MethodTable#mytopic
// I can refer to #mytopic anywhere in any code within the solution.

..."


That's pretty darn cool...


I really like the idea of being able to quickly navigate to specific code functions/methods/blocks/etc via easily added hyperlinks...

1 comment:

Anonymous said...

I’m a software architect last 10+ years, I always have been searching for a Add ins like this. Thank you very very much !!! I just now install it and it look that is works as is expected …great !!!