Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH2820: Adds DebuggerStepThroughAttribute to generated code. #2821

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void Generic_ExtensionMethod<TTest>()
[System.Diagnostics.DebuggerStepThrough]
public void Generic_ExtensionMethod<TTest>()
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethod<TTest>(Context);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public TTest Generic_ExtensionMethodWithGenericReturnValue<TTest>(TTest value)
[System.Diagnostics.DebuggerStepThrough]
public TTest Generic_ExtensionMethodWithGenericReturnValue<TTest>(TTest value)
{
return Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethodWithGenericReturnValue<TTest>(Context, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public TOut Generic_ExtensionMethodWithGenericReturnValueAndTypeParamConstraints<TIn, TOut>(TIn arg)
[System.Diagnostics.DebuggerStepThrough]
public TOut Generic_ExtensionMethodWithGenericReturnValueAndTypeParamConstraints<TIn, TOut>(TIn arg)
where TIn : class, new()
where TOut : System.Collections.ArrayList, System.IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void Generic_ExtensionMethodWithParameter<TTest>(TTest value)
[System.Diagnostics.DebuggerStepThrough]
public void Generic_ExtensionMethodWithParameter<TTest>(TTest value)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethodWithParameter<TTest>(Context, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithArrayParameter(System.String[] values)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithArrayParameter(System.String[] values)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithArrayParameter(Context, values);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public dynamic NonGeneric_ExtensionMethodWithDynamicReturnValue()
[System.Diagnostics.DebuggerStepThrough]
public dynamic NonGeneric_ExtensionMethodWithDynamicReturnValue()
{
return Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithDynamicReturnValue(Context);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithGenericCollectionOfNestedType(System.Collections.Generic.ICollection<Cake.Core.Tests.Data.MethodAliasGeneratorData.TestNestedEnum> items)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericCollectionOfNestedType(System.Collections.Generic.ICollection<Cake.Core.Tests.Data.MethodAliasGeneratorData.TestNestedEnum> items)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericCollectionOfNestedType(Context, items);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithGenericExpressionArrayParameter(System.Linq.Expressions.Expression<System.Func<System.String, System.String>>[] expression)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericExpressionArrayParameter(System.Linq.Expressions.Expression<System.Func<System.String, System.String>>[] expression)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionArrayParameter(Context, expression);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithGenericExpressionParameter(System.Linq.Expressions.Expression<System.Func<System.String, System.String>> expression)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericExpressionParameter(System.Linq.Expressions.Expression<System.Func<System.String, System.String>> expression)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionParameter(Context, expression);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithGenericExpressionParamsArrayParameter(params System.Linq.Expressions.Expression<System.Func<System.String, System.String>>[] expression)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericExpressionParamsArrayParameter(params System.Linq.Expressions.Expression<System.Func<System.String, System.String>>[] expression)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionParamsArrayParameter(Context, expression);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithGenericParameter(System.Action<System.Int32> value)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericParameter(System.Action<System.Int32> value)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericParameter(Context, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithNoParameters()
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithNoParameters()
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithNoParameters(Context);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalBooleanParameter(System.Int32 value, System.Boolean flag = false)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalBooleanParameter(System.Int32 value, System.Boolean flag = false)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalBooleanParameter(Context, value, flag);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalCharParameter(System.String s, System.Char c = 's')
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalCharParameter(System.String s, System.Char c = 's')
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalCharParameter(Context, s, c);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalDecimalParameter(System.String s, System.Decimal value = (System.Decimal)12.12)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalDecimalParameter(System.String s, System.Decimal value = (System.Decimal)12.12)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalDecimalParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalEnumParameter(System.Int32 value, System.AttributeTargets targets = (System.AttributeTargets)4)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalEnumParameter(System.Int32 value, System.AttributeTargets targets = (System.AttributeTargets)4)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalEnumParameter(Context, value, targets);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableBooleanParameter(System.String s, System.Nullable<System.Boolean> value = (System.Boolean)false)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableBooleanParameter(System.String s, System.Nullable<System.Boolean> value = (System.Boolean)false)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableBooleanParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableCharParameter(System.String s, System.Nullable<System.Char> value = (System.Char)'s')
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableCharParameter(System.String s, System.Nullable<System.Char> value = (System.Char)'s')
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableCharParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableDecimalParameter(System.String s, System.Nullable<System.Decimal> value = (System.Decimal)123.12)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableDecimalParameter(System.String s, System.Nullable<System.Decimal> value = (System.Decimal)123.12)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableDecimalParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableDoubleParameter(System.String s, System.Nullable<System.Double> value = (System.Double)1234567890.12)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableDoubleParameter(System.String s, System.Nullable<System.Double> value = (System.Double)1234567890.12)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableDoubleParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableEnumParameter(System.String s, System.Nullable<System.AttributeTargets> targets = (System.AttributeTargets)4)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableEnumParameter(System.String s, System.Nullable<System.AttributeTargets> targets = (System.AttributeTargets)4)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableEnumParameter(Context, s, targets);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableLongParameter(System.String s, System.Nullable<System.Int64> value = (System.Int64)1234567890)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableLongParameter(System.String s, System.Nullable<System.Int64> value = (System.Int64)1234567890)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableLongParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalNullableTParameter(System.String s, System.Nullable<System.Int32> value = (System.Int32)0)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalNullableTParameter(System.String s, System.Nullable<System.Int32> value = (System.Int32)0)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalNullableTParameter(Context, s, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalObjectParameter(System.Int32 value, System.Object option = null)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalObjectParameter(System.Int32 value, System.Object option = null)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalObjectParameter(Context, value, option);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOptionalStringParameter(System.Int32 value, System.String s = "there is a \"string\" here and a \t tab")
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOptionalStringParameter(System.Int32 value, System.String s = "there is a \"string\" here and a \t tab")
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOptionalStringParameter(Context, value, s);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithOutputParameter(out System.IDisposable arg)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithOutputParameter(out System.IDisposable arg)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithOutputParameter(Context, out arg);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithParameter(System.Int32 value)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithParameter(System.Int32 value)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithParameter(Context, value);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithParameterArray(params System.Int32[] values)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithParameterArray(params System.Int32[] values)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithParameterArray(Context, values);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithParameterAttributes([System.Runtime.CompilerServices.CallerMemberName] System.String memberName = "", [System.Runtime.CompilerServices.CallerFilePath] System.String sourceFilePath = "", [System.Runtime.CompilerServices.CallerLineNumber] System.Int32 sourceLineNumber = (System.Int32)0)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithParameterAttributes([System.Runtime.CompilerServices.CallerMemberName] System.String memberName = "", [System.Runtime.CompilerServices.CallerFilePath] System.String sourceFilePath = "", [System.Runtime.CompilerServices.CallerLineNumber] System.Int32 sourceLineNumber = (System.Int32)0)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithParameterAttributes(Context, memberName, sourceFilePath, sourceLineNumber);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void NonGeneric_ExtensionMethodWithReservedKeywordParameter(System.Int32 @new)
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithReservedKeywordParameter(System.Int32 @new)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithReservedKeywordParameter(Context, @new);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public System.String NonGeneric_ExtensionMethodWithReturnValue()
[System.Diagnostics.DebuggerStepThrough]
public System.String NonGeneric_ExtensionMethodWithReturnValue()
{
return Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithReturnValue(Context);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void Obsolete_ExplicitError_WithMessage()
[System.Diagnostics.DebuggerStepThrough]
public void Obsolete_ExplicitError_WithMessage()
{
throw new Cake.Core.CakeException("The alias Obsolete_ExplicitError_WithMessage has been made obsolete. Please use Foo.Bar instead.");
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void Obsolete_ExplicitWarning_WithMessage()
[System.Diagnostics.DebuggerStepThrough]
public void Obsolete_ExplicitWarning_WithMessage()
{
Context.Log.Warning("Warning: The alias Obsolete_ExplicitWarning_WithMessage has been made obsolete. Please use Foo.Bar instead.");
#pragma warning disable 0618
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void Obsolete_ImplicitWarning_NoMessage()
[System.Diagnostics.DebuggerStepThrough]
public void Obsolete_ImplicitWarning_NoMessage()
{
Context.Log.Warning("Warning: The alias Obsolete_ImplicitWarning_NoMessage has been made obsolete.");
#pragma warning disable 0618
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public void Obsolete_ImplicitWarning_WithMessage()
[System.Diagnostics.DebuggerStepThrough]
public void Obsolete_ImplicitWarning_WithMessage()
{
Context.Log.Warning("Warning: The alias Obsolete_ImplicitWarning_WithMessage has been made obsolete. Please use Foo.Bar instead.");
#pragma warning disable 0618
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
private dynamic _Cached_Dynamic_Type;
public dynamic Cached_Dynamic_Type
{
[System.Diagnostics.DebuggerStepThrough]
get
{
if (_Cached_Dynamic_Type==null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public System.Int32 Cached_Obsolete_ExplicitError_WithMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
throw new Cake.Core.CakeException("The alias Cached_Obsolete_ExplicitError_WithMessage has been made obsolete. Please use Foo.Bar instead.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[Obsolete("Please use Foo.Bar instead.")]
public System.Int32 Cached_Obsolete_ExplicitWarning_WithMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
Context.Log.Warning("Warning: The alias Cached_Obsolete_ExplicitWarning_WithMessage has been made obsolete. Please use Foo.Bar instead.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[Obsolete]
public System.Int32 Cached_Obsolete_ImplicitWarning_NoMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
Context.Log.Warning("Warning: The alias Cached_Obsolete_ImplicitWarning_NoMessage has been made obsolete.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[Obsolete("Please use Foo.Bar instead.")]
public System.Int32 Cached_Obsolete_ImplicitWarning_WithMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
Context.Log.Warning("Warning: The alias Cached_Obsolete_ImplicitWarning_WithMessage has been made obsolete. Please use Foo.Bar instead.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
private System.String _Cached_Reference_Type;
public System.String Cached_Reference_Type
{
[System.Diagnostics.DebuggerStepThrough]
get
{
if (_Cached_Reference_Type==null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
private System.Boolean? _Cached_Value_Type;
public System.Boolean Cached_Value_Type
{
[System.Diagnostics.DebuggerStepThrough]
get
{
if (_Cached_Value_Type==null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public dynamic NonCached_Dynamic_Type
{
[System.Diagnostics.DebuggerStepThrough]
get
{
return Cake.Core.Tests.Data.PropertyAliasGeneratorData.NonCached_Dynamic_Type(Context);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public System.Int32 NonCached_Obsolete_ExplicitError_WithMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
throw new Cake.Core.CakeException("The alias NonCached_Obsolete_ExplicitError_WithMessage has been made obsolete. Please use Foo.Bar instead.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public System.Int32 NonCached_Obsolete_ExplicitWarning_WithMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
Context.Log.Warning("Warning: The alias NonCached_Obsolete_ExplicitWarning_WithMessage has been made obsolete. Please use Foo.Bar instead.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public System.Int32 NonCached_Obsolete_ImplicitWarning_NoMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
Context.Log.Warning("Warning: The alias NonCached_Obsolete_ImplicitWarning_NoMessage has been made obsolete.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public System.Int32 NonCached_Obsolete_ImplicitWarning_WithMessage
{
[System.Diagnostics.DebuggerStepThrough]
get
{
Context.Log.Warning("Warning: The alias NonCached_Obsolete_ImplicitWarning_WithMessage has been made obsolete. Please use Foo.Bar instead.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public System.Int32 NonCached_Value_Type
{
[System.Diagnostics.DebuggerStepThrough]
get
{
return Cake.Core.Tests.Data.PropertyAliasGeneratorData.NonCached_Value_Type(Context);
Expand Down
1 change: 1 addition & 0 deletions src/Cake.Core/Scripting/CodeGen/MethodAliasGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static string Generate(MethodInfo method, out string hash)
var parameters = method.GetParameters().Skip(1).ToArray();

// Generate method signature.
builder.AppendLine("[System.Diagnostics.DebuggerStepThrough]");
builder.Append("public ");
builder.Append(GetReturnType(method));
builder.Append(" ");
Expand Down
Loading