Output: Show enum usages as their corresponding member names (CS0266, CS1750)

This commit is contained in:
Katy Coe
2019-11-29 08:37:46 +01:00
parent b36ccda9b9
commit da9252a68c
3 changed files with 25 additions and 9 deletions

View File

@@ -108,7 +108,8 @@ namespace Il2CppInspector.Reflection
(Position == 0 && DeclaringMethod.GetCustomAttributes("System.Runtime.CompilerServices.ExtensionAttribute").Any()? "this ":"")
+ $"{CustomAttributes.ToString(usingScope, inline: true, emitPointer: emitPointer, mustCompile: compileAttributes).Replace("[ParamArray]", "params")}"
+ $"{getCSharpSignatureString(usingScope)} {Name}"
+ (HasDefaultValue ? " = " + DefaultValue.ToCSharpValue() + (emitPointer && !(DefaultValue is null)? $" /* Metadata: 0x{(uint) DefaultValueMetadataAddress:X8} */" : "") : "");
+ (HasDefaultValue ? " = " + DefaultValue.ToCSharpValue(ParameterType, usingScope)
+ (emitPointer && !(DefaultValue is null)? $" /* Metadata: 0x{(uint) DefaultValueMetadataAddress:X8} */" : "") : "");
public string GetReturnParameterString(Scope scope) => !IsRetval? null : getCSharpSignatureString(scope);
}