Click here to Skip to main content
Click here to Skip to main content

Commenter - A CodeRush Plugin which Helps you to Comment your Code

By , 29 Nov 2008
 

Contents

Introduction

Commenter is a plugin for CodeRush, which is an addin for Visual Studio (Visual Studio 2002, 2003, 2005 and 2008 are supported). Basically Commenter will help you to comment your code and make it easier to navigate through your code. Currently Commenter supports only C#, but C++ might work too (but may need some additional testing). Support for VB.NET might be added if requested, don't know if VB guys would like such a feature. The project files use Visual Studio 2003, but you can convert them to Visual Studio 2005 or Visual Studio 2002 as well and everything should work fine too. (Note: Since v1.8 all files are for Visual Studio 2008.)

This article is still based on the CR_Commenter version 1.0, since 2004 CR_Commenter was updated 9 times already and is in version 1.9 right now (2008-11-27). For an updated feature list and many more screenshots, check out this blog entry!

Just be sure to change the start-program to the correct devenv.exe too (for testing).

Note: I have nothing to do with the Developers of CodeRush, I just like their tool and think it's easier to write Visual Studio plugins with it.

I will also cover how to write and use a CodeRush plugin, it seems like there is no tutorial on the net for this. The Commenter could also be implemented as a native Visual Studio plugin, but this would be much harder (parsing, etc.), also anyone using my plugin should also useCodeRush to improve his development speed.

Let's take a look at some actual code and how it would look when using Commenter:

Commenter - Features

As you can see in the image above, there are several features supported in Commenter. The Commenter will only do its work when you press '}' to end a code block, the only exception is when you double-click on an auto-generated comment, then your cursor will jump to the class or method.

The features are listed below:

  • Customable header comment: In each source file you edit, a customable header will be added at the top of the file. The cool thing about this is, it gets updated every time when you modify a file, so you can always very easily see when the code was created and when it was modified the last time.
  • If requested, the Commenter will put a Using directives region around all your using directives, like Visual Studio 2005 does when creating new classes. It will also remove any unnecessary empty lines between the region code and the directives.
  • The commenter can convert normal comment of classes, methods, etc. to XML comments automatically, this can come in handy. It also allows you just to write normal comments (which is obviously faster than writing a summary block) and then just press } at the end of the function to convert it automatically (and then add parameters, etc. stuff).
  • In case you don't have any comments for a public function or class, but may need XML comments (e.g. for checking your code with FxCop), an XML comment will be generated for you. You should of course modify this comment or add text to it when required. Just having an XML comment will motivate you most times to write some comments there anyway.
  • The most important feature for me is the auto-commented code blocks to find out which code block belongs to what. Even in the small example with only 20 lines, we already got 5 indentations and who knows which belongs to what when seeing only the bottom part of this code. I tested the commenter on very large source files with a couple of thousand lines of code and it works nice, even if the CodeRush parsing has some errors. I used the commenting technique for a couple of years and have convinced some other coders to do this as well, but if you are lazy (and all programmers are), you don't want to write all those comments. Now everything will be done automatically, no reason to complain anymore. This feature was also the most complex one, because the comment has to be generated in a smart way, there are a lot of things going on here: correcting parsing errors, collecting parameters, limitation to 80 chars and 3 parameters and a lot of special handling for different kinds of code blocks (if, for each methods, classes, etc.).
  • As a bonus feature, you can also click on a auto generated comment to jump to the appropriate class or function, sometimes this is more useful and faster than selecting the method in the method dropdown list.

When opening the DevExpress -> Options page, you can select the Commenter options page and configurate the Commenter and use as many features as you like. The options page looks like this:

Creating the CodeRush Plugin

First of all, you need to have CodeRush installed, you can use the trial version without any limitations (except some nag box at startup I think) and start writing plugins for that. But you should support the guys at DevExpress for their work and buy the product.

It's also good to make yourself comfortable with CodeRush, the available plugins and how everything works before you start programming a plugin, also read the help!

Ok, first step it to start Visual Studio and select DevExpress -> New plugin from the menu. Now select your language (C#/VB.NET), enter the name of the project and click a couple of times next (see if you want to make some other choices like including an options page for your plugin). I called my project CR_Test, CR_ is the default name prefix for all plugin DLL files, CodeRush will automatically rename the plugin to Test and the source file to TestPlugIn.cs (the project is still named CR_Test):

Ok, now we got a TestPlugIn.cs, click on properties in design view and select events (the yellow flash icon, in case you don't know). Now you see a lot of standard Visual Studio plugin events and CodeRush events. At first it won't be easy to find out which event is the correct one for your project. There is also an incredible mass of classes and functions in CodeRush, which makes it very hard to start doing anything at first (because you don't know where to start). Here is a quick overview about some important CodeRush classes, you might need:

  • Check out what parameters are in the EventArgs passed to you from the event. e.g. TextView, pressed character, the document, the current selection, etc.
  • CodeRush.TextDocument, you can get the current source file the user is working on with (you won't need that if EventArgs gives you the document instance already):
    // The text document we are currently working on
    
    TextDocument document = (TextDocument)
        CodeRush.Documents.ActiveTextDocument;

    Don't forget to check if document is valid now, maybe there is currently no active file selected, then we can't proceed. When you are not sure everything is parsed correctly (maybe something was changed), just call document.ParseIfTextChanged();

  • CodeRush.Selection (if you get an active document, use document.Selection) contains information about the currently selected code, most likely you will be interested in the current cursor position:
      int currentLine = document.Selection.ActivePoint.Line,
          currentLineOffset = document.Selection.ActivePoint.LineCharOffset;
  • The current code section can be accessed via CodeRush.Source.Active, there are also a lot of other Active- properties (current class, namespace, method, etc.) and all nodes are connected to each other (we got a parent, children and detail nodes):
    • child nodes can be accessed with .Nodes, detail nodes (e.g. for parameters or conditions) can be accessed with .DetailNodes and the parent can be found at .Parent.
      // Get active section (don't forget to check if its valid!)
      
      LanguageElement activeSection = CodeRush.Source.Active;
      LanguageElement activeNamespace = CodeRush.Source.ActiveNamespace;
      // Get type (class, method, if, while, namespace, etc.)
      
      LanguageElementType sectionType = activeSection.ElementType;
    • LanguageElement contains only the common properties of elements, but if you got an if condition block, a while code block, a method, the namespace, etc., you might want to access the more specified derived classes. For example, we need DelimiterCapableBlock to check code blocks:
      // First check if activeSection is a sub class 
      
      //of DelimterCapableBlock
      
      if (activeSection.GetType().IsSubclassOf(
          typeof(DelimiterCapableBlock)))
      {
          DelimiterCapableBlock codeBlock = 
                (DelimiterCapableBlock)activeSection;
          // Check out some properties
      
          bool isCodeBlock = codeBlock.HasDelimitedBlock;
      } // if (activeSection.GetType)
  • CodeRush.TextView may be provided by EventArgs, it will help you to navigate through the currently visible source code and allows you to jump around or select anything.
  • There are also a lot of things hidden in some sub class, like when you need the filename of the current document just use document.FileNode.PathSegment or when you need the current line from TextView use ea.TextView.Caret.LineText, you will have to find out this stuff by yourself when trying to solve your problems. Sometimes it may be easier to implement functionality yourself, if you can't find it, it may not exist or it does not match your requirements.

The Commenter uses some of my helper classes to simplify things:

  • CodeRushHelper: Provides some functionality required by Commenter to get names of sections recursively or find code blocks by the element name.
  • Log: Helper class to log info text, errors and exceptions to a text file, sometimes debugging complex problems is harder than just log what's happening and then see in the log what's going on. It's also useful to profile code and check out which parts are slow or need optimizations.
  • StringHelper: A rich class providing a lot of extra functionality for comparing, checking, writing and handling text strings.

Writing Some Code

Okay, enough bubbling around, let's write some actual code. I will only show you a very small part of Commenter (because it would be too complex for this tutorial, read the Commenter source code to find out more about how it works). We will try to add a simple comment with the type of the code block. This means we will convert a code block like this...

if (money > 1000)
{
    money *= 2;
}

... to the following:

if (money > 1000)
{
    money *= 2;
} // if

First of all, we add an Event to catch if '}' was pressed. Use TestPlugIn designer view -> Properties -> Events and create a EditorCharacterTyped event and paste this code (some of it was already explained above):

private void TestPlugIn_EditorCharacterTyped(
    EditorCharacterTypedEventArgs ea)
{
    // Only check if '}' was pressed

    if (ea.Character == '}' &&
        CodeRush.Source.ActiveFileNode != null &&
        CodeRush.Source.ActiveFileNode.Document != null)
    {
        // The text document we are currently working on

        TextDocument document = (TextDocument)
            CodeRush.Documents.ActiveTextDocument;

        int currentLine = document.Selection.ActivePoint.Line,
            currentLineOffset = document.Selection.ActivePoint.LineCharOffset;
        // Get active code block

        LanguageElement activeCodeBlock = CodeRush.Source.Active;
        if (activeCodeBlock == null)
            // Can't continue if code block is not valid.

            return;
            
        // Get code block type (class, method, if, while, namespace, etc.)

        LanguageElementType codeBlockType = activeCodeBlock.ElementType;

        string lineText = ea.TextView.Caret.LineText;
        // Continue only if line ends with '}', don't overwrite

        // already existing comment

        if (lineText.EndsWith("}"))
        {
            lineText = lineText.TrimEnd() + " // " +
                codeBlockType.ToString().ToLower();
            // And write it to source file

            document.SetText(
                currentLine, 1,
                currentLine, currentLineOffset,
                lineText);
        } // if (lineText.EndsWith)

    } // if (ea.Character)

} // TestPlugIn_EditorCharacterTyped(ea)

This event is called whenever the user presses any key in the Visual Studio editor. When this key was '}' and we got a valid source code document, we will get the document, the current line and offset, the activeCodeBlock and its element type. Then this code will try to modify the current line and add the " // "+type comment to it.

When you try it out, you will see that the commenting works, but we don't get the correct code block name. It will be always the parent or nextcode block, this is because the cursor is outside the codeblock when pressing '}' and the next or parent code block is returned when calling CodeRush.Source.Active. To fix this, we have to move the cursor to the beginning of the current line (insert this before activeCodeBlock):

document.Selection.StartOfLine(
    EnvDTE.vsStartOfLineOptions.vsStartOfLineOptionsFirstText);

Now it works, but the cursor is at the wrong position, so we have to fix that again at the end of the function with:

document.Selection.MoveToLineAndOffset(
    currentLine,
    currentLineOffset);

Note: When finished testing CR_Test.dll, you have to close Visual Studio and remove CR_Test.dll from the DevExpress\CodeRush\1.1\Bin\Plugins directory! You will have to do the same thing every time you want to edit your plugin solution. If the *.dll, is not removed, the solution is not able to copy and execute the new version of the plugin. Now from here on, try out other Events and add your own plugin ideas, you can do a lot more with CodeRush, like adding new tool windows in Visual Studio. Check out the sourcecode of Commenter to find out how it works and learn more about writing a CodeRush plugin.

Conclusion

That's it for this tutorial. I hope this gave you some insight on the Commenter plugin. If you find any bugs, have suggestions or want some additional features or support for another language, please leave a comment below. Feel free to use the Commenter, the program and sourcecode are completely free.

History

Articles and more detail about each version can be found on my blog!

  • Initial version : 2004-12-08 (v1.0)
    • Initial version supports commenting, adding header block and basic XML generation.
    • Wrote this article.
  • First Update : 2004-12-12 (v1.1)
    • Lots of smaller improvements (more generated comments, click on auto generated comments to jump to function, etc.), very stable now!
  • Second Update : 2004-12-17 (v1.2)
    • New version 2004-12-17 with some minor bug fixes
  • Third Update : 2005-04-04 (v1.3)
    • Several new features and some bug fixes, see the TODO.txt file for details.
    • Now supports newest CodeRush version, auto XML comments work now for non-public methods too and will produce better comments.
    • Also added better support for non C# files like *.fx, *.cpp, *.h, etc. If CodeRush does not parse them, Commenter will do it and still generate nice comments and the header section!
  • Fourth Update : 2005-10-04 (v1.4)
    • Added a bunch of keywords to translate abbreviations to full names.
    • Fixed: No more XML generation of namespace sections or in methods.
    • Fixed: All sections are updated, the first one is not skipped anymore.
    • Fixed: Using directives section for multilines.
    • New: Support for autogenerated region blocks for big methods.
  • Fifth Update : 2005-12-28 (v1.5)
    • First version for Visual Studio 2005 and using .NET 2.0 now for supporting generics and anonymous delegates.
    • Fixed again: No XML generation inside of methods (recent CodeRush version changed its behaviour somehow).
    • Fixed: If using defines in the using statements the surrounding region is now generated properly.
    • Fixed: Constructing more useful comments for if and for, more intelligent block reconstruction and naming.
    • New: Hotkey for generating XML: Ctrl+1
    • New: Added version information and update button in options screen.
  • Sixth Update : 2006-06-08 (v1.6)
    • Added add namespace feature to support C# 3.0 (CTP May) in Visual Studio 2005.
    • Added action hint effects for commenting, regions and namespace adding.
    • Improved options screen a little, added more hotkeys and help.
    • More hotkeys available, Ctrl+1, Ctrl+2, Ctrl+3, Ctrl+F9, Ctrl+.
  • v1.7 Update: 2006-08-05 (v1.7)
    • Fixed couple of bugs (long comment lines got cut of, fixed autogenerating header when user modified it a lot)
    • Generating comments will no longer expand any collapsed regions, at whichever file position we are.
    • Parameter comment generating now always works, no matter if you add or remove parameters. This is a quite useful feature, even refactoring parameters is supported (moving, removing, adding stuff).
    • Autosorting feature for using directives, also fixed couple of using issues.
    • Better support for Ctrl+., more intelligent checks for sub types in namespaces and for uncompiled assemblies.
    • Autosorting of all variables, properties, constructors and methods if you want to autogenerate some nice regions for all these types. This feature allows you to import external code and let it fit your coding style (ok, at least my coding style) much more easily.
  • v1.8 Update: 2008-04-27 (v1.8)
    • Fixed many smaller issues that have been collected over the last 2 years
    • Fixed '}' inside string or comment, even if CodeRush has not processed the whole file yet (double checking now). E.g. the following string will not longer produce any comments:
      SQL = String.Format("UPDATE GC SET Status = {0} WHERE ID = {1}", Msg, ID);
    • Supporting to generate regions again, but split up function names, also suppress CodeRush region generation with Ctrl+3, Ctrl+R (also suppressing Visual Studio hotkeys now). Better support for auto generated region blocks for big methods, just press Ctrl+3 to generate region (let CR_Commenter choose the name automatically, allow editing after pressing Ctrl+3).
    • Fixed #if DEBUG in Using directives (caused trouble, was removed)
    • Also added code to always remove #if DEBUG and #endif, especially at the beginning and end of the Using directives region.
    • Fixed double line #using Using directives issue when using directives got mixed up.
    • Fixed long line commenter generation, will now still work, but no longer cut off any of your code. If you have long code lines (>100 letters), you can still generate comments for them and the Commenter will not longer cut anything off (you are responsible for formatting the code).
    • Fixed auto-collapsing of regions, especially when closing blocks in methods, the method should not auto-collapse!
    • Checked support with other languages (which are at least similar to C#) like Lua, Python, etc.
    • In Python/Lua, etc. we had to disable } comment generation and also use other comments (# for python, -- for lua) when using Ctrl+1 for header generation.
    • Test all other hotkeys and make sure they do not affect the code badly in CodeRush unsupported languages (Note: VB is still not supported since it is very different from C# code).
    • Supports now any unit test framework, actually does not care anymore what you use, only the unit test generation code will add Xunit, but you can easily change that code if you want to.
    • Options are now available directly into Editor tree of the CodeRush options!
    • Refactored all classes, added about 4 new classes and removed 1 unused class. The source code is now much easier to read, to follow and to change.
    • Remove commented out code, cleaned up the source code a lot.
    • And finally applied the commenter to the commenter source code :)
  • v1.9 Update: 2008-11-14 (v1.9)
    • Major update with many feature requests now finally implemented.
      New features:
      • All features can now be enabled or disabled and you can set your own hotkey for them
      • Completely new options screen, simplified and unified settings, less chaotic look
      • Added cool new per-project and per-solution header comments
      • New shortcut Ctrl+6 to just update the header
      • Added lower limit for block size to reduce comments for small blocks (also works recursive)
      • Added new features and hotkey logic, everything is now easier to customize
      • Easier visibility if plugin is installed and working (more visual events, better options screen)
      • Fixed generating comments for new files (messes up the using directives region), seems to be related to generating header comments
      • Improve line length count for removing comments (good new standard: 5 lines)
      • Fixed several problems in Format-Strings or SQL code
      • Added whole method identifier from the accessibility keyword to the closing parenthesis for region directives
      • Improved the CodeRush-autogenerated regions (Ctrl+3), make sure comments are not messed up
      • New default: Do not generate XML parameter comments (mostly not used for better documentation anyway, adding them yourself for more details is more comfortable)
      • Added C++ "pragma region - #pragma endregion" support (thanks for testing to Enrico)
      • C++: include includes into using directives region
      • C++: Fixed header comment (project name could not be found)
      • C++: Do not use XML comments, just leave normal comments!
      • Fixed wrongly generated regions outside of our plugin
      • C++: Fixed #includes region, do not modify include lines
      • Fixed region generation when CodeRush generates region before us!
      • Fixed header in case some other header comment is used
      • Added multiline header comment support for // /* */ -- and # to support all kinds of languages and comment formats
      • Also force generate comments on properties (methods work, also test constructors)
      • C++ allow Ctrl+4 and Ctrl+5 for C++ region collapsing (using Visual Studio's Edit.ToggleOutliningExpansion and Edit.ToggleAllOutlining as fallbacks)
      • Tested with CodeRush versions 2 and 3
      • New shortcut for updating the header (F6)
      • Lower limit for block size (recursion)
      • Tested long lines {} again (now works better inside methods)
      • Allow SQL statements with {} in them
      • Allow only to update when Ctrl+1 is pressed
      • Include method parameters for region names (optional)
      • Much better support for C++, a lot of extra testing
      • C++ feature for regions (#pragma region) with Ctrl+R
      • Improved language support for Python (IronPython) and Lua (LuaInterface)
      • Also supporting UnrealScript (very similar to C++)
      • Per-project headers (saved in project file)
      • Most recent changes in the header comment, also merging any old headers with the new header (or skip generation if not compatible).
      • New obfuscate file feature with Ctrl+8 to cut any comments, empty lines, mainly to reduce file size! Supported languages: C#, C++, Python, Lua

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

exDreamDuck
CEO Delta Engine
Germany Germany
Member
Currently working on: http://DeltaEngine.net
Projects done: www.ArenaWars.net (RTS game, first commercial .NET game), www.RocketCommander.com (.NET 2.0 open source game), www.EuroVernichter.de
Working at: www.exDream.com
My Blog: abi.exDream.com
I'm also have been a MVP for XNA/DirectX from 2006 till 2010 and written some XNA books.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionNew version for CodeRush 10.1 ?memberbobfox15 Sep '10 - 6:23 
Subject says it all.
Thanks, Robert
AnswerRe: New version for CodeRush 10.1 ?memberexDreamDuck15 Sep '10 - 9:44 
Well yes, it is planned (v2.0 with plenty of new features), but all the old versions still work in CodeRush 9 and 10+. In the installer just point to the new CodeRush plugins directory (it won't find it own its own anymore): C:\Program Files (x86)\DevExpress 2010.1\IDETools\System\CodeRush\BIN\PLUGINS
 
Especially the latest CR_Commenter v1.9 is one that me and many people use every day: http://abi.exdream.com/Blog/post/2008/11/27/CR_Commenter-v19-Autogenerate-comments-with-this-CodeRush-plugin.aspx[^]
DirectX MVP. My Blog: BenjaminNitschke.com

QuestionRe: New version for CodeRush 10.1 ?memberbobfox15 Sep '10 - 10:05 
Thanks for info - looking forward to v2.0 - any time frame?
 
BTW, any reason why it should not be installed to C:\Users\MyUsername\Documents\DevExpress\IDE Tools\Community\PlugIns ?
AnswerRe: New version for CodeRush 10.1 ?memberexDreamDuck15 Sep '10 - 11:35 
Dunno if that community works, it might (try it), but none of my installed CodeRush plugins end up there ..
DirectX MVP. My Blog: BenjaminNitschke.com

GeneralRe: New version for CodeRush 10.1 ?memberbobfox15 Sep '10 - 10:18 
Sorry, but I can't even install, because the Install button is always disabled, whatever destination folder I choose.
 
The same problem when I use the Browse button. The OK button inside the folder search dialog is always disabled.
GeneralRe: New version for CodeRush 10.1 ?memberexDreamDuck15 Sep '10 - 11:32 
Thats strange, once you choose a valid destination plugins directory (try these directories (v9 and v10, without x86 if your are not on a 64bit system): C:\Program Files (x86)\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins or C:\Program Files (x86)\DevExpress 2010.1\IDETools\System\CodeRush\BIN\PLUGINS).
You can however also just put the dll file yourself into that directory, you can download it here: http://abi.exdream.com/Blog/content/binary/CR_Commenter_dll.zip[^]
DirectX MVP. My Blog: BenjaminNitschke.com

GeneralRe: New version for CodeRush 10.2 ?memberRyan Beesley13 Jan '11 - 10:10 
On CodeRush 10.2, I was able to use the installer to put CR_Commenter.dll in "C:\Program Files\DevExpress 2010.2\IDETools\System\DXCore\BIN\PLUGINS". It does not appear to register with CodeRush and is not accessible in the options.
 
Based on the advice you gave, I moved it to "C:\Program Files\DevExpress 2010.2\IDETools\System\CodeRush\BIN\PLUGINS". This had the same result.
 
Opening the plugins from the DevExpress about screen, I saw that it was opening "C:\Users\[username]\Documents\DevExpress\IDE Tools\Community\PlugIns" as another place it looks for plugins... Unfortunately, that doesn't work either. Seems like this just won't work with CR 10.2?
GeneralRe: New version for CodeRush 10.2 ?memberexDreamDuck13 Jan '11 - 12:39 
Thanks for the feedback, I can only tell you that it works for us with the following plugins directory:
C:\Program Files (x86)\DevExpress 2010.1\IDETools\System\DXCore\BIN\PLUGINS
 
It should work the same way with 2010.2, but I will test it once I have time.
 
Obviously a update to the plugin is long overdue and once I find some time I will finish all the improvements and make a better installer that works with newer versions as well.
DirectX MVP. My Blog: BenjaminNitschke.com

GeneralRe: New version for CodeRush 10.2 ?membermohit vashistha11 May '11 - 20:02 
Any plans for the newer version of commenter Smile | :)
GeneralRe: New version for CodeRush 10.2 ?memberexDreamDuck14 May '11 - 16:57 
Good question. Actually I started working a bit on a VS2010 version and tried to make a DXCore2011 (.NET 4.0) plugin, but there is just too many features in the TODO list and not enough time. Currently our company focuses on the http://DeltaEngine.net multi-platform engine development and since our resources are limited we probably only will do some simpler VS plugins really required for engine development.
 
In the meantime I suggest using VS2010 extensions. We are great fans of VS Power Commands, VS Commands, Document Well 2010 and many more. I still use CodeRush all the time, but I recently also started using some of the VS10x extensions, especially the VS10x Editor View Enhancer and the VS10x Commenter extensions replace some of the functionality of CR_Commenter:
http://visualstudiogallery.msdn.microsoft.com/34eee02b-f1f6-433a-b210-62e94c0bcb87[^]
DirectX MVP. My Blog: BenjaminNitschke.com

QuestionCould this work for VB?memberKurt Nelezen26 May '09 - 3:00 
Benjamin,
 
I have been a fan of Commentor for a very long time. But My work has moved to VB.NET instead of C#. Your plug-in is one of the most useful tools I have used. Could this work for VB.NET?
 
Thanks,
Kurt
 
Kurt Nelezen

AnswerRe: Could this work for VB?memberexDreamDuck26 May '09 - 3:22 
Hi Kurt,
 
Sadly no VB support is implemented yet. There were a couple of guys doing some work for a VB version of CR_Commenter, but that work has never been completed and since I do use VB, it was never a priority to implement VB support. Its still in the TODO list, but I currently have no time to do any updates .. many C# features are also hardcoded and probably need some work to work in VB (or they can be disabled like for C++/Lua/fx, etc.).
 
Kind Regards,
Benjamin
 
DirectX MVP. My Blog: BenjaminNitschke.com

GeneralResort filememberFrancesca Mazzoni19 Feb '09 - 6:15 
In a previous version there was the possibility to resort the whole file putting variables and properties to top. Is this still possible. If so, how?
Thanks, Francesca
GeneralRe: Resort filememberexDreamDuck19 Feb '09 - 6:35 
Hi Francesca,
 
there was an idea on how to do that in something like v1.6 or v1.7, but it was never fully implemented and discarded for now. It will probably be implemented in a future version again and be made more useful (some tests for it only worked on very simple classes and it was too much work to get it to work on anything more complex).
 
Thanks for the feedback,
Benjamin
 
DirectX MVP. My Blog: BenjaminNitschke.com

GeneralBug: <returns></returns> param comments missing from v1.9memberPaulTissue9 Dec '08 - 6:23 
v1.7 used to include the <returns></returns> parameter comment tags for methods. v1.9 no longer includes these.
GeneralRe: Bug: param comments missing from v1.9memberexDreamDuck9 Dec '08 - 6:32 
That feature is still there, it is just disabled by default right now. Just enable XML Parameter generation in the feature options box.
 
DirectX MVP. My Blog: BenjaminNitschke.com

GeneralRe: Bug: param comments missing from v1.9memberPaulTissue26 Dec '08 - 8:50 
Thanks Benjamin,
 
When I enable "Also generate XML tags for all parameters" it does generate the tags for the parameters but not for the return type.
 
For example:
 
/// <summary>
/// Test
/// </summary>
/// <param name="i">I</param>
bool test(int i)
{
} // test()
 
is missing:
 
/// <returns>bool</returns>
 
This used to be included in previous releases.
 
Thank you for this very useful plugin!
GeneralOverdecorationmemberDmitri Nesteruk29 Nov '08 - 12:26 
It seems that, compared to ReSharper, CodeRush likes to add lots of pretty multi-colored decor to source code. I feel a but dizzy from all of this.
GeneralGhostDocmemberYoussef Abou-Kewik7 Sep '06 - 13:10 
Just as an FYI, http://www.roland-weigelt.de/ghostdoc/[^] will do the trick for free. Nice work on the plugin though Smile | :)
GeneralRe: GhostDocmemberexDreamDuck7 Sep '06 - 13:15 
Not really, GhostDoc just generates Xml Comments and it does not really work the same way.
In the Commenter generating Xml Comments is just one of many features, it can do much more: header generation, comments each block, generates comments for variables, properties, fields, etc. can do regions, expand or collapse stuff, etc.
 
DirectX MVP. My Blog: abi.exDream.com

QuestionCodeRush 2.0memberLassala17 Aug '06 - 5:08 
Can we make this plugin work with CodeRush 2.0? When I tried to install, it seemed I could only install if running CodeRush 1.1.
 
Thanks in Advance.
 
Claudio Lassala
AnswerRe: CodeRush 2.0 [modified]memberexDreamDuck17 Aug '06 - 14:55 
This problem is already fixed. This is a very simple issue (just copy the plugin from the 1.1 directory to the 2.0 directory).
 
I wrote about this on my blog, a new installer is also available there.
http://exdream.no-ip.info/blog/PermaLink.aspx?guid=ff40c42f-62f7-4e77-b0c2-dcaae0005bc7

 

-- modified at 20:55 Thursday 17th August, 2006
 
DirectX MVP. My Blog: abi.exDream.com

GeneralSome bugsmemberToAoM4 Apr '05 - 4:10 
Hey I've installed the plugin and it works like a charm... I've found a few bugs though.
 
If you add a comment to be added to each and every file such as this one:
 
#region Sourcesafe Properties
// $Archive: $
// $Revision: $
// $Date: $
// $Author: $
//
#region History
// $History: $
#endregion
#endregion
 
Then it comments out the forst three compiler directives. And it will include it, even if another comment block like this one (but with Visual Source Safe placeholder filled in) already exists.
 
It would also be nice if you could call this plugin by some key or menu item to add comments to all functions.
 
Lastly it would be nice if auto-comments on functions would be added to all (including private and internal) functions instead of just to public funtions.
GeneralRe: Some bugsmemberexDreamDuck4 Apr '05 - 4:15 
I will check that out. I also planing a little update with new features I needed last months (like adding always XML comments to non-public functions as you also noticed), there are also some bugs with the newest CodeRush version (CodeRush changed something with the parameter list).
 
So expect an update in the next couple of days ^^
 
My Blog: abi.exDream.com
GeneralRe: Some bugsmemberToAoM4 Apr '05 - 4:22 
Another thing I would really like is to auto add <param> tags to the XML comments.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 29 Nov 2008
Article Copyright 2004 by exDreamDuck
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid