[DevExpress Support Team: CLONED FROM T436635: Organize Members - blank lines are left between Imports and Namespace]
Sub Main problem is gone, but now Organize Members is working strangely, try following:
Visual BasicImports System.IO
Imports System.Text
REM Organize Members on this line
Namespace Client
REM Then undo and on this line
Module Module1
REM Then undo and on this line
Sub Main()
End Sub
End Module
End Namespace
After Organize Members anywhere (except Region case), I am expecting this (with 0 Empty line count setting):
Visual BasicImports System.IO
Imports System.Text
Namespace Client
Module Module1
Sub Main()
End Sub
End Module
End Namespace
Thank you for providing the code sample. We agree that in all the cases you specified, the Organize Members should remove all line breaks in a file, We are working to correct the current behavior and will notify you of our progress. Also, please take a note that Organize Members is a context-dependent feature and the scope of its application can be different when it is executed from different locations:
- active type when the caret is located in any type
- active namespace when the caret is located in any namespace but not in any type
- active file when the caret is not located in any namespace.
It should not be context sensitive, because it is not clear what will be organized in given context.
Organize Members should always organize members in current opened file.
Hi Ondřej,
Organize Members is a context sensitive feature because there can be multiple classes in one namespace and nested classes. It's a common scenario to organize members just in one class and do not touch others. If you want to always apply Organize Members to the entire class, I suggest you use it as a part of Code CleanUp - enable the corresponding provider on the Editor\Code Style\Code CleanUp option page. Code CleanUp is always applied to the entire file.
I am against philosophy where same command works differently in different context. If you are not aware of exact functionality, you will use that instinctively and it can do something else than you expect.
There could be different commands - organize current class, organize current file, organize current namespace.
Hi Ondřej,
Thank you for sharing your ideas with us. We will discuss the possibility of making the Organize Members work for an entire file by default.
Remember Partial Class which is class scattered in multiple files…
Ondřej,
At present, Organize Members is limited to an active file only, so partial classes won't be touched.
This behavior is not changed in 16.1.8. I am disappointed.
This issue is not resolved yet. We will update the status of the ticket when it is fixed.
16.1.8.16313: Blank lines are left after one-lined comments.
Before Organize Members:
Imports System.IO Imports System.Text 'Comment 1 Namespace Client 'Comment 2 Module Module1 Sub Main() End Sub 'Comment 3 End Module End Namespace
After Organize Members:
Imports System.IO Imports System.Text 'Comment 1 Namespace Client 'Comment 2 Module Module1 Sub Main() End Sub 'Comment 3 End Module End Namespace
Hello,
I've created a separate ticket on your behalf (T449018: Organize Members doesn't remove trailing empty lines after a single line comment if the 'Remove existing line breaks' option is enabled). It has been placed in our processing queue and will be answered shortly.