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

Fix: throwstatement has wrong keyword #26

Merged
merged 1 commit into from
Sep 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/ReactiveMarbles.RoslynHelpers/SyntaxFactoryHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,17 @@ public static ThrowStatementSyntax ThrowStatement(IReadOnlyCollection<AttributeL
{
var attributeList = List(attributes, level, true);

return SyntaxFactory.ThrowStatement(attributeList, Token(SyntaxKind.ThrowStatement).AddTrialingSpaces(), expression, Token(SyntaxKind.SemicolonToken).AddTrialingNewLines());
return SyntaxFactory.ThrowStatement(attributeList, Token(SyntaxKind.ThrowKeyword).AddTrialingSpaces(), expression, Token(SyntaxKind.SemicolonToken).AddTrialingNewLines());
}

/// <summary>Creates a new <see cref="ThrowStatementSyntax" /> instance.</summary>
/// <param name="expression">The expression.</param>
/// <param name="level">The indentation level.</param>
/// <returns>The <see cref="ThrowStatementSyntax" /> instance.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ThrowStatementSyntax ThrowStatement(ExpressionSyntax expression, int level)
{
return SyntaxFactory.ThrowStatement(default, Token(SyntaxKind.ThrowKeyword).AddTrialingSpaces(), expression, Token(SyntaxKind.SemicolonToken).AddTrialingNewLines());
}

/// <summary>Creates a new <see cref="ThrowExpressionSyntax" /> instance.</summary>
Expand All @@ -1918,7 +1928,7 @@ public static ThrowStatementSyntax ThrowStatement(IReadOnlyCollection<AttributeL
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ThrowExpressionSyntax ThrowExpression(ExpressionSyntax expression)
{
return SyntaxFactory.ThrowExpression(Token(SyntaxKind.ThrowStatement).AddTrialingSpaces(), expression);
return SyntaxFactory.ThrowExpression(Token(SyntaxKind.ThrowKeyword).AddTrialingSpaces(), expression);
}

/// <summary>Creates a new <see cref="SyntaxToken" /> instance.</summary>
Expand Down