Roland Weigelt

Born to Code

  • GhostDoc 1.9.1 (for Visual Studio 2005) Released

    20051120_GhostDoc

    Version 1.9.1 is a bugfix release of GhostDoc for Visual Studio 2005 (download on the GhostDoc homepage).

    The VB.Net support will remain experimental in this release, so it is turned off by default and you have to turn it on in the configuration dialog. A couple of issues (caused by small differences between the C# and the VB.Net CodeDOM) have been fixed, and things are looking good in general so I’m confident I can drop the experimental status pretty soon.

    Important: When updating from 1.9.0, please uninstall 1.9.0, start Visual Studio once, exit and then install 1.9.1. If you have customized your configuration, please export it before uninstalling 1.9.0, then import it after installation of 1.9.1. All steps are explained in detail in the ReadMe.txt file in the ZIP archive.

    ChangeLog:

    • Fixed: Use of generics causing documentation not being generated.
    • Fixed: Installation not possible if "My Documents" folder is on network drive/share.
    • Fixed: VB.Net support: Inherited documentation causing either error messages or mixed up comments.
    • Fixed: VB.Net support: Property accessors being treated as methods.
    • Fixed: VB.Net support: Minor differences between C# and VB.Net CodeDOM causing trouble.
    • Fixed: Some add-in issues (uninstallation, add-in manager)
    • Changed: The add-in is no longer installed to a sub-folder of the AddIns directory. Instead, any location can be chosen now on the harddrive.
    • Changed: In the generated comments, references to types ("<see cref="..." />) are now using the "T:" prefix that you may know from the inherited comments. This is to avoid the (new) warnings that Visual Studio 2005 is generating.

    Thanks to Markus Hogsved for his detailed feedback on VB.Net support.

  • Code Snippet for Events

    Name: Event
    Description: Code snippet for an event and the corresponding On... method
    Shortcut: event
    Result:

    public event EventHandler<EventArgs> EventRaised;

    protected virtual void OnEventRaised( EventArgs e )
    {
        EventHandler<EventArgs> handler = this.EventRaised;
        if (handler!= null) handler( this, e );
    }

    Download: Event.snippet

     

    (Update 2005–11–23: Changed to make the “On...” method thread safe. Thanks Eric!
    D’oh… I even wrote about this in January, but as thread safety wasn’t an issue in any of my code, I went back to the “old pattern” at some point, as it meant less typing. But a code snippet should of course use the correct pattern, right?)

  • Second Place for GhostDoc in the Larkware Contest 2005!

    [For my German readers: no, it’s not a mistake in the title – the first prize for GhostDoc means that I made the second place, as the first place gets the grand prize. I even googled it up, there doesn’t seem to be anything unusual about this usage of words]
    [Everybody else: sorry, this is really not a joke, it’s confusing for us Germans and I had to explain it a couple of times today, including my parents on the phone]

    Okay, enough explanation, let’s get to the point: GhostDoc 1.9.0 (i.e. the Visual Studio 2005 version) made first prize (second place) in the Larkware contest 2005 and this means: I won stuff. Cool stuff. Oskar even emailed me and told me: “you won cool stuff!”. And lots of it. One little problem: somebody forgot to include the XXL package of extra time to try it all out ;-)

    In related news, version 1.9.1 is in the works and should be out really soon. The new version will fix installation issues people had when their “My Documents” folder was moved to a network drive or share, and the problem that comments with a <see cref=”…” /> wouldn’t be generated in generic classes.

  • Code Snippet for Properties with Prefix Notation

    As I wrote in previous blog posts, I still use prefix notation for private members, one reason being IntelliSense. If you’re like me, you may find these code snippets handy:

    Name: Boolean Property
    Description: Code snippets for a boolean property.
    Shortcut: bp
    Result: private bool m_bMyProperty;

    public bool MyProperty
    {
     get { return m_bMyProperty;}
     set { m_bMyProperty = value;}
    }


    Name: Integer Property
    Description: Code snippets for an integer property.
    Shortcut: ip
    Result:

    private int m_nMyProperty;

    public int MyProperty
    {
     get { return m_nMyProperty;}
     set { m_nMyProperty = value;}
    }


    Name: Enum Property
    Description: Code snippets for an enum property.
    Shortcut: ep
    Result: private TheType m_eTheName;
      
    public TheType TheName
    {
     get { return m_eTheName; }
     set { m_eTheName = value; }
    }

    Name: Object Property
    Description: Code snippets for an object property.
    Shortcut: op
    Result: private TheType m_objTheName;

    public TheType TheName
    {
     get { return m_objTheName;}
     set { m_objTheName = value;}
    }

       
    Download: Properties.snippet
  • GhostDoc is one of "10 Must-Have Add-Ins" in MSDN Magazine

    MSDN Magazine 12/2005: Visual Studio Add-Ins Every Developer Should Download Now

    Wow… GhostDoc is one of them… I’d only wish the example would have been just a little bit more convincing (SavePerson() -> <summary>Saves the Person<summary> — hmm… ok…). But I must admit that it’s pretty tough to really show off GhostDoc’s features in only about a dozen sentences. I’d recommend you watch the video, or even better download and install GhostDoc. In case you’re impatient, the help file has a short chapter “How do I see some action without reading boring stuff?” ;-).

  • GhostDoc 1.9.0 (for Visual Studio 2005) Released

    The highly anticipated version of GhostDoc for Visual Studio 2005 has just been released (download on the GhostDoc homepage)

    Originally I had planned to give it the version number 2.0, but for various reasons I couldn’t do much more than just porting version 1.3.0 (the most recent release for 2003) to Visual Studio 2005.

    So the big feature is: GhostDoc 1.9.0 runs inside Visual Studio 2005 and the dialogs more or less match the style of the GUI (icons, general look). Unfortunately I didn’t have time to update the screenshots in the help file, but no functionality has changed so I’m pretty sure you can live with that ;-)

    Umm… OK… one more thing: Anyone interested in VB.Net support? I’ve added what I call “experimental support”. In Visual Studio 2005, the CodeDOM for VB.Net now supports the DocComment property, so it was pretty easy to get this running in principle (some adjustments had to be done, though). But to be honest, I didn’t have the time (and experience in VB.Net) to test this enough to be an official feature of GhostDoc 1.9.0. So VB.Net support is turned off by default and you have to turn it on in the configuration dialog, on the “Options” tab. To the VB.Net developers out there: give it a try and tell me what you think. Oh, it would be very nice if somebody could port the demo project to VB.Net – the VB syntax keeps my head spinning… (sorry, I’m a curly braces guy since Turbo C 2.0).

    By the way, this release is my entry for the Larkware 2005 Developer Tool Programming Contest; let’s see how things turn out for me and what the other competitors came up with.

  • GhostDoc Video is up on Channel 9

    If you want a quick tour through GhostDoc in less than five minutes, check out the video.

    It has already been posted on Channel 9 for a couple of days, but I was a bit reluctant to link to it as the first version posted was virtually useless. My original video was recoded by the Channel 9 staff, and in the process the texts in the Visual Studio source code editor window became completely unreadable. The second version is still slightly distorted, but the texts are readable and that's what matters in the end.

  • GhostDoc 1.3.0 Final Released

    20050822_GhostDocBeta2

    It took longer than expected, but the final of GhostDoc 1.3.0 has just been released (download on the GhostDoc homepage). Now that it’s out the door, I’m ready to move on to work on a VS2005 version.

    What’s new in 1.3.0

    Final compared to beta 2:

    • Added: Some more "of the" trigger words and adjectives.
    • Added: Command "RebuildDocumentation". It works like the "DocumentThis" command, but always creates the documentation from scratch. Note: The command was added pretty late in the release process; to minimize impact on the release date, it does not appear in any menu and can only be assigned to a hotkey via the Visual Studio options dialog.
    • Added: Minor additions to the documentation.

    1.3.0 beta 2 compared to beta 1:

    • Added: New options for determining what should be the representation of the C# language keywords "true", "false" and "null" in a documentation comment.
    • Added: New Macros $(True), $(False) and $(Null) to be used in text templates.
    • Added: New Macros for the current date, the name of the current user, etc. ("environment macros").
    • Added: New custom text that will be added once to a newly added documentation comment. As this text will not be updated, can be used for e.g. marking the date and time when a class member was added.
    • Added: New summary template for default property rule (text generation was hard-coded in previous versions).
    • Added: Template for methods with parameters for SingleWordMethodRule (text generation was hard-coded in previous versions).
    • Added: Preliminary documentation for the dialogs.
    • Changed: Default textual representation of "null", "true" and "false" back to the values of version 1.2.1 (<c>null</c>, <c>true</c> and <c>false</c>)
    • Changed: Value text of the default property rule is no longer empty by default.
    • Changed: Macros: Words.AsSentence -> Words.AllAsSentence
    • Fixed: Various bugs related to customization features.

    1.3.0 Beta 1 compared to 1.2.1:

    • Added: New rules for using "inherited" documentation, including base class members and members of implemented interfaces. The inherited documentation will be cleaned from single <para> tags and the texts will be tweaked (e.g. when the summary for an interface method starts with "When implemented by a class....", and the summary is inherited by the method that is an implementation).
    • Added: GhostDoc updates existing documentation. Empty tags (<summary>, <returns>, <param>) will be filled according to the generation rules, existing text remains unchanged. The update reorders the parameter documentation if the order of the parameter changes, and removes documentation for parameters that no longer exist.
    • Added: User defined ("custom") rules using e.g. regular expressions for matching names and/or types.
    • Added: New rule for "On..." methods -- no more "Ons the click" ;-)
    • Added: Rule for static constructors.
    • Added: Rule for the Finalize method (destructor syntax in C#).
    • Added: Rule for event handler methods as they are created by the WinForms designer.
    • Added: Rule for boolean properties.
    • Added: Rules (both custom and built-in) can now be customized by editing templates that are used by the text generation rules.
    • Added: Export of partial configurations is now possible (e.g. for exporting only a single custom rule).
    • Changed: Summary text of the default constructor rule is now 'Initializes a new instance of the <see cref="ClassName" /> class.', i.e. uses the wording in the Microsoft documentation. The old "Creates a new <see cref="ClassName" /> instance" is debatable - is it the constructor that actually creates the instance, or is the constructor called when the instance is created? Thus the Microsoft wording is preferable.
    • Changed: The configuration is now stored in the ApplicationData\Weigelt\GhostDoc directory. Old configurations in the installation directory (versions before 1.3.0) will be upgraded and stored in the new location.
    • Fixed: <returns> tag no longer disappears if the return type is an array.
    • Fixed: Overall handling of array types.