407 references to Kind
Microsoft.CodeAnalysis.CSharp (23)
Compilation\CSharpCompilation.cs (2)
4442Func<SyntaxTrivia, bool> isComment = trivia => trivia.Kind() == SyntaxKind.SingleLineCommentTrivia || trivia.Kind() == SyntaxKind.MultiLineCommentTrivia;
Compiler\DocumentationCommentCompiler.cs (1)
267if (trivia.Kind() is SyntaxKind.SingleLineDocumentationCommentTrivia or SyntaxKind.MultiLineDocumentationCommentTrivia)
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
100if (!_isValidLocation && SyntaxFacts.IsDocumentationCommentTrivia(trivia.Kind()))
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
66switch (trivia.Kind())
Syntax\CSharpSyntaxNode.cs (1)
403if (!SyntaxFacts.IsDocumentationCommentTrivia(trivia.Kind()))
Syntax\CSharpSyntaxRewriter.cs (1)
301if (alternate != null && visited.Kind() != SyntaxKind.None)
Syntax\CSharpSyntaxTree.cs (2)
746isComment: trivia => trivia.Kind() == SyntaxKind.SingleLineCommentTrivia || trivia.Kind() == SyntaxKind.MultiLineCommentTrivia,
Syntax\SyntaxFactory.cs (1)
2405if (trivia.ContainsDiagnostics && trivia.Kind() == SyntaxKind.MultiLineCommentTrivia)
Syntax\SyntaxNodeRemover.cs (3)
128return trivia.Kind() == SyntaxKind.EndOfLineTrivia 129|| trivia.Kind() == SyntaxKind.SingleLineCommentTrivia 140if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
Syntax\SyntaxNormalizer.cs (10)
134t => t.Kind() == SyntaxKind.SkippedTokensTrivia); 1164switch (trivia.Kind()) 1171return !SyntaxFacts.IsPreprocessorDirective(trivia.Kind()); 1183var kind = trivia.Kind(); 1195var kind = trivia.Kind(); 1209switch (trivia.Kind()) 1229if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 1234if (trivia.Kind() == SyntaxKind.PreprocessingMessageTrivia || trivia.Kind() == SyntaxKind.DisabledTextTrivia) 1291if (SyntaxFacts.IsPreprocessorDirective(trivia.Kind()))
Microsoft.CodeAnalysis.CSharp.CodeStyle (68)
ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
99if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
103if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
78if (colonToken.TrailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia)
ConvertProgramAnalysis_ProgramMain.cs (1)
72var lastPragma = root.GetFirstToken().LeadingTrivia.LastOrDefault(t => t.Kind() is SyntaxKind.PragmaWarningDirectiveTrivia);
CSharpFileHeaderHelper.cs (1)
48throw ExceptionUtilities.UnexpectedValue(commentTrivia.Kind());
CSharpSyntaxFacts.cs (4)
1097if (trivia.Kind() == SyntaxKind.DisabledTextTrivia) 1216=> trivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia; 1369=> SyntaxFacts.IsPreprocessorDirective(trivia.Kind()); 1433throw ExceptionUtilities.UnexpectedValue(trivia.Kind());
CSharpTriviaFormatter.cs (8)
87if (SyntaxFacts.IsPreprocessorDirective(trivia2.Kind())) 149if (!trivia1.IsKind(trivia2.Kind()) || trivia2.IsMultiLineComment() || trivia2.IsMultiLineDocComment() || existingWhitespaceBetween.Lines > 1) 199var isStartOrEndOfFile = (this.Token1.RawKind == 0 || this.Token2.RawKind == 0) && (trivia1.Kind() == 0 || trivia2.Kind() == 0); 200var isAtEndOfFileToken = (Token2.IsKind(SyntaxKind.EndOfFileToken) && trivia2.Kind() == 0); 210if (trivia.Kind() == SyntaxKind.MultiLineCommentTrivia) 324if (trivia.Kind() == SyntaxKind.SkippedTokensTrivia) 353if (trivia.Kind() == SyntaxKind.SkippedTokensTrivia)
CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
35if (trivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia)
DirectiveSyntaxExtensions.DirectiveWalker.cs (1)
59switch (directive.Kind())
ElasticTriviaFormattingRule.cs (1)
474return trivia.Kind() is SyntaxKind.WhitespaceTrivia
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (5)
302if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 308return trivia.Kind() == SyntaxKind.ConflictMarkerTrivia; 316if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 342if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 514if (trivia.Kind() == SyntaxKind.DisabledTextTrivia)
SyntaxNodeExtensions.cs (1)
684var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.Kind()));
SyntaxTriviaExtensions.cs (11)
22=> kind = trivia.Kind(); 37=> trivia.Kind() == SyntaxKind.SingleLineCommentTrivia; 40=> trivia.Kind() == SyntaxKind.MultiLineCommentTrivia; 43=> trivia.Kind() == SyntaxKind.ShebangDirectiveTrivia; 47if (trivia.Kind() != SyntaxKind.MultiLineCommentTrivia) 58=> trivia.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia; 61=> trivia.Kind() == SyntaxKind.MultiLineDocumentationCommentTrivia; 66if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia) 75else if (trivia.Kind() == SyntaxKind.MultiLineCommentTrivia) 148=> trivia.Kind() == SyntaxKind.EndOfLineTrivia; 151=> trivia.Kind() == SyntaxKind.WhitespaceTrivia;
SyntaxTriviaListExtensions.cs (4)
20.Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia) 39=> triviaList.SkipWhile(t => t.Kind() == SyntaxKind.WhitespaceTrivia); 48if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 51t.Kind() is SyntaxKind.EndOfLineTrivia or
TriviaDataFactory.Analyzer.cs (7)
101if (trivia.Kind() == SyntaxKind.WhitespaceTrivia) 105else if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 113else if (trivia.Kind() == SyntaxKind.SkippedTokensTrivia) 117else if (trivia.Kind() is SyntaxKind.DisabledTextTrivia or 122else if (trivia.Kind() == SyntaxKind.ConflictMarkerTrivia) 128Contract.ThrowIfFalse(SyntaxFacts.IsPreprocessorDirective(trivia.Kind())); 155Debug.Assert(trivia.Kind() == SyntaxKind.WhitespaceTrivia);
TriviaDataFactory.CodeShapeAnalyzer.cs (16)
38Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 39Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.SkippedTokensTrivia); 40Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.PreprocessingMessageTrivia); 48if (trivia.Kind() == SyntaxKind.WhitespaceTrivia) 65if (trivia.Kind() == SyntaxKind.RegionDirectiveTrivia || 66trivia.Kind() == SyntaxKind.EndRegionDirectiveTrivia || 67SyntaxFacts.IsPreprocessorDirective(trivia.Kind())) 80if (trivia.Kind() is SyntaxKind.SkippedTokensTrivia or 127if (trivia.Kind() != SyntaxKind.WhitespaceTrivia) 156if (trivia.Kind() != SyntaxKind.EndOfLineTrivia) 215if (trivia.Kind() is not SyntaxKind.SkippedTokensTrivia and 226if (trivia.Kind() is not SyntaxKind.RegionDirectiveTrivia and 248if (!SyntaxFacts.IsPreprocessorDirective(trivia.Kind())) 271trivia.Kind() == SyntaxKind.WhitespaceTrivia || 272trivia.Kind() == SyntaxKind.EndOfLineTrivia) 334if (xmlTrivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia)
TriviaRewriter.cs (1)
120if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
UseExpressionBodyHelper`1.cs (1)
231.Where(t => t.Kind() != SyntaxKind.EndOfLineTrivia)
UsingsAndExternAliasesOrganizer.cs (2)
159if (!trailingTrivia.Any() || trailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia) 177=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
ConstructorInitializerPlacementCodeFixProvider.cs (1)
110return previousToken.TrailingTrivia.All(t => t.Kind() == SyntaxKind.WhitespaceTrivia)
CSharpCodeGenerationHelpers.cs (2)
92if (t1.Kind() == SyntaxKind.MultiLineCommentTrivia) 100else if (t1.Kind() == SyntaxKind.SkippedTokensTrivia)
CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
58if (firstTrivia.Kind() != SyntaxKind.SkippedTokensTrivia)
CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
52protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.Kind() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\Suppression\SuppressionTests.cs (1)
1109foreach (var trivia in context.Node.DescendantTrivia().Where(t => t.Kind() is SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia))
Microsoft.CodeAnalysis.CSharp.Features (28)
AddFileBanner\CSharpAddFileBannerCodeRefactoringProvider.cs (1)
27switch (trivia.Kind())
ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
99if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
BraceMatching\BlockCommentBraceMatcher.cs (2)
31if (trivia.Kind() is SyntaxKind.MultiLineCommentTrivia && 36else if (trivia.Kind() is SyntaxKind.MultiLineDocumentationCommentTrivia)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
222if (trivia.Kind() == SyntaxKind.PragmaWarningDirectiveTrivia)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
187switch (list[i].Kind())
ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
103if (nextToken.LeadingTrivia.Any(static t => t.Kind() is
ConstructorInitializerPlacementCodeFixProvider.cs (1)
110return previousToken.TrailingTrivia.All(t => t.Kind() == SyntaxKind.WhitespaceTrivia)
ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
78if (colonToken.TrailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia)
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
161c => c.Kind() is SyntaxKind.SingleLineCommentTrivia && c.ToString().Contains("https://aka.ms/new-console-template")); 168while (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));
ConvertProgramAnalysis_ProgramMain.cs (1)
72var lastPragma = root.GetFirstToken().LeadingTrivia.LastOrDefault(t => t.Kind() is SyntaxKind.PragmaWarningDirectiveTrivia);
CSharpFileHeaderHelper.cs (1)
48throw ExceptionUtilities.UnexpectedValue(commentTrivia.Kind());
CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
58if (firstTrivia.Kind() != SyntaxKind.SkippedTokensTrivia)
CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
52protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.Kind() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (2)
353&& firstTextToken.LeadingTrivia.ElementAt(0).Kind() == SyntaxKind.DocumentationCommentExteriorTrivia 362=> token.TrailingTrivia.Any(t => t.Kind() == SyntaxKind.SkippedTokensTrivia);
DocumentationComments\DocCommentConverter.cs (1)
54if (trivia.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
213if (trivia.Kind() is not SyntaxKind.WhitespaceTrivia and
ExtractMethod\Extensions.cs (1)
185switch (trivia.Kind())
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
425var precedingEndOfLine = nextStatementLeading.LastOrDefault(t => t.Kind() == SyntaxKind.EndOfLineTrivia);
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
237if (trivia.Kind() is SyntaxKind.MultiLineDocumentationCommentTrivia or
Structure\Providers\DisabledTextTriviaStructureProvider.cs (1)
92switch (currentTrivia.Kind())
TaskList\CSharpTaskListService.cs (2)
85return trivia.Kind() != SyntaxKind.RegionDirectiveTrivia && 86SyntaxFacts.IsPreprocessorDirective(trivia.Kind()) && trivia.ToString().IndexOf(SingleLineCommentPrefix, StringComparison.Ordinal) > 0;
UseExpressionBodyHelper`1.cs (1)
231.Where(t => t.Kind() != SyntaxKind.EndOfLineTrivia)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (200)
LexicalAndXml\LexicalTests.cs (100)
115Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].Kind()); 134Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].Kind()); 153Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, trivia[0].Kind()); 171Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia.Kind()); 193Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].Kind()); 215Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].Kind()); 237Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, trivia[0].Kind()); 255Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].Kind()); 277Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].Kind()); 3204Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[0].Kind()); 3210Assert.Equal(SyntaxKind.WhitespaceTrivia, trailing[0].Kind()); 3222Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[0].Kind()); 3228Assert.Equal(SyntaxKind.WhitespaceTrivia, trailing[0].Kind()); 3243Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[0].Kind()); 3249Assert.Equal(SyntaxKind.WhitespaceTrivia, trailing[0].Kind()); 3425Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3436Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3453Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3462Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3484Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3507Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3525Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3535Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.ConflictMarkerTrivia); 3542Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3555Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3564Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3569Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3579Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3588Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3592Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3600Assert.True(trivia1.Kind() == SyntaxKind.ConflictMarkerTrivia); 3609Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 3614Assert.True(trivia3.Kind() == SyntaxKind.DisabledTextTrivia); 3619Assert.True(trivia4.Kind() == SyntaxKind.ConflictMarkerTrivia); 3633Assert.True(trivia1.Kind() == SyntaxKind.ConflictMarkerTrivia); 3642Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 3647Assert.True(trivia3.Kind() == SyntaxKind.ConflictMarkerTrivia); 3664Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3674Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.ConflictMarkerTrivia); 3681Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3689Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3693Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3698Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3708Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3712Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3716Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3724Assert.True(trivia1.Kind() == SyntaxKind.ConflictMarkerTrivia); 3728Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 3733Assert.True(trivia3.Kind() == SyntaxKind.DisabledTextTrivia); 3738Assert.True(trivia4.Kind() == SyntaxKind.ConflictMarkerTrivia); 3759Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3765Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3768Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3777Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3799Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3805Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3808Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3817Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3830Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.WhitespaceTrivia); 3840Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.ConflictMarkerTrivia); 3847Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3862Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3870Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3873Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3885Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3893Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3896Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 3907Assert.True(trivia1.Kind() == SyntaxKind.ConflictMarkerTrivia); 3915Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 3918Assert.True(trivia3.Kind() == SyntaxKind.DisabledTextTrivia); 3921Assert.True(trivia4.Kind() == SyntaxKind.ConflictMarkerTrivia); 3936Assert.True(trivia1.Kind() == SyntaxKind.ConflictMarkerTrivia); 3944Assert.True(trivia2.Kind() == SyntaxKind.EndOfLineTrivia); 3947Assert.True(trivia3.Kind() == SyntaxKind.ConflictMarkerTrivia); 3968Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3974Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3977Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 3983Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 3986Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4007Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4013Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4016Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 4023Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4029Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4032Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 4039Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4063Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4069Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4072Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 4079Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4085Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4088Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 4097Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4121Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4127Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4130Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 4139Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia); 4145Assert.True(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 4148Assert.True(trivia.Kind() == SyntaxKind.DisabledTextTrivia); 4155Assert.True(trivia.Kind() == SyntaxKind.ConflictMarkerTrivia);
LexicalAndXml\PreprocessorTests.cs (10)
2106Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2128Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2216Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2237Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2258Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2279Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2300Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2321Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2342Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind()); 2363Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.Kind());
LexicalAndXml\XmlDocCommentTests.cs (60)
82Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 101Assert.Equal(SyntaxKind.SingleLineCommentTrivia, leading[0].Kind()); 118Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, leading[0].Kind()); 119Assert.Equal(SyntaxKind.SingleLineCommentTrivia, leading[1].Kind()); 133Assert.Equal(SyntaxKind.MultiLineCommentTrivia, leading[0].Kind()); 151Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 172Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 197Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 219Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 242Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 265Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 292Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 320Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 344Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 369Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 395Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 422Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 449Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 477Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 506Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 536Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 565Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 595Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 626Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 649Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 671Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 693Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 715Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 737Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 757Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 791Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 824Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 855Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 883Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 908Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 934Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 959Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 986Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1017Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1045Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1070Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1095Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1122Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1155Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1186Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1212Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1239Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1267Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1312Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1336Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1361Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1385Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1410Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1434Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1459Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1483Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1563Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1591Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind()); 1619Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.Kind()); 1645Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.Kind());
Parsing\ScriptParsingTests.cs (5)
9656Assert.Equal(SyntaxKind.ShebangDirectiveTrivia, leading[0].Kind()); 9657Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[1].Kind()); 9717Assert.Equal(SyntaxKind.SingleLineCommentTrivia, eof.GetLeadingTrivia().Single().Kind()); 9730Assert.Equal(SyntaxKind.ShebangDirectiveTrivia, trivia.Kind()); 9745Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, skippedText.Kind());
Parsing\StatementParsingTests.cs (1)
1963Assert.Equal(SyntaxKind.SkippedTokensTrivia, fs.ForEachKeyword.TrailingTrivia[0].Kind());
Syntax\StructuredTriviaTests.cs (3)
82Assert.Equal(SyntaxKind.WhitespaceTrivia, trResult.Kind()); 167var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia); 183var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.Kind() == SyntaxKind.MultiLineDocumentationCommentTrivia);
Syntax\SyntaxNodeTests.cs (18)
608Assert.Equal(SyntaxKind.SingleLineCommentTrivia, list[0].Kind()); 609Assert.Equal(SyntaxKind.EndOfLineTrivia, list[1].Kind()); 610Assert.Equal(SyntaxKind.WhitespaceTrivia, list[2].Kind()); 611Assert.Equal(SyntaxKind.WhitespaceTrivia, list[3].Kind()); 625Assert.Equal(SyntaxKind.EndOfLineTrivia, list[0].Kind()); 626Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, list[1].Kind()); 627Assert.Equal(SyntaxKind.DocumentationCommentExteriorTrivia, list[2].Kind()); 628Assert.Equal(SyntaxKind.WhitespaceTrivia, list[3].Kind()); 629Assert.Equal(SyntaxKind.DocumentationCommentExteriorTrivia, list[4].Kind()); 630Assert.Equal(SyntaxKind.WhitespaceTrivia, list[5].Kind()); 631Assert.Equal(SyntaxKind.WhitespaceTrivia, list[6].Kind()); 766Assert.Equal(SyntaxKind.None, trivia.Kind()); 1330Assert.Equal(SyntaxKind.DefineDirectiveTrivia, trivia.Kind()); 1341Assert.Equal(SyntaxKind.DefineDirectiveTrivia, trivia.Kind()); 1345Assert.NotEqual(SyntaxKind.None, parentTrivia.Kind()); 2348var deepTrivia = expr.GetDirectives().SelectMany(d => d.DescendantTrivia().Where(tr => tr.Kind() == SyntaxKind.WhitespaceTrivia)).ToList(); 2384Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.Kind()); 2406Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.Kind());
Syntax\SyntaxRewriterTests.cs (3)
200trivia.Kind() == SyntaxKind.WhitespaceTrivia ? default(SyntaxTrivia) : trivia); 470Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.Kind()); 497Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.Kind());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
492if (trivia.Kind() == SyntaxKind.MultiLineCommentTrivia)
Microsoft.CodeAnalysis.CSharp.Workspaces (70)
Classification\Worker.cs (3)
179switch (trivia.Kind()) 252triviaList[index - 1].Kind() == SyntaxKind.EndOfLineTrivia && 253triviaList[index - 2].Kind() == SyntaxKind.ConflictMarkerTrivia)
Classification\Worker_DocumentationComments.cs (1)
70switch (t.Kind())
Classification\Worker_Preprocesser.cs (2)
85if (trivia.Kind() == SyntaxKind.WhitespaceTrivia) 101if (allowComments && trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)
CSharpCodeGenerationHelpers.cs (2)
92if (t1.Kind() == SyntaxKind.MultiLineCommentTrivia) 100else if (t1.Kind() == SyntaxKind.SkippedTokensTrivia)
CSharpSyntaxFacts.cs (4)
1097if (trivia.Kind() == SyntaxKind.DisabledTextTrivia) 1216=> trivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia; 1369=> SyntaxFacts.IsPreprocessorDirective(trivia.Kind()); 1433throw ExceptionUtilities.UnexpectedValue(trivia.Kind());
CSharpTriviaFormatter.cs (8)
87if (SyntaxFacts.IsPreprocessorDirective(trivia2.Kind())) 149if (!trivia1.IsKind(trivia2.Kind()) || trivia2.IsMultiLineComment() || trivia2.IsMultiLineDocComment() || existingWhitespaceBetween.Lines > 1) 199var isStartOrEndOfFile = (this.Token1.RawKind == 0 || this.Token2.RawKind == 0) && (trivia1.Kind() == 0 || trivia2.Kind() == 0); 200var isAtEndOfFileToken = (Token2.IsKind(SyntaxKind.EndOfFileToken) && trivia2.Kind() == 0); 210if (trivia.Kind() == SyntaxKind.MultiLineCommentTrivia) 324if (trivia.Kind() == SyntaxKind.SkippedTokensTrivia) 353if (trivia.Kind() == SyntaxKind.SkippedTokensTrivia)
CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
35if (trivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia)
DirectiveSyntaxExtensions.DirectiveWalker.cs (1)
59switch (directive.Kind())
ElasticTriviaFormattingRule.cs (1)
474return trivia.Kind() is SyntaxKind.WhitespaceTrivia
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
684var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.Kind()));
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (5)
302if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 308return trivia.Kind() == SyntaxKind.ConflictMarkerTrivia; 316if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 342if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 514if (trivia.Kind() == SyntaxKind.DisabledTextTrivia)
SyntaxTriviaExtensions.cs (11)
22=> kind = trivia.Kind(); 37=> trivia.Kind() == SyntaxKind.SingleLineCommentTrivia; 40=> trivia.Kind() == SyntaxKind.MultiLineCommentTrivia; 43=> trivia.Kind() == SyntaxKind.ShebangDirectiveTrivia; 47if (trivia.Kind() != SyntaxKind.MultiLineCommentTrivia) 58=> trivia.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia; 61=> trivia.Kind() == SyntaxKind.MultiLineDocumentationCommentTrivia; 66if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia) 75else if (trivia.Kind() == SyntaxKind.MultiLineCommentTrivia) 148=> trivia.Kind() == SyntaxKind.EndOfLineTrivia; 151=> trivia.Kind() == SyntaxKind.WhitespaceTrivia;
SyntaxTriviaListExtensions.cs (4)
20.Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia) 39=> triviaList.SkipWhile(t => t.Kind() == SyntaxKind.WhitespaceTrivia); 48if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 51t.Kind() is SyntaxKind.EndOfLineTrivia or
TriviaDataFactory.Analyzer.cs (7)
101if (trivia.Kind() == SyntaxKind.WhitespaceTrivia) 105else if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 113else if (trivia.Kind() == SyntaxKind.SkippedTokensTrivia) 117else if (trivia.Kind() is SyntaxKind.DisabledTextTrivia or 122else if (trivia.Kind() == SyntaxKind.ConflictMarkerTrivia) 128Contract.ThrowIfFalse(SyntaxFacts.IsPreprocessorDirective(trivia.Kind())); 155Debug.Assert(trivia.Kind() == SyntaxKind.WhitespaceTrivia);
TriviaDataFactory.CodeShapeAnalyzer.cs (16)
38Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.EndOfLineTrivia); 39Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.SkippedTokensTrivia); 40Contract.ThrowIfTrue(trivia.Kind() == SyntaxKind.PreprocessingMessageTrivia); 48if (trivia.Kind() == SyntaxKind.WhitespaceTrivia) 65if (trivia.Kind() == SyntaxKind.RegionDirectiveTrivia || 66trivia.Kind() == SyntaxKind.EndRegionDirectiveTrivia || 67SyntaxFacts.IsPreprocessorDirective(trivia.Kind())) 80if (trivia.Kind() is SyntaxKind.SkippedTokensTrivia or 127if (trivia.Kind() != SyntaxKind.WhitespaceTrivia) 156if (trivia.Kind() != SyntaxKind.EndOfLineTrivia) 215if (trivia.Kind() is not SyntaxKind.SkippedTokensTrivia and 226if (trivia.Kind() is not SyntaxKind.RegionDirectiveTrivia and 248if (!SyntaxFacts.IsPreprocessorDirective(trivia.Kind())) 271trivia.Kind() == SyntaxKind.WhitespaceTrivia || 272trivia.Kind() == SyntaxKind.EndOfLineTrivia) 334if (xmlTrivia.Kind() == SyntaxKind.DocumentationCommentExteriorTrivia)
TriviaRewriter.cs (1)
120if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
UsingsAndExternAliasesOrganizer.cs (2)
159if (!trailingTrivia.Any() || trailingTrivia.Last().Kind() != SyntaxKind.EndOfLineTrivia) 177=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
124var skippedTrivia = namespaceDeclaration.OpenBraceToken.TrailingTrivia.Single(t => t.Kind() is SyntaxKind.SkippedTokensTrivia);
Microsoft.CodeAnalysis.UnitTests (2)
CommonSyntaxTests.cs (2)
117Assert.Equal(CSharp.SyntaxKind.MultiLineCommentTrivia, CSharp.CSharpExtensions.Kind(csharpTrivia)); 202Assert.Equal(CSharp.SyntaxKind.None, CSharp.CSharpExtensions.Kind(trivia));
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.cs (5)
1234else if (trivia.Kind() is not SyntaxKind.WhitespaceTrivia and 1312leadingTriviaList[firstIndex].Kind() == SyntaxKind.EndOfLineTrivia) 2862if (trivia.Kind() == SyntaxKind.EndOfLineTrivia) 2873else if (trivia.Kind() != SyntaxKind.WhitespaceTrivia) 3299if (lastNonWhitespaceTrivia.Kind() == SyntaxKind.EndRegionDirectiveTrivia)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
167if (significantTrivia.Kind() != SyntaxKind.None)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
42if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)
LanguageService\CSharpHelpContextService.cs (1)
69if (trivia.Span.IntersectsWith(span) && trivia.Kind() == SyntaxKind.PreprocessingMessageTrivia &&