404 references to Kind
Microsoft.CodeAnalysis.CSharp (22)
Compilation\CSharpCompilation.cs (2)
4731
Func<SyntaxTrivia, bool> isComment = trivia => trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia || trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia;
Compiler\DocumentationCommentCompiler.cs (1)
274
if (trivia.
Kind
() is SyntaxKind.SingleLineDocumentationCommentTrivia or SyntaxKind.MultiLineDocumentationCommentTrivia)
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
100
if (!_isValidLocation && SyntaxFacts.IsDocumentationCommentTrivia(trivia.
Kind
()))
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
66
switch (trivia.
Kind
())
Syntax\CSharpSyntaxNode.cs (1)
385
if (!SyntaxFacts.IsDocumentationCommentTrivia(trivia.
Kind
()))
Syntax\CSharpSyntaxRewriter.cs (1)
301
if (alternate != null && visited.
Kind
() != SyntaxKind.None)
Syntax\CSharpSyntaxTree.cs (2)
737
isComment: trivia => trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia || trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia,
Syntax\SyntaxFactory.cs (1)
2417
if (trivia.ContainsDiagnostics && trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
Syntax\SyntaxNodeRemover.cs (3)
128
return trivia.
Kind
() == SyntaxKind.EndOfLineTrivia
129
|| trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia
140
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
Syntax\SyntaxNormalizer.cs (9)
1164
switch (trivia.
Kind
())
1171
return !SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
());
1183
var kind = trivia.
Kind
();
1195
var kind = trivia.
Kind
();
1209
switch (trivia.
Kind
())
1229
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
1234
if (trivia.
Kind
() == SyntaxKind.PreprocessingMessageTrivia || trivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
1299
if (SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
()))
Microsoft.CodeAnalysis.CSharp.CodeStyle (58)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
67
var lastPragma = root.GetFirstToken().LeadingTrivia.LastOrDefault(t => t.
Kind
() is SyntaxKind.PragmaWarningDirectiveTrivia);
src\Analyzers\CSharp\Analyzers\FileHeaders\CSharpFileHeaderHelper.cs (1)
48
throw ExceptionUtilities.UnexpectedValue(commentTrivia.
Kind
());
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
105
if (nextToken.LeadingTrivia.Any(static t => t.
Kind
() is
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
86
if (nextToken.LeadingTrivia.Any(static t => t.
Kind
() is
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
82
if (colonToken.TrailingTrivia.Last().
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\BlockSyntaxExtensions.cs (2)
65
if (leadingDirectives.Any(t => t.
Kind
() == SyntaxKind.EndIfDirectiveTrivia))
91
if (nextTrivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
603
var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.
Kind
()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
493
if (trivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (12)
22
=> kind = trivia.
Kind
();
25
=> trivia.
Kind
() is SyntaxKind.MultiLineCommentTrivia or SyntaxKind.SingleLineCommentTrivia;
37
=> trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia;
40
=> trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia;
43
=> trivia.
Kind
() == SyntaxKind.ShebangDirectiveTrivia;
47
if (trivia.
Kind
() != SyntaxKind.MultiLineCommentTrivia)
58
=> trivia.
Kind
() == SyntaxKind.SingleLineDocumentationCommentTrivia;
61
=> trivia.
Kind
() == SyntaxKind.MultiLineDocumentationCommentTrivia;
66
if (trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia)
75
else if (trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
148
=> trivia.
Kind
() == SyntaxKind.EndOfLineTrivia;
151
=> trivia.
Kind
() == SyntaxKind.WhitespaceTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (3)
21
.Where(t => t.
Kind
() == SyntaxKind.EndOfLineTrivia)
43
=> triviaList.SkipWhile(t => t.
Kind
() == SyntaxKind.WhitespaceTrivia);
52
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (9)
87
if (SyntaxFacts.IsPreprocessorDirective(trivia2.
Kind
()))
100
if (trivia2.
Kind
() is SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia)
149
if (!trivia1.IsKind(trivia2.
Kind
()) || trivia2.IsMultiLineComment() || trivia2.IsMultiLineDocComment() || existingWhitespaceBetween.Lines > 1)
199
var isStartOrEndOfFile = (this.Token1.RawKind == 0 || this.Token2.RawKind == 0) && (trivia1.
Kind
() == 0 || trivia2.
Kind
() == 0);
200
var isAtEndOfFileToken = (Token2.IsKind(SyntaxKind.EndOfFileToken) && trivia2.
Kind
() == 0);
210
if (trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
324
if (trivia.
Kind
() == SyntaxKind.SkippedTokensTrivia)
353
if (trivia.
Kind
() == SyntaxKind.SkippedTokensTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
35
if (trivia.
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (7)
101
if (trivia.
Kind
() == SyntaxKind.WhitespaceTrivia)
105
else if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
113
else if (trivia.
Kind
() == SyntaxKind.SkippedTokensTrivia)
117
else if (trivia.
Kind
() is SyntaxKind.DisabledTextTrivia or
122
else if (trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia)
128
Contract.ThrowIfFalse(SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
()));
155
Debug.Assert(trivia.
Kind
() == SyntaxKind.WhitespaceTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (8)
127
if (trivia.
Kind
() != SyntaxKind.WhitespaceTrivia)
156
if (trivia.
Kind
() != SyntaxKind.EndOfLineTrivia)
215
if (trivia.
Kind
() is not SyntaxKind.SkippedTokensTrivia and
226
if (trivia.
Kind
() is not SyntaxKind.RegionDirectiveTrivia and
248
if (!SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
()))
271
trivia.
Kind
() == SyntaxKind.WhitespaceTrivia ||
272
trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
334
if (xmlTrivia.
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
120
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
482
return trivia.
Kind
() is SyntaxKind.WhitespaceTrivia
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
1109
if (trivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
1226
=> trivia.
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia;
1370
=> SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
());
1437
throw ExceptionUtilities.UnexpectedValue(trivia.
Kind
());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
159
if (!trailingTrivia.Any() || trailingTrivia.Last().
Kind
() != SyntaxKind.EndOfLineTrivia)
177
=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.
Kind
() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
52
if (firstTrivia.
Kind
() != SyntaxKind.SkippedTokensTrivia)
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
106
return previousToken.TrailingTrivia.All(t => t.
Kind
() == SyntaxKind.WhitespaceTrivia)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
860
while (index - 1 >= 0 && trivia[index - 1].
Kind
() == SyntaxKind.WhitespaceTrivia)
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
47
protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.
Kind
() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
95
if (t1.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
103
else if (t1.
Kind
() == SyntaxKind.SkippedTokensTrivia)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
BlockCommentEditing\BlockCommentEditingCommandHandler.cs (1)
285
var isBlockComment = trivia.
Kind
() is SyntaxKind.MultiLineCommentTrivia or SyntaxKind.MultiLineDocumentationCommentTrivia;
Microsoft.CodeAnalysis.CSharp.Features (30)
AddFileBanner\CSharpAddFileBannerCodeRefactoringProvider.cs (1)
27
switch (trivia.
Kind
())
BraceMatching\BlockCommentBraceMatcher.cs (2)
47
if (trivia.
Kind
() is SyntaxKind.MultiLineCommentTrivia &&
52
else if (trivia.
Kind
() is SyntaxKind.MultiLineDocumentationCommentTrivia)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
94
=> trivia.
Kind
() is SyntaxKind.EndOfLineTrivia or SyntaxKind.SingleLineDocumentationCommentTrivia;
224
if (trivia.
Kind
() == SyntaxKind.PragmaWarningDirectiveTrivia)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
195
switch (list[i].
Kind
())
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
165
while (commentIndex < leadingTrivia.Count && leadingTrivia[commentIndex].
Kind
() is SyntaxKind.EndOfLineTrivia)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
226
namespaceDeclaration.GetLeadingTrivia().TakeWhile(t => t.
Kind
() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia));
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (2)
351
&& firstTextToken.LeadingTrivia.ElementAt(0).
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia
360
=> token.TrailingTrivia.Any(t => t.
Kind
() == SyntaxKind.SkippedTokensTrivia);
DocumentationComments\DocCommentConverter.cs (1)
54
if (trivia.
Kind
() == SyntaxKind.SingleLineDocumentationCommentTrivia)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
214
if (trivia.
Kind
() is not SyntaxKind.WhitespaceTrivia and
ExtractMethod\Extensions.cs (1)
179
switch (trivia.
Kind
())
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
428
var precedingEndOfLine = nextStatementLeading.LastOrDefault(t => t.
Kind
() == SyntaxKind.EndOfLineTrivia);
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (1)
219
return trivia.
Kind
() is SyntaxKind.MultiLineCommentTrivia or SyntaxKind.SingleLineCommentTrivia;
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
129
else if (trivia.
Kind
() is not SyntaxKind.WhitespaceTrivia and not SyntaxKind.EndOfLineTrivia)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
239
if (trivia.
Kind
() is SyntaxKind.MultiLineDocumentationCommentTrivia or
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
67
var lastPragma = root.GetFirstToken().LeadingTrivia.LastOrDefault(t => t.
Kind
() is SyntaxKind.PragmaWarningDirectiveTrivia);
src\Analyzers\CSharp\Analyzers\FileHeaders\CSharpFileHeaderHelper.cs (1)
48
throw ExceptionUtilities.UnexpectedValue(commentTrivia.
Kind
());
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
105
if (nextToken.LeadingTrivia.Any(static t => t.
Kind
() is
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
86
if (nextToken.LeadingTrivia.Any(static t => t.
Kind
() is
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
82
if (colonToken.TrailingTrivia.Last().
Kind
() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
236
.Where(t => t.
Kind
() != SyntaxKind.EndOfLineTrivia)
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
52
if (firstTrivia.
Kind
() != SyntaxKind.SkippedTokensTrivia)
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
106
return previousToken.TrailingTrivia.All(t => t.
Kind
() == SyntaxKind.WhitespaceTrivia)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
860
while (index - 1 >= 0 && trivia[index - 1].
Kind
() == SyntaxKind.WhitespaceTrivia)
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
47
protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.
Kind
() is SyntaxKind.WhitespaceTrivia or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
Structure\Providers\DisabledTextTriviaStructureProvider.cs (1)
92
switch (currentTrivia.
Kind
())
TaskList\CSharpTaskListService.cs (2)
85
return trivia.
Kind
() != SyntaxKind.RegionDirectiveTrivia &&
86
SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
()) && trivia.ToString().IndexOf(SingleLineCommentPrefix, StringComparison.Ordinal) > 0;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\SuppressionTests.cs (1)
1106
foreach (var trivia in context.Node.DescendantTrivia().Where(t => t.
Kind
() is SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (217)
LexicalAndXml\LexicalTests.cs (115)
116
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].
Kind
());
135
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].
Kind
());
154
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, trivia[0].
Kind
());
172
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia.
Kind
());
194
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
216
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
238
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, trivia[0].
Kind
());
256
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
278
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
302
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
326
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
348
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
370
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
392
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
412
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
440
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, trivia[0].
Kind
());
486
Assert.Equal(SyntaxKind.EndOfLineTrivia, token.TrailingTrivia[0].
Kind
());
520
Assert.Equal(SyntaxKind.EndOfLineTrivia, token.TrailingTrivia[0].
Kind
());
546
Assert.Equal(SyntaxKind.IfDirectiveTrivia, trivia[0].
Kind
());
547
Assert.Equal(SyntaxKind.DisabledTextTrivia, trivia[1].
Kind
());
548
Assert.Equal(SyntaxKind.EndIfDirectiveTrivia, trivia[2].
Kind
());
577
Assert.Equal(SyntaxKind.IfDirectiveTrivia, token.GetLeadingTrivia()[0].
Kind
());
583
Assert.Equal(SyntaxKind.EndIfDirectiveTrivia, token.GetLeadingTrivia()[0].
Kind
());
604
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, trivia[0].
Kind
());
3619
Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[0].
Kind
());
3625
Assert.Equal(SyntaxKind.WhitespaceTrivia, trailing[0].
Kind
());
3637
Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[0].
Kind
());
3643
Assert.Equal(SyntaxKind.WhitespaceTrivia, trailing[0].
Kind
());
3658
Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[0].
Kind
());
3664
Assert.Equal(SyntaxKind.WhitespaceTrivia, trailing[0].
Kind
());
3840
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
3851
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
3868
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
3877
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
3899
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
3922
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
3940
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
3950
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.ConflictMarkerTrivia);
3957
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
3970
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
3979
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
3984
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
3994
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4003
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4007
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4015
Assert.True(trivia1.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4024
Assert.True(trivia2.
Kind
() == SyntaxKind.EndOfLineTrivia);
4029
Assert.True(trivia3.
Kind
() == SyntaxKind.DisabledTextTrivia);
4034
Assert.True(trivia4.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4048
Assert.True(trivia1.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4057
Assert.True(trivia2.
Kind
() == SyntaxKind.EndOfLineTrivia);
4062
Assert.True(trivia3.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4079
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
4089
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4096
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4104
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4108
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4113
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4123
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4127
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4131
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4139
Assert.True(trivia1.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4143
Assert.True(trivia2.
Kind
() == SyntaxKind.EndOfLineTrivia);
4148
Assert.True(trivia3.
Kind
() == SyntaxKind.DisabledTextTrivia);
4153
Assert.True(trivia4.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4174
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4180
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4183
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4192
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4214
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4220
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4223
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4232
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4245
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.WhitespaceTrivia);
4255
Assert.True(token.LeadingTrivia.Single().
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4262
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4277
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4285
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4288
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4300
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4308
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4311
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4322
Assert.True(trivia1.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4330
Assert.True(trivia2.
Kind
() == SyntaxKind.EndOfLineTrivia);
4333
Assert.True(trivia3.
Kind
() == SyntaxKind.DisabledTextTrivia);
4336
Assert.True(trivia4.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4351
Assert.True(trivia1.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4359
Assert.True(trivia2.
Kind
() == SyntaxKind.EndOfLineTrivia);
4362
Assert.True(trivia3.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4383
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4389
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4392
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4398
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4401
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4422
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4428
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4431
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4438
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4444
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4447
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4454
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4478
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4484
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4487
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4494
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4500
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4503
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4512
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4536
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4542
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4545
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4554
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
4560
Assert.True(trivia.
Kind
() == SyntaxKind.EndOfLineTrivia);
4563
Assert.True(trivia.
Kind
() == SyntaxKind.DisabledTextTrivia);
4570
Assert.True(trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia);
LexicalAndXml\PreprocessorTests.cs (10)
2106
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2128
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2216
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2237
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2258
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2279
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2300
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2321
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2342
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
2363
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, regionText.
Kind
());
LexicalAndXml\SyntaxTokenParserTests.cs (2)
86
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, docCommentTrivia.
Kind
());
422
Assert.Equal(kind, leadingTrivia[i].
Kind
());
LexicalAndXml\XmlDocCommentTests.cs (60)
83
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
102
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, leading[0].
Kind
());
119
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, leading[0].
Kind
());
120
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, leading[1].
Kind
());
134
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, leading[0].
Kind
());
152
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
173
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
198
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
220
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
243
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
266
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
293
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
321
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
345
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
370
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
396
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
423
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
450
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
478
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
507
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
537
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
566
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
596
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
627
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
650
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
672
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
694
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
716
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
738
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
758
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
792
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
825
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
856
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
884
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
909
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
935
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
960
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
987
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1018
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1046
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1071
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1096
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1123
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1156
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1187
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1213
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1240
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1268
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1313
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1337
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1362
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1386
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1411
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1435
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1460
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1484
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1564
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1592
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
1620
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, node.
Kind
());
1646
Assert.Equal(SyntaxKind.MultiLineDocumentationCommentTrivia, node.
Kind
());
Parsing\ScriptParsingTests.cs (5)
9652
Assert.Equal(SyntaxKind.ShebangDirectiveTrivia, leading[0].
Kind
());
9653
Assert.Equal(SyntaxKind.WhitespaceTrivia, leading[1].
Kind
());
9713
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, eof.GetLeadingTrivia().Single().
Kind
());
9726
Assert.Equal(SyntaxKind.ShebangDirectiveTrivia, trivia.
Kind
());
9741
Assert.Equal(SyntaxKind.PreprocessingMessageTrivia, skippedText.
Kind
());
Parsing\StatementParsingTests.cs (1)
1963
Assert.Equal(SyntaxKind.SkippedTokensTrivia, fs.ForEachKeyword.TrailingTrivia[0].
Kind
());
Syntax\StructuredTriviaTests.cs (3)
82
Assert.Equal(SyntaxKind.WhitespaceTrivia, trResult.
Kind
());
167
var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.
Kind
() == SyntaxKind.SingleLineDocumentationCommentTrivia);
183
var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.
Kind
() == SyntaxKind.MultiLineDocumentationCommentTrivia);
Syntax\SyntaxNodeTests.cs (18)
608
Assert.Equal(SyntaxKind.SingleLineCommentTrivia, list[0].
Kind
());
609
Assert.Equal(SyntaxKind.EndOfLineTrivia, list[1].
Kind
());
610
Assert.Equal(SyntaxKind.WhitespaceTrivia, list[2].
Kind
());
611
Assert.Equal(SyntaxKind.WhitespaceTrivia, list[3].
Kind
());
625
Assert.Equal(SyntaxKind.EndOfLineTrivia, list[0].
Kind
());
626
Assert.Equal(SyntaxKind.SingleLineDocumentationCommentTrivia, list[1].
Kind
());
627
Assert.Equal(SyntaxKind.DocumentationCommentExteriorTrivia, list[2].
Kind
());
628
Assert.Equal(SyntaxKind.WhitespaceTrivia, list[3].
Kind
());
629
Assert.Equal(SyntaxKind.DocumentationCommentExteriorTrivia, list[4].
Kind
());
630
Assert.Equal(SyntaxKind.WhitespaceTrivia, list[5].
Kind
());
631
Assert.Equal(SyntaxKind.WhitespaceTrivia, list[6].
Kind
());
768
Assert.Equal(SyntaxKind.None, trivia.
Kind
());
1332
Assert.Equal(SyntaxKind.DefineDirectiveTrivia, trivia.
Kind
());
1343
Assert.Equal(SyntaxKind.DefineDirectiveTrivia, trivia.
Kind
());
1347
Assert.NotEqual(SyntaxKind.None, parentTrivia.
Kind
());
2359
var deepTrivia = expr.GetDirectives().SelectMany(d => d.DescendantTrivia().Where(tr => tr.
Kind
() == SyntaxKind.WhitespaceTrivia)).ToList();
2395
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.
Kind
());
2417
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.
Kind
());
Syntax\SyntaxRewriterTests.cs (3)
200
trivia.
Kind
() == SyntaxKind.WhitespaceTrivia ? default(SyntaxTrivia) : trivia);
470
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.
Kind
());
497
Assert.Equal(SyntaxKind.MultiLineCommentTrivia, comment1.
Kind
());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
492
if (trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
Microsoft.CodeAnalysis.CSharp.Workspaces (60)
Classification\Worker.cs (3)
207
switch (trivia.
Kind
())
280
triviaList[index - 1].
Kind
() == SyntaxKind.EndOfLineTrivia &&
281
triviaList[index - 2].
Kind
() == SyntaxKind.ConflictMarkerTrivia)
Classification\Worker_DocumentationComments.cs (1)
70
switch (t.
Kind
())
Classification\Worker_Preprocesser.cs (2)
85
if (trivia.
Kind
() == SyntaxKind.WhitespaceTrivia)
101
if (allowComments && trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
65
if (leadingDirectives.Any(t => t.
Kind
() == SyntaxKind.EndIfDirectiveTrivia))
91
if (nextTrivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
603
var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.
Kind
()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
493
if (trivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (12)
22
=> kind = trivia.
Kind
();
25
=> trivia.
Kind
() is SyntaxKind.MultiLineCommentTrivia or SyntaxKind.SingleLineCommentTrivia;
37
=> trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia;
40
=> trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia;
43
=> trivia.
Kind
() == SyntaxKind.ShebangDirectiveTrivia;
47
if (trivia.
Kind
() != SyntaxKind.MultiLineCommentTrivia)
58
=> trivia.
Kind
() == SyntaxKind.SingleLineDocumentationCommentTrivia;
61
=> trivia.
Kind
() == SyntaxKind.MultiLineDocumentationCommentTrivia;
66
if (trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia)
75
else if (trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
148
=> trivia.
Kind
() == SyntaxKind.EndOfLineTrivia;
151
=> trivia.
Kind
() == SyntaxKind.WhitespaceTrivia;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (3)
21
.Where(t => t.
Kind
() == SyntaxKind.EndOfLineTrivia)
43
=> triviaList.SkipWhile(t => t.
Kind
() == SyntaxKind.WhitespaceTrivia);
52
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (9)
87
if (SyntaxFacts.IsPreprocessorDirective(trivia2.
Kind
()))
100
if (trivia2.
Kind
() is SyntaxKind.RegionDirectiveTrivia or SyntaxKind.EndRegionDirectiveTrivia)
149
if (!trivia1.IsKind(trivia2.
Kind
()) || trivia2.IsMultiLineComment() || trivia2.IsMultiLineDocComment() || existingWhitespaceBetween.Lines > 1)
199
var isStartOrEndOfFile = (this.Token1.RawKind == 0 || this.Token2.RawKind == 0) && (trivia1.
Kind
() == 0 || trivia2.
Kind
() == 0);
200
var isAtEndOfFileToken = (Token2.IsKind(SyntaxKind.EndOfFileToken) && trivia2.
Kind
() == 0);
210
if (trivia.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
324
if (trivia.
Kind
() == SyntaxKind.SkippedTokensTrivia)
353
if (trivia.
Kind
() == SyntaxKind.SkippedTokensTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
35
if (trivia.
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (7)
101
if (trivia.
Kind
() == SyntaxKind.WhitespaceTrivia)
105
else if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
113
else if (trivia.
Kind
() == SyntaxKind.SkippedTokensTrivia)
117
else if (trivia.
Kind
() is SyntaxKind.DisabledTextTrivia or
122
else if (trivia.
Kind
() == SyntaxKind.ConflictMarkerTrivia)
128
Contract.ThrowIfFalse(SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
()));
155
Debug.Assert(trivia.
Kind
() == SyntaxKind.WhitespaceTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (8)
127
if (trivia.
Kind
() != SyntaxKind.WhitespaceTrivia)
156
if (trivia.
Kind
() != SyntaxKind.EndOfLineTrivia)
215
if (trivia.
Kind
() is not SyntaxKind.SkippedTokensTrivia and
226
if (trivia.
Kind
() is not SyntaxKind.RegionDirectiveTrivia and
248
if (!SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
()))
271
trivia.
Kind
() == SyntaxKind.WhitespaceTrivia ||
272
trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
334
if (xmlTrivia.
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
120
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
482
return trivia.
Kind
() is SyntaxKind.WhitespaceTrivia
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
1109
if (trivia.
Kind
() == SyntaxKind.DisabledTextTrivia)
1226
=> trivia.
Kind
() == SyntaxKind.DocumentationCommentExteriorTrivia;
1370
=> SyntaxFacts.IsPreprocessorDirective(trivia.
Kind
());
1437
throw ExceptionUtilities.UnexpectedValue(trivia.
Kind
());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (2)
159
if (!trailingTrivia.Any() || trailingTrivia.Last().
Kind
() != SyntaxKind.EndOfLineTrivia)
177
=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.
Kind
() == SyntaxKind.EndOfLineTrivia));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
95
if (t1.
Kind
() == SyntaxKind.MultiLineCommentTrivia)
103
else if (t1.
Kind
() == SyntaxKind.SkippedTokensTrivia)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
124
var skippedTrivia = namespaceDeclaration.OpenBraceToken.TrailingTrivia.Single(t => t.
Kind
() is SyntaxKind.SkippedTokensTrivia);
Microsoft.CodeAnalysis.UnitTests (2)
CommonSyntaxTests.cs (2)
117
Assert.Equal(CSharp.SyntaxKind.MultiLineCommentTrivia, CSharp.CSharpExtensions.
Kind
(csharpTrivia));
202
Assert.Equal(CSharp.SyntaxKind.None, CSharp.CSharpExtensions.
Kind
(trivia));
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\CSharpCodeModelService.cs (4)
1231
else if (trivia.
Kind
() is not SyntaxKind.WhitespaceTrivia and
1309
leadingTriviaList[firstIndex].
Kind
() == SyntaxKind.EndOfLineTrivia)
2858
if (trivia.
Kind
() == SyntaxKind.EndOfLineTrivia)
2869
else if (trivia.
Kind
() != SyntaxKind.WhitespaceTrivia)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
42
if (trivia.
Kind
() == SyntaxKind.SingleLineCommentTrivia)