Reporter | Werner Strydom (bloudraak) |
---|---|
Created | Jan 21, 2012 4:22:25 AM |
Updated | Jan 21, 2012 4:22:25 AM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Evgeny Pasynkov (pasynkov) |
Subsystem | Code Cleanup |
Affected versions | 6.1 |
Fixed in build | No Fixed in build |
Consider the following code:
Now select to "cleanup code". Notice that fields are not reordered. Remove the #pgrama statements from field1, so that the class looks as follows:
Select to cleanup the code. Notice that the members are correctly reordered as follows:
It seems that the pragma statements prevent code from being reordered. I would expect ReSharper to still reorder members and keep the pragma statements around the respective methods.
internal class Class1 { public void Method1() { } public string Property2 { get; set; } #pragma warning disable 649 private int _field1; #pragma warning restore 649 public void Method2() { } public string Property1 { get; set; } }
Now select to "cleanup code". Notice that fields are not reordered. Remove the #pgrama statements from field1, so that the class looks as follows:
internal class Class1 { public void Method1() { } public string Property2 { get; set; } private int _field1; public void Method2() { } public string Property1 { get; set; } }
Select to cleanup the code. Notice that the members are correctly reordered as follows:
internal class Class1 { private int _field1; public string Property2 { get; set; } public string Property1 { get; set; } public void Method1() { } public void Method2() { } }
It seems that the pragma statements prevent code from being reordered. I would expect ReSharper to still reorder members and keep the pragma statements around the respective methods.