Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Commit d183dac

Browse files
committed
Review fix
1 parent f95ca5a commit d183dac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CodeGeneration.Roslyn/DocumentTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static async Task<SyntaxTree> TransformAsync(CSharpCompilation compilatio
5050

5151
var inputFileLevelUsingDirectives = inputSyntaxTree.GetRoot().ChildNodes().OfType<UsingDirectiveSyntax>();
5252

53-
var memberNodes = inputSyntaxTree.GetRoot().DescendantNodesAndSelf().OfType<CSharpSyntaxNode>();
53+
var memberNodes = inputSyntaxTree.GetRoot().DescendantNodesAndSelf(n => n is CompilationUnitSyntax || n is NamespaceDeclarationSyntax || n is TypeDeclarationSyntax).OfType<CSharpSyntaxNode>();
5454

5555
var emittedMembers = SyntaxFactory.List<MemberDeclarationSyntax>();
5656
foreach (var memberNode in memberNodes)

0 commit comments

Comments
 (0)