Skip to content

Commit

Permalink
Create using directive using API instead of parse.
Browse files Browse the repository at this point in the history
Shot in the dark for #228
  • Loading branch information
JohanLarsson committed May 16, 2020
1 parent 7c566cb commit 8e0616d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ReflectionAnalyzers/Codefixes/BindingFlagsFix.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ReflectionAnalyzers
namespace ReflectionAnalyzers
{
using System.Collections.Immutable;
using System.Composition;
Expand All @@ -16,7 +16,11 @@ namespace ReflectionAnalyzers
[Shared]
internal class BindingFlagsFix : DocumentEditorCodeFixProvider
{
private static readonly UsingDirectiveSyntax SystemReflection = SyntaxFactory.UsingDirective(SyntaxFactory.ParseName("System.Reflection"));
private static readonly UsingDirectiveSyntax SystemReflection = SyntaxFactory.UsingDirective(
SyntaxFactory.QualifiedName(
SyntaxFactory.IdentifierName("System"),
SyntaxFactory.IdentifierName("Reflection")));

private static readonly ArgumentSyntax NullArgument = SyntaxFactory.Argument(SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression))
.WithAdditionalAnnotations(Formatter.Annotation);

Expand Down

0 comments on commit 8e0616d

Please sign in to comment.