Skip to content

Commit

Permalink
fix: keep end of line trivia
Browse files Browse the repository at this point in the history
  • Loading branch information
dupdob committed Nov 22, 2024
1 parent 8828756 commit f34711e
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 381 deletions.
100 changes: 50 additions & 50 deletions src/Stryker.Abstractions/packages.lock.json

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions src/Stryker.CLI/Stryker.CLI.UnitTest/packages.lock.json

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions src/Stryker.CLI/Stryker.CLI/packages.lock.json

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions src/Stryker.Core/Stryker.Core.UnitTest/packages.lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/Stryker.Core/Stryker.Core/Helpers/RoslynHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ public static T WithCleanTriviaFrom<T>(this T node, T triviaSource) where T: Syn
/// <returns>a <paramref name="node"/> copy with some trivia from <paramref name="triviaSource"/>.</returns>
/// <remarks>Current implementation only applies whitespacetrivia (no comment, no attribute nor directives)</remarks>
public static SyntaxToken WithCleanTriviaFrom(this SyntaxToken token, SyntaxToken triviaSource)
=> token.WithLeadingTrivia(triviaSource.LeadingTrivia.Where(t=>t.IsKind(SyntaxKind.WhitespaceTrivia)))
.WithTrailingTrivia(triviaSource.TrailingTrivia.Where(t=>t.IsKind(SyntaxKind.WhitespaceTrivia)));
=> token.WithLeadingTrivia(triviaSource.LeadingTrivia.Where(t=>t.IsKind(SyntaxKind.WhitespaceTrivia) || t.IsKind(SyntaxKind.EndOfLineTrivia)))
.WithTrailingTrivia(triviaSource.TrailingTrivia.Where(t=>t.IsKind(SyntaxKind.WhitespaceTrivia) || t.IsKind(SyntaxKind.EndOfLineTrivia)));



/// <summary>
/// Gets the return 'type' of a (get/set) accessor
Expand Down
108 changes: 54 additions & 54 deletions src/Stryker.Core/Stryker.Core/packages.lock.json

Large diffs are not rendered by default.

102 changes: 51 additions & 51 deletions src/Stryker.Options/packages.lock.json

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions src/Stryker.Utilities/packages.lock.json

Large diffs are not rendered by default.

0 comments on commit f34711e

Please sign in to comment.