<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx</link><description>A few years ago now, several of us on the .NET Runtime team where lamenting how unapproachable the code base was for new developers to the team. We agreed that more commenting would certainly help the situation, but that alone was not enough, because</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4670929</link><pubDate>Fri, 31 Aug 2007 18:29:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4670929</guid><dc:creator>Peter Ritchie</dc:creator><description>&lt;p&gt;That sounds very useful. &amp;nbsp;More useful still would be to automatically make hyperlinks of words (either within a fully-qualified name or without a namespace) in comments that match types in the current project.&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4683709</link><pubDate>Sat, 01 Sep 2007 11:03:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4683709</guid><dc:creator>ZivC</dc:creator><description>&lt;p&gt;Very nice. Any plans on getting this integrated with csc /doc and SandCastle?&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4743282</link><pubDate>Tue, 04 Sep 2007 19:53:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4743282</guid><dc:creator>vancem</dc:creator><description>&lt;p&gt;Making hyperlinks automatically is an interesting addition, but I am skeptical of it without some sort of marker that indicates the intent that it is a hyperlink. &amp;nbsp;Part of what make hyperlinks useful is the knowledge that someone thought it was useful to create the link. &amp;nbsp; When you add them automatically you loose this. &amp;nbsp; &amp;nbsp;I think a good compromise is a one character marker (eg #), that indicates intent, but is trivial to type. &amp;nbsp; &amp;nbsp;We stuck with code: because we could hook into existing infrastructure more easily, and was less 'magical' (you could guess at what it means even if you did not have the hyperlink software.&lt;/p&gt;
&lt;p&gt;I have not thought alot about integration with SandCastle. &amp;nbsp; &lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4746713</link><pubDate>Tue, 04 Sep 2007 21:21:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4746713</guid><dc:creator>Peter Ritchie</dc:creator><description>&lt;p&gt;With just the code: prefix you loose the ability to add hyperlinks to XML comments. &amp;nbsp;propgating &amp;quot;code:&amp;quot; into your code documentation would be a big no no.&lt;/p&gt;
&lt;p&gt;The drawback of code: is they are aren't validated. &amp;nbsp;If you add &amp;quot;code:gibberish&amp;quot;, it will display as a hyperlink but when you ctrl-click it it simply gives you a warning &amp;quot;could not find symbol...&amp;quot; way down in the status bar. &amp;nbsp;Where as if &amp;quot;gibberish&amp;quot; were a type it would display as a hyperlink, otherwise it would simply be another word--I'd never have broken links...&lt;/p&gt;
&lt;p&gt;At the very least, supporting &amp;lt;see cref=&amp;quot;Namespace.TypeName&amp;quot;&amp;gt; would be useful.&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4749448</link><pubDate>Wed, 05 Sep 2007 00:38:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4749448</guid><dc:creator>vancem</dc:creator><description>&lt;p&gt;The code: hyperlink is not intended for external documentation. &amp;nbsp;After all the code does not ship with the documentation and thus linking to it would be inappropriate. &amp;nbsp; If on the other hand, it is just an application without a formal API surface, or you ship the source with your API surface, then it can make sense. &amp;nbsp;It depends on your needs. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is also true that there is no validation of the hyperlinks. &amp;nbsp;That is on the TODO list. &amp;nbsp; It would also be nice if you had completion (intellisense), but that requires deaper integration with VS. &amp;nbsp; The idea of supporting hyperlinks for cref XML tags is also an idea that has come up before, but also requires deeper integration with VS to do (I don't create the hyperlinks, I just register that code: is a tag that can be a URL and VS turns it into one). &lt;/p&gt;
&lt;p&gt;Ideally, this is something that would be provided by VS, however VS gets alot of feature requests that lower the probability that this one will get funded. &amp;nbsp;The way to get this one actually approved is for enough people to send feedback (eg on &lt;a rel="nofollow" target="_new" href="http://connect.microsoft.com/feedback/default.aspx?SiteID=210"&gt;http://connect.microsoft.com/feedback/default.aspx?SiteID=210&lt;/a&gt;) asking for it. &amp;nbsp;However no one will do that unless they can actually try it out and discover its usefulness &amp;nbsp; A chicken or egg problem. &amp;nbsp;We break this cycle by providing something (eg HyperAddin), that allows people to try out the feature. &amp;nbsp;If it becomes popular, it is relatively easy to get Visual Studio to add it (and fix the issues you describe). &lt;/p&gt;
&lt;p&gt;That's the plan...&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4766553</link><pubDate>Wed, 05 Sep 2007 20:18:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4766553</guid><dc:creator>vancem</dc:creator><description>&lt;p&gt;I have updated the body of the blog to include a hyperlink to a sugestion to add this capability to Visual Studio directly. &amp;nbsp;If anyone is interested, please take a moment to vote on this suggeestion.&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4810502</link><pubDate>Fri, 07 Sep 2007 16:57:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4810502</guid><dc:creator>dalevine</dc:creator><description>&lt;p&gt;I just tried it out and I like it. Here's some quick feedback after 10 minutes of playing with it.&lt;/p&gt;
&lt;p&gt;1. Intellisense. When I type in &amp;quot;code:&amp;quot; I really want to see a list of what has been defined. In a large system with lots of anchors this will be a problem.&lt;/p&gt;
&lt;p&gt;2. Word wrapping in comments --&amp;gt; GREAT! I've been wanting this for a long time and even if I don't use the hyper links I will benefit from the word wrap and continuation of comments. &lt;/p&gt;
&lt;p&gt;3. When &amp;quot;Enter&amp;quot; is pressed after a commented line a new comment line is always created. I'd prefer it to stop adding new comment lines if the previous comment line is empty and just go to a blank line.&lt;/p&gt;
&lt;p&gt;4: GoOut. Cool feature. How about a Go Out for #regions (takes me to the beginning of a region), and a GoOut for code in try-catch-finally, go to the beginning of the block, or to the previous block if at the beginning of a block. e.g. if in the finally section, take it to the beginning of the finally, and from there to the catch block, and from there to the beginning of the try block. &lt;/p&gt;
&lt;p&gt;5. Formatting. When I reformatted a commented block that I later edited it moved the starting column to the right. It should maintain the same starting column. &lt;/p&gt;
&lt;p&gt;When reformatting a selection of text it moved the starting column of lines 2,3,4 to the right but left the starting column of line 1 as-is, resulting in a jagged display of text.&lt;/p&gt;
&lt;p&gt;On the whole, very nice. Thanks&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4811508</link><pubDate>Fri, 07 Sep 2007 18:20:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4811508</guid><dc:creator>vancem</dc:creator><description>&lt;p&gt;Great feedback. &amp;nbsp;Certainly the intellisense feature is needed, but is also hard to do without deeper integration into VS (which I am not ready to attack). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue of whether comments should be continued or not is problematic, as there are times when you want the comments to continue and times you don't and it is hard to infer from context. &amp;nbsp; &amp;nbsp;I the idea of using a blank line as a hint is interesting (although I think I would want it to be two blank lines. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The current solution to this problem is that Ctrl-Z will undo the comment insertion, so if you wanted to type code, and it make a comment, you are one character away from fixing it. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The idea of leaveraging regions or code blocks (as both hyperlink anchors, and for Go Out), is interesting. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have to investigate the formatting issue you describe (I am not certain I can repro it given your description). &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#4811519</link><pubDate>Fri, 07 Sep 2007 18:22:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4811519</guid><dc:creator>vancem</dc:creator><description>&lt;p&gt;For those interested. &amp;nbsp;I have posted the source code for HyperAddin (see &lt;a rel="nofollow" target="_new" href="http://www.codeplex.com/hyperAddin/SourceControl/ListDownloadableCommits.aspx"&gt;http://www.codeplex.com/hyperAddin/SourceControl/ListDownloadableCommits.aspx&lt;/a&gt;). &amp;nbsp;Hopefully you will find the code very approachable (I did go to some effort to make it readable), so people can tinker with it. &amp;nbsp;&lt;/p&gt;
</description></item><item><title>Visual Studio Code-Comment Hyperlinking Add-In</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#5133685</link><pubDate>Wed, 26 Sep 2007 05:11:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5133685</guid><dc:creator>LINQed IN - Troy Magennis' View on .NET, C# and Software Development</dc:creator><description>&lt;p&gt;I follow Brad Abrams blog and saw that he posted on a very nicely implemented Visual Studio add-in component...&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#5203334</link><pubDate>Sun, 30 Sep 2007 00:22:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5203334</guid><dc:creator>dalevine</dc:creator><description>&lt;p&gt;Thanks for making the source code available.&lt;/p&gt;
&lt;p&gt;I ran into a problem with the add-in, and I think I fixed it (or worked around it) based on the source code you posted.&lt;/p&gt;
&lt;p&gt;The problem was that if you were in a xml comment area (e.g. the header for methods) it would treat that as if it were in a regular comment area. This was ok for word wrapping (I kind of liked that) but it caused problems with the XML intellisense. &lt;/p&gt;
&lt;p&gt;Normal behavior is that when you are in the xml comment area and enter &amp;quot;&amp;lt;&amp;quot; it brings up a list of available entries, such as &amp;quot;== param name=&amp;quot;Arg1&amp;quot;. &amp;nbsp;If you then press the Enter key it copies that text down into the xml comment so that you can add your comment into the xml field. &lt;/p&gt;
&lt;p&gt;However, the add-in swallowed the enter key and the text was never copied down. I found this annoying so I modified the source code as follows:&lt;/p&gt;
&lt;p&gt;In source file HyperAddin.cs, in method BeforeKeyPress(...) I added two lines of code.&lt;/p&gt;
&lt;p&gt;&amp;lt;snip&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Are we in a comment???&lt;/p&gt;
&lt;p&gt;	string xmlStart = &amp;quot;///&amp;quot;;	// Must also check to see if we are in xml comment area&lt;/p&gt;
&lt;p&gt;	if ( ( String.Compare( lineText, commentCharsIdx, commentStart, 0, commentStart.Length ) == 0 )&lt;/p&gt;
&lt;p&gt;		&amp;amp;&amp;amp; !( String.Compare( lineText, commentCharsIdx, xmlStart, 0, xmlStart.Length ) == 0 ) )&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;&amp;lt;more code&amp;gt;&lt;/p&gt;
&lt;p&gt;Basically, this checks if we are editing in the xml area, and if so, it ignores all entries. I added the xmlStart string and the string.Compare&lt;/p&gt;
&lt;p&gt;I'd prefer it to be smarter so that word wrap still functions within the xml comment area, but which ignores user input when selecting an item from Intellisense, but I do not know enough about the VS addin model to be able to figure out how to do this. &lt;/p&gt;
&lt;p&gt;There may be other areas that need to check for this, but this solved the problem I was having and I did not look any further.&lt;/p&gt;
&lt;p&gt;Thanks again for the source code, I'm sure I'll refer to it when I write my own addins.&lt;/p&gt;
</description></item><item><title>re: Writing approachable code: Introducing the hyperaddin for Visual Studio!</title><link>http://blogs.msdn.com/vancem/archive/2007/08/31/writing-approachable-code-introducing-the-hyperaddin-for-visual-studio.aspx#5249521</link><pubDate>Wed, 03 Oct 2007 02:33:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5249521</guid><dc:creator>vancem</dc:creator><description>&lt;p&gt;Thanks for the feedback. &amp;nbsp;I actually did not know that intellesence also used the return key as a competion character (I have always used tab). &amp;nbsp; There is actually logic in HyperAddin so that XML intellisense works for tab. &amp;nbsp;It can certainly be fixed to to both tab and return. &amp;nbsp; I will do this at some point.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item></channel></rss>