-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Using: ilspycmd 9.1.0.8007 from latest HEAD 57cd68f as of today.
Problem
I'm decompiling a (private) program across updates and reviewing the differences. The program uses attributes, and for some surely valid technical reasons either on the compiler or decompiler side, the order changes in the decompiler output.
Example 1:
[A]
[B]
void Method()
Example 2:
[B]
[A]
void Method()
Diff:
-[A]
[B]
+[A]
void Method()
This produces unnecessary noise in the difference, because nothing significantly changed. I'd like to reduce this noise to make code reviews across updates easier.
According to the C# attribute specification, the order is not significant:
The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant. For instance, the attribute specifications [A][B], [B][A], [A, B], and [B, A] are equivalent.
Proposed solution
Implement a stable attribute ordering, for instance a regular alphabetical sort.
If you agree in principle, I'd be happy to work on this and send a pull request. However, I'm not familiar with the codebase, so I welcome any pointers where the code changes would be best made.
Thank you!