1
Vote

Remove the word Attribute from Attributes in generated code and optionally remove namespaces

description

The code generated by this tool is very verbose. Since the general use case is to hand edit the generated code, it should be made more terser for readability.
 
First of all all attribute decorations should not include the word Attribute. e.g DllImportAttribute should become DllImport. Secondly, there should be an option to not qualify attributes with namespaces. Here is a real life example:
 
Currently:
[System.Runtime.InteropServices.DllImportAttribute("<Unknown>", EntryPoint="TraceOpenLogFile")]
public static extern short TraceOpenLogFile(
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder s, 
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] System.Text.StringBuilder t, 
uint w) ;
 
After
[DllImport("<Unknown>", EntryPoint="TraceOpenLogFile")]
public static extern short public static short TraceOpenLogFile(
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder s, 
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder t, 
uint w);
 
 
In both cases i formatted the code slightly.

comments