OK - so where evaluating the New CodeRush (we previously bought some licenses for the Classic but now we evaulating whether we should buy for the whole team.)
Organize Members :
We currently use CodeMaid to reorganize our code - it works - it puts everything in regions the way we want - there are a few issues with spacing but nothing major.
If we purchase your product we hope to load one less tool and use your "Organize Members" but when I invoke that function something happens but it is not what I want. Code elements are not moved together (a public method at the top of the file is still there and not moved to the region where all the other public methods are.) The order of the elements does not match the order established in the "Editor\All Languages\Organize Members" and I do not see an "Editor\Visual Basic\Organize Members" section. Is this function broken?
Code Issues:
I don't see the same range of issues that CodeRush classic was able to report. (I like what I see and it is certainly much less of a resource burden.) It does seem from the documentation that the tool might be open to including 3rd party and self-authored Static Analyzers in the future. Is this true? Is there (or will there be) a defined way to add analyzers to the cataloging of Code Issues? Also, will the analyzers available in Classic be added to the current version?
My dream issue would be the identification of "Late Binding calls" - been a while since I fiddled with Roslyn but it would seem like it should be able to identify late-binding calls. Is that possible? (Obviously, my code is a absolute mess and anything that would help clean it up would be greatly appreciated.) Just a thought.
You are really the only people who take the problems of VB developer seriously (and tho we'd all love not to be VB developers it looks like that road will be closed if we can't use a tool like yours to get over some immediate hurdles.)
Thanks, Charles C. Poston
Hi Charles,
Thank you for contacting us and you interest in our new product.
To help you customize еру Organize Members feature for you needs, it would be great if you provide us with two files: one with the initial code and the other with code that you expect after applying this feature. As for settings of this feature, they are not grouped by languages and the "Editor\All Languages\Organize Members" options have effect both on C# and Visual Basic.
> It does seem from the documentation that the tool might be open to including 3rd party and self-authored Static Analyzers in the future. Is this true? Is there (or will there be) a defined way to add analyzers to the cataloging of Code Issues?
CodeRush static analysis can include self-authored analyzers. Please give us some time to prepare a sample demonstrating it. Currently, 3rd-party analyzers cannot be included in the CodeRush static analysis but the Code Issue window has the Load from Visual Studio mode that allows displaying results of Visual Studio background analysis including 3rd-party analyzers.
> Also, will the analyzers available in Classic be added to the current version?
Porting CodeRush Classic analyzers is in our backlog. Probably, we will not port all CodeRush Classic code issues but only most useful ones. If there are some features that you used in CodeRush Classic and that are missing in new CodeRush, then please let us know about them. It will help us prioritize our plans.
> My dream issue would be the identification of "Late Binding calls" - been a while since I fiddled with Roslyn but it would seem like it should be able to identify late-binding calls. Is that possible? (Obviously, my code is a absolute mess and anything that would help clean it up would be greatly appreciated.) Just a thought.
We will try to implement this functionality in the context of a self-authored analyzer sample.
> You are really the only people who take the problems of VB developer seriously (and tho we'd all love not to be VB developers it looks like that road will be closed if we can't use a tool like yours to get over some immediate hurdles.)
Thank you for your compliments. Good support for Visual Basic has high priority for us and we will make every effort to ensure that our product meets your needs.
Only change in options are I defined a Public Fields and a Private Fields and specified a different order.
' This code does not "organize":
Public Class DisorganizedClass
Public Property FrogName As String
Get
Return frogName_
End Get
Set(value As String)
frogName_ = value
End Set
End Property
Public ReadOnly Property IsMonkeyWrench As Boolean
Get
Return String.IsNullOrEmpty(monkeyKing)
End Get
End Property
Private princeName_ As String
Private isMonkeyWrench_ As Boolean
Private Shared monkeyKing As String
#Region "Public Methods"
Public Sub ConvertToPrince()
PrinceName = $"Sir {frogName_}"
End Sub
Public PrincessName As String
Public Function Kiss() As Boolean
Return TakeAChance()
End Function
#End Region
Private frogName_ As String
Public Sub New()
End Sub
Public Sub New(princess As String, frog As String)
PrincessName = princess
FrogName = frog
End Sub
Private Function Seduce() As Boolean
Return Not String.IsNullOrEmpty(PrinceName)
End Function
#Region "Private Methods"
Private Function TakeAChance() As Boolean
Return String.IsNullOrEmpty(PrinceName)
End Function
#End Region
#Region "Public Properties"
Public Property PrinceName As String
Get
Return princeName_
End Get
Set(value As String)
princeName_ = value
End Set
End Property
#End Region
End Class
' It does this:
Public Class DisorganizedClass
Public Property FrogName As String
Get
Return frogName_
End Get
Set(value As String)
frogName_ = value
End Set
End Property
Public ReadOnly Property IsMonkeyWrench As Boolean
Get
Return String.IsNullOrEmpty(monkeyKing)
End Get
End Property
#Region "Public Properties"
Public Property PrinceName As String
Get
Return princeName_
End Get
Set(value As String)
princeName_ = value
End Set
End Property
#End Region
Public Sub New()
End Sub
Public Sub New(princess As String, frog As String)
PrincessName = princess
FrogName = frog
End Sub
Private Function Seduce() As Boolean
Return Not String.IsNullOrEmpty(PrinceName)
End Function
#Region "Private Methods"
Private Function TakeAChance() As Boolean
Return String.IsNullOrEmpty(PrinceName)
End Function
#End Region
Private Shared monkeyKing As String
Private frogName_ As String
Private isMonkeyWrench_ As Boolean
Private princeName_ As String
#Region "Public Methods"
Public Sub ConvertToPrince()
PrinceName = $"Sir {frogName_}"
End Sub
Public PrincessName As String
Public Function Kiss() As Boolean
Return TakeAChance()
End Function
#End Region
End Class
So, like it doesn't move anything inside of a region? The organize doesn't REDO the regions to match the code organization? (CodeMaid works that way.) You'll see that 'PrincessName' is still inside of "Public Methods" and tho the "Private Fields" are grouped they do not have a region. Is there something I'm missing about regions? (I absoluutely hate regions in C# code but VB code is soooo ugly that I can't live without them!) I have a tool that will remove regions and then the "organize" seems to work better but I would prefer to have the option of having the "organize" manage the regions. What about it?
Hi Charles,
Thank you for your clarification and providing the code sample.
By default, the Organize Members feature doesn't wrap groups into regions. So, it keeps existing groups that are already wrapped into regions. To get the required behavior, it is necessary to modify default Organize Members options. For every rule, it is possible to add wrapping into the region. In this case, the existing regions with the same name will be removed from code before applying and members that were wrapped into these regions will be regrouped.
I have recorded a screencast that demonstrates customizing wrapping into regions and applying the Organize Members feature in your code. I have attached this screencast to this comment. Please let us know whether it meets your needs.
OK - so now I understand. Lots of setup. Any chance that could be the default? (Even just for VB?)
Also! What about embedded classes? I created a private class and that seems to work but an embedded public class doesn't properly work. It wraps the outer class and leaves the inner where it is.
Hi Charles,
> Any chance that could be the default? (Even just for VB?)
We don't have plans to change default options for the Organize Members feature. But we agree that currently customizing wrapping groups into regions require many actions. We will discuss how to simplify this scenario.
> What about embedded classes? I created a private class and that seems to work but an embedded public class doesn't properly work. It wraps the outer class and leaves the inner where it is.
I have tried to reproduce this issue but on my side Organize Members work correctly with embedded classes. I have created the following rule:

This screencast illustrates how it works on my side. Please check whether your rule differs from mine. If yes, provide me with your rule. Also, take note that we found the issue with wrapping the AND rule to the Region rule (it resets kinds to the Node kind). We have fixed this issue but it is possible that it had effect in your case.
OK - understandable and once it is done it is done. However! How do I get a new line around the region? The whitespace setting inside the rule is respected but the region itself has no newline after or before the end of it - how do I do that?
To customize adding a line between regions, please set the "Empty line count between groups" option to "1".
Charles,
Please accept my apologies for the inaccuracy in one of my previous posts.
> CodeRush static analysis can include self-authored analyzers.
Currently, CodeRush doesn't provide this possibility. We will consider implementing this functionality in future updates.
We have prepared the sample extension with a standard Visual Studio analyzer that detects late bound calls. I have attached the archive that contains the source files and VSIX-installation file of this extension. After installing it, Visual Studio will show warning messages for calls that use late binding:

Also, please note that the Visual Basic compiler can automatically detect late bindings in code when the Strict On option is enabled:

In this case, a compilation error will be thrown:

I have empty line count set to 1 between groups (and it works.) What I am talking about is an empty line betwen language elements and the group. For example, I get this:
Start with:
Public Class EL
[Public Properties Region collapsed]
[Public Methods Region collapsed]
Ends with:
Public Class EL
[Public Properties Region collapsed]
[Public Methods Region collapsed]
I want:
Public Class EL
[Public Properties Region collapsed]
[Public Methods Region collapsed]
How do I get that top line?
LateBindingAnalyzer won't install on 2015 Enterprise and I am not allowed 2017 yet so I can't recompile. Will you please target that environment and recompile?
Thank you for your clarification and providing the code sample.
Currently, Organize Members don't add empty lines before the first group and after the last one. We agree that the option to change this behavior will be useful and we will add it in future updates.
Also, I have attached the analyzer that is compatible with Visual Studio 2015.
Still getting Installation Failed:
2/8/2018 2:12:32 PM - Microsoft VSIX Installer
2/8/2018 2:12:32 PM - -------------------------------------------
2/8/2018 2:12:32 PM - Initializing Install…
2/8/2018 2:12:32 PM - Extension Details…
2/8/2018 2:12:32 PM - Identifier : LateBindingAnalyzer.e5a08f9c-20d9-4cb2-bb2c-e34b9c7c6193
2/8/2018 2:12:32 PM - Name : LateBindingAnalyzer
2/8/2018 2:12:32 PM - Author : kotkov
2/8/2018 2:12:32 PM - Version : 1.0
2/8/2018 2:12:32 PM - Description : This is a sample diagnostic extension for the .NET Compiler Platform ("Roslyn").
2/8/2018 2:12:32 PM - Locale : en-US
2/8/2018 2:12:32 PM - MoreInfoURL :
2/8/2018 2:12:32 PM - InstalledByMSI : False
2/8/2018 2:12:32 PM - SupportedFrameworkVersionRange : [4.5,)
2/8/2018 2:12:32 PM -
2/8/2018 2:12:32 PM - SignatureState : Unsigned
2/8/2018 2:12:32 PM - Supported Products :
2/8/2018 2:12:32 PM - Microsoft.VisualStudio.Community
2/8/2018 2:12:32 PM - Version : [15.0,)
2/8/2018 2:12:32 PM -
2/8/2018 2:12:32 PM - References :
2/8/2018 2:12:32 PM - Signature Details…
2/8/2018 2:12:32 PM - Extension is not signed.
2/8/2018 2:12:32 PM -
2/8/2018 2:12:32 PM - Searching for applicable products…
2/8/2018 2:12:34 PM - Found installed product - Microsoft Visual Studio Enterprise 2015
2/8/2018 2:12:34 PM - Found installed product - Microsoft Visual Studio Professional 2015
2/8/2018 2:12:34 PM - Found installed product - Microsoft Visual Studio Community 2015
2/8/2018 2:12:34 PM - Found installed product - Microsoft Visual Studio 2015 Shell (Integrated)
2/8/2018 2:12:34 PM - Found installed product - Global Location
2/8/2018 2:12:34 PM - Found installed product - ssms
2/8/2018 2:12:34 PM - Found installed product - ssms
2/8/2018 2:12:34 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported)
at VSIXInstaller.App.InitializeInstall()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
I have "Microsoft Visual Studio Enterprise 2015"
Thank you for providing the VSIX-installation log. I have attached the archive with the updated extension.
Thanks you so much that worked like a charm! (Altho, I think the printed line number is 1 off.?!)
I still have a few issues with trying to organize embedded classes. Would it be better to continue that subject here or elsewhere? (Need to make a postable sample and I am swamped today.)
Thank you for informing us of your results. We are happy to hear that this analyzer works on your side.
> I think the printed line number is 1 off.?!
I do not quite understand what you mean. Please describe it in more detail.
> I still have a few issues with trying to organize embedded classes. Would it be better to continue that subject here or elsewhere?
Please report these issues in a separate ticket. It will help us to process them more efficiently.
Sorry I was being too cryptic. What I meant is that the line number reported in the Code Issues list is 1 less than the line that contains the late bound call. For example, list shows:
(1233,20) Warning AA0001 : The call is late bound.
And the code is:
1233:
1234: If (CompToCheck.TrackName = FirstTrackFound) And (Not LimitsChangeDetected) Then
No big thing. Haven't looked at the source to determine why. (Don't really care - the warning is more accurate and specific than my Awk code.)
Will post new entry on "Organize Members" (if I can get to it today.)
Thank you for your clarification. To process the issue with an incorrect line number more efficiently, I've created a separate ticket on your behalf: Code Issues - An incorrect line number is shown for issues loaded from Visual Studio. Let's continue our discussion there.
We appreciate your cooperation and are looking forward to your additional feedback on "Organize Members".
Hi Charles,
We have added the "Insert empty lines into type declaration" option for the Organize members feature. It customizes adding empty lines before the first group and after the last one. The following hotfix contains this functionality: DevExpress.CodeRush.Roslyn-17.2.6.18050.vsix.
Please install it and let us know whether it satisfies your needs.