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