Output: Include using directives for assembly-level attribute namespaces
This commit is contained in:
@@ -66,6 +66,12 @@ namespace Il2CppInspector
|
|||||||
code.Append(text + "\n");
|
code.Append(text + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine assemblies used in this file
|
||||||
|
var assemblies = types.Select(t => t.Assembly).Distinct();
|
||||||
|
|
||||||
|
// Add assembly attribute namespaces to reference list
|
||||||
|
nsRefs.UnionWith(assemblies.SelectMany(a => a.CustomAttributes).Select(a => a.AttributeType.Namespace));
|
||||||
|
|
||||||
// Determine using directives (put System namespaces first)
|
// Determine using directives (put System namespaces first)
|
||||||
var usings = nsRefs.OrderBy(n => (n.StartsWith("System.") || n == "System") ? "0" + n : "1" + n);
|
var usings = nsRefs.OrderBy(n => (n.StartsWith("System.") || n == "System") ? "0" + n : "1" + n);
|
||||||
|
|
||||||
@@ -74,9 +80,6 @@ namespace Il2CppInspector
|
|||||||
if (nsRefs.Any())
|
if (nsRefs.Any())
|
||||||
writer.Write("\n");
|
writer.Write("\n");
|
||||||
|
|
||||||
// Determine assemblies used in this file
|
|
||||||
var assemblies = types.Select(t => t.Assembly).Distinct();
|
|
||||||
|
|
||||||
// Output assembly information and attributes
|
// Output assembly information and attributes
|
||||||
writer.Write(generateAssemblyInfo(assemblies) + "\n\n");
|
writer.Write(generateAssemblyInfo(assemblies) + "\n\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user