167 references to EndOfLineTrivia
Microsoft.AspNetCore.App.CodeFixes (1)
Authorization\AddAuthorizationBuilderFixer.cs (1)
120.Where(trivia => !trivia.IsKind(SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp (20)
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
96case SyntaxKind.EndOfLineTrivia:
Parser\LanguageParser.cs (5)
3645if (!style.IsMissing && explicitInterfaceOpt is not null && this.CurrentToken.Kind != SyntaxKind.OperatorKeyword && style.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia)) 5256var isAfterNewLine = parentType.GetLastToken().TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia); 6548if (separator.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia)) 8253token1.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia)) 11677if (this.CurrentToken.TrailingTrivia.Any((int)SyntaxKind.EndOfLineTrivia) &&
Parser\Lexer.cs (1)
2728else if (tr.Kind == SyntaxKind.EndOfLineTrivia)
Parser\SyntaxParser.cs (1)
727bool prevTokenHasEndOfLineTrivia = triviaList.Any((int)SyntaxKind.EndOfLineTrivia);
Syntax\InternalSyntax\CSharpSyntaxNode.cs (1)
247return this.Kind == SyntaxKind.EndOfLineTrivia
Syntax\InternalSyntax\SyntaxFactory.cs (1)
71trivia = SyntaxTrivia.Create(SyntaxKind.EndOfLineTrivia, text);
Syntax\SyntaxFactory.cs (2)
184/// <see cref="SyntaxKind.WhitespaceTrivia"/>, <see cref="SyntaxKind.EndOfLineTrivia"/>, 202case SyntaxKind.EndOfLineTrivia:
Syntax\SyntaxKindFacts.cs (2)
230if (kind >= SyntaxKind.TildeToken && kind < SyntaxKind.EndOfLineTrivia) return true; 257case SyntaxKind.EndOfLineTrivia:
Syntax\SyntaxNodeRemover.cs (4)
123/// be true for <see cref="SyntaxKind.EndOfLineTrivia"/>, <see cref="SyntaxKind.SingleLineCommentTrivia"/>, 128return trivia.Kind() == SyntaxKind.EndOfLineTrivia 140if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 243withSeps, i, (int)SyntaxKind.EndOfLineTrivia,
Syntax\SyntaxNormalizer.cs (2)
1029trivia.IsKind(SyntaxKind.EndOfLineTrivia) || 1229if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
Microsoft.CodeAnalysis.CSharp.CodeStyle (27)
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
96if (token.TrailingTrivia is not [.., SyntaxTrivia(SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
77if (token.TrailingTrivia is not [.., SyntaxTrivia(SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
128endOfLineTrivia = secondBrace.LeadingTrivia.Last(t => t.IsKind(SyntaxKind.EndOfLineTrivia));
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
82if (colonToken.TrailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
128if (trivia.IsKind(SyntaxKind.EndOfLineTrivia))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForAccessorsHelper.cs (1)
63return !declaration.GetLeadingTrivia().Any(t => t.Kind() == SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
236.Where(t => t.Kind() != SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (3)
263if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 277if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 303if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
148=> trivia.Kind() == SyntaxKind.EndOfLineTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (3)
21.Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia) 52if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 55t.Kind() is SyntaxKind.EndOfLineTrivia or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (2)
41=> trivia.RawKind == (int)SyntaxKind.EndOfLineTrivia; 188structuredTrivia.GetTrailingTrivia().Any(SyntaxKind.EndOfLineTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
76if (previousToken.TrailingTrivia is [.., (kind: SyntaxKind.EndOfLineTrivia)]) 105else if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
38Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 156if (trivia.Kind() != SyntaxKind.EndOfLineTrivia) 272trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
120if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
483or SyntaxKind.EndOfLineTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
27public int EndOfLineTrivia => (int)SyntaxKind.EndOfLineTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (3)
29.Select(n => n.GetTrailingTrivia().FirstOrNull(t => t.Kind() == SyntaxKind.EndOfLineTrivia)) 168if (!trailingTrivia.Any() || trailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia) 186=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (7)
307if (leadingTrivia is [(kind: SyntaxKind.EndOfLineTrivia), ..]) 313if (leadingTrivia is [(kind: SyntaxKind.WhitespaceTrivia), (kind: SyntaxKind.EndOfLineTrivia), ..]) 350var originalHadTrailingNewLine = namespaceDeclaration.GetTrailingTrivia() is [.., (kind: SyntaxKind.EndOfLineTrivia)]; 358if (trailingTrivia is not [.., (kind: SyntaxKind.EndOfLineTrivia)]) 367(kind: SyntaxKind.EndOfLineTrivia or SyntaxKind.EndIfDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia), 368(kind: SyntaxKind.EndOfLineTrivia) 388if (openBraceToken.TrailingTrivia is not [.., SyntaxTrivia(SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
154var expressionTriviaWithoutEndOfLine = expressionTrivia.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia));
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
328.SkipWhile(trivia => trivia.All(t => t.IsWhitespaceOrEndOfLine()) && trivia.Last().IsKind(SyntaxKind.EndOfLineTrivia)) 363if (firstMemberTrivia is [(kind: SyntaxKind.EndOfLineTrivia), ..])
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
60var trailingTriviaTakeUntil = remainingLeadingTrivia.IndexOf(SyntaxKind.EndOfLineTrivia) is >= 0 and var eolIndex
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
131if (nodesAndTokens.Count > 0 && nodesAndTokens.Last().GetTrailingTrivia() is [.., (kind: not SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
81if (addLineBreak && item.GetTrailingTrivia() is not [.., (kind: SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
47protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.Kind() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
42Matcher.Single<SyntaxTrivia>(t => t.Kind() == SyntaxKind.EndOfLineTrivia, "first end of line"), 44Matcher.Single<SyntaxTrivia>(t => t.IsKind(SyntaxKind.EndOfLineTrivia), "second end of line"));
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
152.Any(SyntaxKind.EndOfLineTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
457ComputePositionAndTriviaForRemoveAttributeList(attributeList, (SyntaxTrivia t) => t.IsKind(SyntaxKind.EndOfLineTrivia), out positionOfRemovedNode, out trivia);
Microsoft.CodeAnalysis.CSharp.Features (46)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
94=> trivia.Kind() is SyntaxKind.EndOfLineTrivia or SyntaxKind.SingleLineDocumentationCommentTrivia;
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
198case SyntaxKind.EndOfLineTrivia:
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
331.SkipWhile(t => t is (kind: SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia))
ConvertAnonymousType\CSharpConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
49if (i == n - 1 && i < originalSeparators.Length && originalSeparators[i].TrailingTrivia is [.., (kind: SyntaxKind.EndOfLineTrivia) newLine])
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
137while (triviaToMove is [.., SyntaxTrivia(SyntaxKind.SingleLineCommentTrivia), SyntaxTrivia(SyntaxKind.EndOfLineTrivia)]) 165while (commentIndex < leadingTrivia.Count && leadingTrivia[commentIndex].Kind() is SyntaxKind.EndOfLineTrivia)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
222if (!statements[0].GetLeadingTrivia().Any(t => t.Kind() is SyntaxKind.EndOfLineTrivia) && 226namespaceDeclaration.GetLeadingTrivia().TakeWhile(t => t.Kind() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia));
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
256=> trivia.RawKind == (int)SyntaxKind.EndOfLineTrivia;
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
17private static readonly HashSet<int> s_nonNoisySyntaxKindSet = [(int)SyntaxKind.WhitespaceTrivia, (int)SyntaxKind.EndOfLineTrivia];
ExtractMethod\CSharpMethodExtractor.cs (2)
180if (!leadingTrivia.Any(t => t.IsKind(SyntaxKind.EndOfLineTrivia) || t.GetStructure() is EndIfDirectiveTriviaSyntax) && 187if (!originalMethodDefinition.FindTokenOnLeftOfPosition(originalMethodDefinition.SpanStart).TrailingTrivia.Any(SyntaxKind.EndOfLineTrivia))
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
215not SyntaxKind.EndOfLineTrivia)
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
33: base(document, result, (int)SyntaxKind.EndOfLineTrivia, (int)SyntaxKind.WhitespaceTrivia)
ExtractMethod\CSharpSyntaxTriviaService.cs (1)
14: base((int)SyntaxKind.EndOfLineTrivia)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
473if (!priorToken.TrailingTrivia.Any(SyntaxKind.EndOfLineTrivia) && 474!nextStatement.GetLastToken().TrailingTrivia.Any(SyntaxKind.EndOfLineTrivia)) 488var precedingEndOfLine = nextStatementLeading.LastOrDefault(t => t.Kind() == SyntaxKind.EndOfLineTrivia); 507nextStatement.GetTrailingTrivia() is [.., (kind: SyntaxKind.EndOfLineTrivia) endOfLine] ? endOfLine : ElasticCarriageReturnLineFeed);
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
129else if (trivia.Kind() is not SyntaxKind.WhitespaceTrivia and not SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
96if (token.TrailingTrivia is not [.., SyntaxTrivia(SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
77if (token.TrailingTrivia is not [.., SyntaxTrivia(SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
128endOfLineTrivia = secondBrace.LeadingTrivia.Last(t => t.IsKind(SyntaxKind.EndOfLineTrivia));
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
82if (colonToken.TrailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
128if (trivia.IsKind(SyntaxKind.EndOfLineTrivia))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForAccessorsHelper.cs (1)
63return !declaration.GetLeadingTrivia().Any(t => t.Kind() == SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
236.Where(t => t.Kind() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (7)
307if (leadingTrivia is [(kind: SyntaxKind.EndOfLineTrivia), ..]) 313if (leadingTrivia is [(kind: SyntaxKind.WhitespaceTrivia), (kind: SyntaxKind.EndOfLineTrivia), ..]) 350var originalHadTrailingNewLine = namespaceDeclaration.GetTrailingTrivia() is [.., (kind: SyntaxKind.EndOfLineTrivia)]; 358if (trailingTrivia is not [.., (kind: SyntaxKind.EndOfLineTrivia)]) 367(kind: SyntaxKind.EndOfLineTrivia or SyntaxKind.EndIfDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia), 368(kind: SyntaxKind.EndOfLineTrivia) 388if (openBraceToken.TrailingTrivia is not [.., SyntaxTrivia(SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
154var expressionTriviaWithoutEndOfLine = expressionTrivia.Where(t => !t.IsKind(SyntaxKind.EndOfLineTrivia));
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
328.SkipWhile(trivia => trivia.All(t => t.IsWhitespaceOrEndOfLine()) && trivia.Last().IsKind(SyntaxKind.EndOfLineTrivia)) 363if (firstMemberTrivia is [(kind: SyntaxKind.EndOfLineTrivia), ..])
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
60var trailingTriviaTakeUntil = remainingLeadingTrivia.IndexOf(SyntaxKind.EndOfLineTrivia) is >= 0 and var eolIndex
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
131if (nodesAndTokens.Count > 0 && nodesAndTokens.Last().GetTrailingTrivia() is [.., (kind: not SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
81if (addLineBreak && item.GetTrailingTrivia() is not [.., (kind: SyntaxKind.EndOfLineTrivia)])
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
47protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.Kind() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
42Matcher.Single<SyntaxTrivia>(t => t.Kind() == SyntaxKind.EndOfLineTrivia, "first end of line"), 44Matcher.Single<SyntaxTrivia>(t => t.IsKind(SyntaxKind.EndOfLineTrivia), "second end of line"));
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
152.Any(SyntaxKind.EndOfLineTrivia);
Structure\CSharpStructureHelpers.cs (2)
67if (trivia.IsKind(SyntaxKind.EndOfLineTrivia)) 188SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia or SyntaxKind.EndOfFileToken))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (28)
LexicalAndXml\LexicalTests.cs (23)
486Assert.Equal(SyntaxKind.EndOfLineTrivia, token.TrailingTrivia[0].Kind()); 520Assert.Equal(SyntaxKind.EndOfLineTrivia, token.TrailingTrivia[0].Kind()); 3979Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4003Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4024Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 4057Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 4108Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4127Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4143Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 4180Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4220Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4285Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4308Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4330Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 4359Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 4389Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4398Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4428Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4444Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4484Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4500Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4542Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4560Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia);
LexicalAndXml\SyntaxTokenParserTests.cs (3)
331(SyntaxKind.EndOfLineTrivia, "\r\n"), 332(SyntaxKind.EndOfLineTrivia, "\r\n")); 399(SyntaxKind.EndOfLineTrivia, "\r\n"));
Syntax\SyntaxNodeTests.cs (2)
632Assert.Equal(SyntaxKind.EndOfLineTrivia, list[1].Kind()); 648Assert.Equal(SyntaxKind.EndOfLineTrivia, list[0].Kind());
Microsoft.CodeAnalysis.CSharp.Workspaces (22)
Classification\Worker.cs (1)
280triviaList[index - 1].Kind() == SyntaxKind.EndOfLineTrivia &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (3)
263if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 277if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 303if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
148=> trivia.Kind() == SyntaxKind.EndOfLineTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (3)
21.Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia) 52if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 55t.Kind() is SyntaxKind.EndOfLineTrivia or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (2)
41=> trivia.RawKind == (int)SyntaxKind.EndOfLineTrivia; 188structuredTrivia.GetTrailingTrivia().Any(SyntaxKind.EndOfLineTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
76if (previousToken.TrailingTrivia is [.., (kind: SyntaxKind.EndOfLineTrivia)]) 105else if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
38Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 156if (trivia.Kind() != SyntaxKind.EndOfLineTrivia) 272trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
120if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
483or SyntaxKind.EndOfLineTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
27public int EndOfLineTrivia => (int)SyntaxKind.EndOfLineTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (3)
29.Select(n => n.GetTrailingTrivia().FirstOrNull(t => t.Kind() == SyntaxKind.EndOfLineTrivia)) 168if (!trailingTrivia.Any() || trailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia) 186=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
457ComputePositionAndTriviaForRemoveAttributeList(attributeList, (SyntaxTrivia t) => t.IsKind(SyntaxKind.EndOfLineTrivia), out positionOfRemovedNode, out trivia);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Formatting\FormattingTriviaTests.cs (1)
1745tree = tree.ReplaceTrivia(tree.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.EndOfLineTrivia)), (o, r) => SyntaxFactory.ElasticMarker);
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (3)
1232not SyntaxKind.EndOfLineTrivia) 1309leadingTriviaList[firstIndex].Kind() == SyntaxKind.EndOfLineTrivia) 2858if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
163.Where(t => t is not SyntaxTrivia(SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia))