142 references to IsToken
AnalyzerRunner (1)
Program.cs (1)
213var numberOfTokens = tokensAndNodes.Count(x => x.IsToken);
Microsoft.CodeAnalysis (33)
Syntax\CommonSyntaxNodeRemover.cs (1)
40nodesAndSeparators[nodeIndex + 1].IsToken;
Syntax\SeparatedSyntaxList.cs (5)
77Debug.Assert(item.IsToken, "Separator token missing in separated list."); 166return _list.Where(n => n.IsToken).Select(n => n.AsToken()); 416if (previous.IsToken && !KeepSeparatorWithPreviousNode(previous.AsToken())) 493if (index < nodesWithSeps.Count && nodesWithSeps[index].IsToken) 497else if (index > 0 && nodesWithSeps[index - 1].IsToken)
Syntax\SyntaxDiffer.cs (7)
204bool oldIsToken = _oldNodes.Peek().IsToken; 205bool newIsToken = _newNodes.Peek().IsToken; 372if (sim == node.FullSpan.Length && node.IsToken) 431if (node1.IsToken && node2.IsToken) 479if (n1.IsToken) 492else if (n2.IsToken)
Syntax\SyntaxNavigator.cs (8)
109if (child.IsToken) 156if (child.IsToken) 444if (child.IsToken) 494if (child.IsToken) 552if (child.IsToken) 570else if (child.IsToken && child.AsToken() == current) 606if (child.IsToken) 624else if (child.IsToken && child.AsToken() == current)
Syntax\SyntaxNode.cs (6)
1034if (nodeOrToken.IsToken) 1046return this.DescendantNodesAndTokens(descendIntoChildren, descendIntoTrivia).Where(sn => sn.IsToken).Select(sn => sn.AsToken()); 1054return this.DescendantNodesAndTokens(span, descendIntoChildren, descendIntoTrivia).Where(sn => sn.IsToken).Select(sn => sn.AsToken()); 1125else if (element.IsToken) 1301return this.GetAnnotatedNodesAndTokens(syntaxAnnotation).Where(n => n.IsToken).Select(n => n.AsToken()); 1309return this.GetAnnotatedNodesAndTokens(annotationKind).Where(n => n.IsToken).Select(n => n.AsToken());
Syntax\SyntaxNode.Iterators.cs (3)
469else if (value.IsToken) 545else if (value.IsToken) 586else if (value.IsToken)
Syntax\SyntaxNodeOrToken.cs (1)
170if (IsToken)
Syntax\SyntaxNodeOrTokenList.cs (1)
85return nodesAndTokens[0].IsToken
Syntax\SyntaxWalker.cs (1)
45else if (child.IsToken)
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
64else if (child.IsToken)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
86if (ValuePattern.IsToken)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
74if (child.IsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
53if (currentNodeOrToken.IsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (2)
178=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsToken).Select(nt => nt.AsToken()); 190=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsToken && this.HasAnnotations<TSpecificAnnotation>(nt)).Select(nt => nt.AsToken());
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
235(currentNodeOrToken.IsToken || currentNodeOrToken.AsNode() is TExpressionSyntax or TStatementSyntax or TCrefSyntax))
Microsoft.CodeAnalysis.CSharp (9)
Compilation\MemberSemanticModel.cs (1)
766if (label.IdentifierNodeOrToken.IsToken &&
CSharpExtensions.cs (1)
334if (nodeOrToken.IsToken)
Parser\Blender.Reader.cs (2)
242(nodeOrToken.IsToken && ((CSharpSyntaxNode)nodeOrToken.AsToken().Node).ContainsSkippedText && nodeOrToken.Parent.ContainsDiagnostics)) 263if ((nodeOrToken.IsToken && nodeOrToken.AsToken().IsMissing) ||
Symbols\Source\SourceLabelSymbol.cs (3)
31Debug.Assert(identifierNodeOrToken.IsToken || identifierNodeOrToken.IsNode); 81return _identifierNodeOrToken.IsToken && _identifierNodeOrToken.Parent == null 93if (_identifierNodeOrToken.IsToken)
Syntax\SyntaxFactory.cs (1)
1498if (element.IsToken == ((i & 1) == 0))
Syntax\SyntaxNodeRemover.cs (1)
218if (item.IsToken) // separator
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
285if (!child.IsToken)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
80var addLineBreak = item.IsToken || item == nodeOrTokenList.Last();
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
173if (nodeOrToken.IsToken)
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
47if (nodeOrToken.IsToken)
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
61t => t.IsToken ? t.AsToken().WithoutTrivia() : s_omittedArgument));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
668if (item.IsToken && item.AsToken() == token)
Microsoft.CodeAnalysis.CSharp.Features (13)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
115if (item.IsToken && item.AsToken() == token) 137if (item.IsToken && item.AsToken() == token)
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
72=> declOrComma.IsToken
EditAndContinue\BreakpointSpans.cs (1)
154if (nodeOrToken.IsToken)
EditAndContinue\SyntaxComparer.cs (3)
1544Debug.Assert(newNodeOrToken.IsToken == oldNodeOrToken.IsToken); 1547if (oldNodeOrToken.IsToken)
Highlighting\KeywordHighlighters\ReturnStatementHighlighter.cs (1)
59if (child.IsToken)
Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs (1)
63if (child.IsToken)
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
80var addLineBreak = item.IsToken || item == nodeOrTokenList.Last();
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
173if (nodeOrToken.IsToken)
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
47if (nodeOrToken.IsToken)
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
61t => t.IsToken ? t.AsToken().WithoutTrivia() : s_omittedArgument));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (8)
ParentChecker.cs (1)
22if (nodeOrToken.IsToken)
Syntax\SyntaxAnnotationTests.cs (5)
193var token = GetAllNodesAndTokens(tree.GetCompilationUnitRoot()).First(t => t.IsToken).AsToken(); 444else if (sourceTreeNodeOrTokenEnumerator.Current.IsToken) 537if (oldNodeOrToken.IsToken) 587if (nodeOrToken.IsToken) 605if (oldNodeOrToken.IsToken)
Syntax\SyntaxListTests.cs (1)
311Assert.True(item.IsToken);
Syntax\SyntaxNodeTests.cs (1)
3526var token = (SyntaxToken)children.First(n => n.IsToken);
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
Classification\Worker.cs (2)
71Debug.Assert(nodeOrToken.IsNode || nodeOrToken.IsToken); 73if (nodeOrToken.IsToken)
Simplification\Simplifiers\NameSimplifier.cs (2)
142if (annotatedNodeOrToken.IsToken) 155if (annotatedNodeOrToken.IsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
285if (!child.IsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
668if (item.IsToken && item.AsToken() == token)
Microsoft.CodeAnalysis.EditorFeatures (2)
CodeActions\CodeActionEditHandlerService.cs (2)
351resolvedRenameToken.IsToken) 369resolvedRenameToken.IsToken)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Structure\AbstractSyntaxNodeStructureProviderTests.cs (1)
47var previousToken = root.DescendantNodesAndTokens(descendIntoTrivia: true).TakeWhile(nodeOrToken => nodeOrToken != node).LastOrDefault(nodeOrToken => nodeOrToken.IsToken).AsToken();
Microsoft.CodeAnalysis.Features (11)
BraceMatching\AbstractBraceMatcher.cs (1)
32where child.IsToken
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
724=> arg.IsToken
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
65if (element.IsToken && position >= element.Span.End)
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
64else if (child.IsToken)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
86if (ValuePattern.IsToken)
Wrapping\AbstractWrapper.cs (2)
52var firstToken = item.IsToken ? item.AsToken() : item.AsNode()!.GetFirstToken(); 53var lastToken = item.IsToken ? item.AsToken() : item.AsNode()!.GetLastToken();
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (1)
80((i % 2) == 1 && item.IsToken));
Wrapping\Edit.cs (2)
68var leftLastToken = left.IsToken ? left.AsToken() : left.AsNode()!.GetLastToken(); 69var rightFirstToken = right.IsToken ? right.AsToken() : right.AsNode()!.GetFirstToken();
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (1)
340Contract.ThrowIfFalse(comma.IsToken);
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
246if (nodeOrToken.IsToken && _spans.Any(s => s.OverlapsWith(nodeOrToken.FullSpan)))
Microsoft.CodeAnalysis.UnitTests (2)
CommonSyntaxTests.cs (2)
48Assert.True(d.IsToken); 65Assert.True(d.IsToken);
Microsoft.CodeAnalysis.VisualBasic (5)
Syntax\SyntaxNodeFactories.vb (1)
1000If element.IsToken = ((i And 1) = 0) Then
Syntax\SyntaxNodeRemover.vb (1)
151If item.IsToken Then ' separator
Syntax\VisualBasicSyntaxNode.vb (2)
218If Not nodeOrToken.IsToken Then 220ElseIf nodeOrToken.IsToken Then
Syntax\VisualBasicSyntaxTree.vb (1)
399If node.IsToken Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (1)
134If n.IsToken AndAlso n.AsToken() = token Then
Microsoft.CodeAnalysis.VisualBasic.Features (6)
ConvertAnonymousType\VisualBasicConvertAnonymousTypeToClassCodeRefactoringProvider.vb (1)
51Return If(declOrComma.IsToken,
EditAndContinue\SyntaxComparer.vb (3)
1323Debug.Assert(newNodeOrToken.IsToken = oldNodeOrToken.IsToken) 1326If oldNodeOrToken.IsToken Then
Highlighting\KeywordHighlighters\TryBlockHighlighter.vb (1)
62If childNodeOrToken.IsToken Then
LineSeparators\VisualBasicLineSeparatorService.vb (1)
27If nodeOrToken.IsToken Then
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (9)
Syntax\SyntaxAnnotationTests.vb (5)
178Dim token = GetAllNodesAndTokens(tree.GetRoot()).First(Function(t) t.IsToken).AsToken() 409ElseIf sourceTreeNodeOrTokenEnumerator.Current.IsToken Then 495If oldNodeOrToken.IsToken Then 535If nodeOrToken.IsToken Then 549If oldNodeOrToken.IsToken Then
Syntax\SyntaxListTests.vb (1)
238Assert.True(item.IsToken)
TestSyntaxNodes.vb (3)
2180Assert.Equal(sN.IsToken, cS.IsToken) 2198Assert.True(sn.IsToken)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
ParserTestUtilities.vb (4)
128If nodeOrToken.IsToken Then 677If node.IsToken Then 732If node.IsToken Then 765If node.IsToken Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
Classification\Worker.vb (1)
188If child.IsToken Then
Simplification\Simplifiers\NameSimplifier.vb (2)
87If annotatedNodeOrToken.IsToken Then 96If annotatedNodeOrToken.IsToken Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (1)
134If n.IsToken AndAlso n.AsToken() = token Then
Microsoft.CodeAnalysis.Workspaces (12)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (4)
143if (currentOld.IsToken || currentNew.IsToken) 210if (currentOld.IsToken || currentNew.IsToken)
CodeCleanup\AbstractCodeCleanerService.cs (2)
132var previousTokens = node.GetAnnotatedNodesAndTokens(previousMarkerAnnotation).Where(n => n.IsToken).Select(n => n.AsToken()); 133var nextTokens = node.GetAnnotatedNodesAndTokens(nextMarkerAnnotation).Where(n => n.IsToken).Select(n => n.AsToken());
FindSymbols\FindReferences\FindReferenceCache.cs (1)
169else if (current.IsToken)
Shared\Utilities\SemanticMap.Walker.cs (1)
27else if (child.IsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
53if (currentNodeOrToken.IsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (2)
178=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsToken).Select(nt => nt.AsToken()); 190=> node.GetAnnotatedNodesAndTokens(annotationKind).Where(nt => nt.IsToken && this.HasAnnotations<TSpecificAnnotation>(nt)).Select(nt => nt.AsToken());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
235(currentNodeOrToken.IsToken || currentNodeOrToken.AsNode() is TExpressionSyntax or TStatementSyntax or TCrefSyntax))
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
443if (child.IsToken)