87 references to WhitespaceTrivia
Microsoft.CodeAnalysis.CSharp (9)
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
95
case SyntaxKind.
WhitespaceTrivia
:
Parser\DirectiveParser.cs (1)
301
if (t.Kind == SyntaxKind.
WhitespaceTrivia
)
Syntax\InternalSyntax\SyntaxFactory.cs (1)
82
var trivia = SyntaxTrivia.Create(SyntaxKind.
WhitespaceTrivia
, text);
Syntax\InternalSyntax\SyntaxTrivia.cs (1)
38
internal override bool ShouldReuseInSerialization => this.Kind == SyntaxKind.
WhitespaceTrivia
&&
Syntax\SyntaxFactory.cs (2)
183
/// <see cref="SyntaxKind.
WhitespaceTrivia
"/>, <see cref="SyntaxKind.EndOfLineTrivia"/>,
204
case SyntaxKind.
WhitespaceTrivia
:
Syntax\SyntaxKindFacts.cs (1)
230
case SyntaxKind.
WhitespaceTrivia
:
Syntax\SyntaxNormalizer.cs (2)
1028
if (trivia.IsKind(SyntaxKind.
WhitespaceTrivia
) ||
1167
case SyntaxKind.
WhitespaceTrivia
:
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
CSharpSyntaxKinds.cs (1)
29
public int WhitespaceTrivia => (int)SyntaxKind.
WhitespaceTrivia
;
CSharpTriviaFormatter.cs (1)
38
=> trivia.RawKind == (int)SyntaxKind.
WhitespaceTrivia
;
ElasticTriviaFormattingRule.cs (1)
474
return trivia.Kind() is SyntaxKind.
WhitespaceTrivia
SyntaxTriviaExtensions.cs (1)
151
=> trivia.Kind() == SyntaxKind.
WhitespaceTrivia
;
SyntaxTriviaListExtensions.cs (3)
34
.Where(t => t is (kind: SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia or SyntaxKind.
WhitespaceTrivia
))
39
=> triviaList.SkipWhile(t => t.Kind() == SyntaxKind.
WhitespaceTrivia
);
52
SyntaxKind.
WhitespaceTrivia
);
TriviaDataFactory.Analyzer.cs (2)
101
if (trivia.Kind() == SyntaxKind.
WhitespaceTrivia
)
155
Debug.Assert(trivia.Kind() == SyntaxKind.
WhitespaceTrivia
);
TriviaDataFactory.CodeShapeAnalyzer.cs (3)
48
if (trivia.Kind() == SyntaxKind.
WhitespaceTrivia
)
127
if (trivia.Kind() != SyntaxKind.
WhitespaceTrivia
)
271
trivia.Kind() == SyntaxKind.
WhitespaceTrivia
||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
ConstructorInitializerPlacementCodeFixProvider.cs (1)
110
return previousToken.TrailingTrivia.All(t => t.Kind() == SyntaxKind.
WhitespaceTrivia
)
ConvertNamespaceTransform.cs (1)
177
if (leadingTrivia is [(kind: SyntaxKind.
WhitespaceTrivia
), (kind: SyntaxKind.EndOfLineTrivia), ..])
CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
52
protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.Kind() is SyntaxKind.
WhitespaceTrivia
or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
19
while (finalTrivia is [.., (kind: SyntaxKind.
WhitespaceTrivia
)])
Microsoft.CodeAnalysis.CSharp.Features (21)
ChangeSignature\CSharpChangeSignatureService.cs (2)
667
var oldOnlyHasWhitespaceTrivia = oldTrivia.All(t => t.IsKind(SyntaxKind.
WhitespaceTrivia
));
670
var newOnlyHasWhitespaceTrivia = newTrivia.All(t => t.IsKind(SyntaxKind.
WhitespaceTrivia
));
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
189
case SyntaxKind.
WhitespaceTrivia
:
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
331
.SkipWhile(t => t.IsKind(SyntaxKind.
WhitespaceTrivia
))
337
.SkipWhile(t => t is (kind: SyntaxKind.
WhitespaceTrivia
or SyntaxKind.EndOfLineTrivia))
ConstructorInitializerPlacementCodeFixProvider.cs (1)
110
return previousToken.TrailingTrivia.All(t => t.Kind() == SyntaxKind.
WhitespaceTrivia
)
ConvertNamespaceTransform.cs (1)
177
if (leadingTrivia is [(kind: SyntaxKind.
WhitespaceTrivia
), (kind: SyntaxKind.EndOfLineTrivia), ..])
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
226
namespaceDeclaration.GetLeadingTrivia().TakeWhile(t => t.Kind() is SyntaxKind.
WhitespaceTrivia
or SyntaxKind.EndOfLineTrivia));
CSharpUseCompoundAssignmentCodeFixProvider.cs (1)
52
protected override SyntaxTriviaList PrepareRightExpressionLeadingTrivia(SyntaxTriviaList initialTrivia) => initialTrivia.SkipWhile(el => el.Kind() is SyntaxKind.
WhitespaceTrivia
or SyntaxKind.EndOfLineTrivia).ToSyntaxTriviaList();
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
23
private static readonly HashSet<int> s_nonNoisySyntaxKindSet = new HashSet<int>(new int[] { (int)SyntaxKind.
WhitespaceTrivia
, (int)SyntaxKind.EndOfLineTrivia });
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
213
if (trivia.Kind() is not SyntaxKind.
WhitespaceTrivia
and
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
33
: base(document, result, (int)SyntaxKind.EndOfLineTrivia, (int)SyntaxKind.
WhitespaceTrivia
)
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
135
else if (!trivia.IsKind(SyntaxKind.
WhitespaceTrivia
) && !trivia.IsKind(SyntaxKind.EndOfLineTrivia))
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
102
originalTypeDeclaration.CloseBraceToken.WithPrependedLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, indentationString)));
Snippets\CSharpConstructorSnippetProvider.cs (1)
90
blockStatement = blockStatement!.WithCloseBraceToken(blockStatement.CloseBraceToken.WithPrependedLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, indentationString)));
Snippets\CSharpElseSnippetProvider.cs (1)
112
blockStatement = blockStatement.WithCloseBraceToken(blockStatement.CloseBraceToken.WithPrependedLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, indentationString)));
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
99
blockStatement = blockStatement.WithCloseBraceToken(blockStatement.CloseBraceToken.WithPrependedLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, indentationString)));
Snippets\CSharpIfSnippetProvider.cs (1)
76
blockStatement = blockStatement.WithCloseBraceToken(blockStatement.CloseBraceToken.WithPrependedLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, indentationString)));
Snippets\CSharpWhileLoopSnippetProvider.cs (1)
76
blockStatement = blockStatement.WithCloseBraceToken(blockStatement.CloseBraceToken.WithPrependedLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, indentationString)));
Structure\CSharpStructureHelpers.cs (2)
97
else if (!trivia.IsKind(SyntaxKind.
WhitespaceTrivia
))
222
SyntaxKind.
WhitespaceTrivia
or SyntaxKind.EndOfLineTrivia or SyntaxKind.EndOfFileToken))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (23)
LexicalAndXml\LexicalTests.cs (13)
3204
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, leading[0].Kind());
3210
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, trailing[0].Kind());
3222
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, leading[0].Kind());
3228
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, trailing[0].Kind());
3243
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, leading[0].Kind());
3249
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, trailing[0].Kind());
3425
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
3453
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
3484
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
3507
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
3525
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
3664
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
3830
Assert.True(token.LeadingTrivia.Single().Kind() == SyntaxKind.
WhitespaceTrivia
);
Parsing\ScriptParsingTests.cs (1)
9657
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, leading[1].Kind());
Syntax\StructuredTriviaTests.cs (1)
82
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, trResult.Kind());
Syntax\SyntaxNodeTests.cs (7)
610
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, list[2].Kind());
611
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, list[3].Kind());
628
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, list[3].Kind());
630
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, list[5].Kind());
631
Assert.Equal(SyntaxKind.
WhitespaceTrivia
, list[6].Kind());
2348
var deepTrivia = expr.GetDirectives().SelectMany(d => d.DescendantTrivia().Where(tr => tr.Kind() == SyntaxKind.
WhitespaceTrivia
)).ToList();
2372
var trivia = expr.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.
WhitespaceTrivia
)).ToList();
Syntax\SyntaxRewriterTests.cs (1)
200
trivia.Kind() == SyntaxKind.
WhitespaceTrivia
? default(SyntaxTrivia) : trivia);
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
Classification\Worker_Preprocesser.cs (1)
85
if (trivia.Kind() == SyntaxKind.
WhitespaceTrivia
)
CSharpSyntaxKinds.cs (1)
29
public int WhitespaceTrivia => (int)SyntaxKind.
WhitespaceTrivia
;
CSharpTriviaFormatter.cs (1)
38
=> trivia.RawKind == (int)SyntaxKind.
WhitespaceTrivia
;
ElasticTriviaFormattingRule.cs (1)
474
return trivia.Kind() is SyntaxKind.
WhitespaceTrivia
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxNodeExtensions.cs\SyntaxNodeExtensions.cs (1)
19
while (finalTrivia is [.., (kind: SyntaxKind.
WhitespaceTrivia
)])
Simplification\CSharpSimplificationService.Expander.cs (1)
31
private static readonly SyntaxTrivia s_oneWhitespaceSeparator = SyntaxFactory.SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
, " ");
SyntaxTriviaExtensions.cs (1)
151
=> trivia.Kind() == SyntaxKind.
WhitespaceTrivia
;
SyntaxTriviaListExtensions.cs (3)
34
.Where(t => t is (kind: SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia or SyntaxKind.
WhitespaceTrivia
))
39
=> triviaList.SkipWhile(t => t.Kind() == SyntaxKind.
WhitespaceTrivia
);
52
SyntaxKind.
WhitespaceTrivia
);
TriviaDataFactory.Analyzer.cs (2)
101
if (trivia.Kind() == SyntaxKind.
WhitespaceTrivia
)
155
Debug.Assert(trivia.Kind() == SyntaxKind.
WhitespaceTrivia
);
TriviaDataFactory.CodeShapeAnalyzer.cs (3)
48
if (trivia.Kind() == SyntaxKind.
WhitespaceTrivia
)
127
if (trivia.Kind() != SyntaxKind.
WhitespaceTrivia
)
271
trivia.Kind() == SyntaxKind.
WhitespaceTrivia
||
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (2)
1234
else if (trivia.Kind() is not SyntaxKind.
WhitespaceTrivia
and
2873
else if (trivia.Kind() != SyntaxKind.
WhitespaceTrivia
)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
164
.Where(t => t is not SyntaxTrivia(SyntaxKind.
WhitespaceTrivia
or SyntaxKind.EndOfLineTrivia))