public static void ComputeRefactoring(RefactoringContext context, LiteralExpressionSyntax literalExpression) { HexNumericLiteralExpressionInfo info = SyntaxInfo.HexNumericLiteralExpressionInfo(literalExpression); if (!info.Success) { return; } LiteralExpressionSyntax newLiteralExpression = CSharpFactory.LiteralExpression(info.Value); context.RegisterRefactoring( $"Replace '{info.Text}' with '{newLiteralExpression}'", cancellationToken => RefactorAsync(context.Document, literalExpression, newLiteralExpression, cancellationToken)); }
public static void ComputeRefactoring(RefactoringContext context, LiteralExpressionSyntax literalExpression) { HexNumericLiteralExpressionInfo info = SyntaxInfo.HexNumericLiteralExpressionInfo(literalExpression); if (!info.Success) { return; } LiteralExpressionSyntax newLiteralExpression = CSharpFactory.LiteralExpression(info.Value); context.RegisterRefactoring( $"Convert to '{newLiteralExpression}'", cancellationToken => RefactorAsync(context.Document, literalExpression, newLiteralExpression, cancellationToken), RefactoringIdentifiers.ConvertHexadecimalLiteralToDecimalLiteral); }