Skip to content

Commit

Permalink
Update generator to support new #if/#else/#endif directives
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Sep 23, 2020
1 parent 26f8d96 commit f0bb7d5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bld/ExtensionsGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,17 @@ from md in g
select
MethodDeclaration(md.ReturnType, md.Identifier)
.WithAttributeLists(md.AttributeLists)
.WithModifiers(md.Modifiers)
.WithModifiers(
new SyntaxTokenList(
md.Modifiers[0]
.WithLeadingTrivia(
from lt in md.Modifiers[0].LeadingTrivia
where lt.Kind() != SyntaxKind.DisabledTextTrivia
where lt.Kind() != SyntaxKind.IfDirectiveTrivia
where lt.Kind() != SyntaxKind.ElseDirectiveTrivia
where lt.Kind() != SyntaxKind.EndIfDirectiveTrivia
select lt),
md.Modifiers[1]))
.WithTypeParameterList(md.TypeParameterList)
.WithConstraintClauses(md.ConstraintClauses)
.WithParameterList(md.ParameterList)
Expand Down

0 comments on commit f0bb7d5

Please sign in to comment.