61 references to FindToken
Microsoft.CodeAnalysis.CSharp (12)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1081
token = containingNode.
FindToken
(_position);
Compilation\CSharpSemanticModel.cs (4)
437
SyntaxToken token = Root.
FindToken
(position);
793
var existingConstructorInitializer = this.Root.
FindToken
(position).Parent.AncestorsAndSelf().OfType<ConstructorInitializerSyntax>().FirstOrDefault();
865
var existingConstructorInitializer = this.Root.
FindToken
(position).Parent.AncestorsAndSelf().OfType<PrimaryConstructorBaseTypeSyntax>().FirstOrDefault();
1843
var token = this.Root.
FindToken
(position);
Compilation\MemberSemanticModel.cs (1)
1583
SyntaxToken token = this.Root.
FindToken
(position);
Compilation\MethodBodySemanticModel.cs (2)
241
Root.
FindToken
(position).Parent?.AncestorsAndSelf().OfType<ConstructorInitializerSyntax>().FirstOrDefault()?.Parent == Root)
263
if (Root.
FindToken
(position).Parent?.AncestorsAndSelf().OfType<PrimaryConstructorBaseTypeSyntax>().FirstOrDefault() == typeDecl.PrimaryConstructorBaseTypeIfClass)
Compilation\SyntaxTreeSemanticModel.cs (2)
704
var existingConstructorInitializer = this.Root.
FindToken
(position).Parent.AncestorsAndSelf().OfType<ConstructorInitializerSyntax>().FirstOrDefault();
723
var existingConstructorInitializer = this.Root.
FindToken
(position).Parent.AncestorsAndSelf().OfType<PrimaryConstructorBaseTypeSyntax>().FirstOrDefault();
Parser\Blender.cs (1)
162
var token = oldTree.
FindToken
(start, findInsideTrivia: false);
Syntax\CSharpSyntaxNode.cs (1)
381
SyntaxToken nonTriviaToken = this.
FindToken
(position, findInsideTrivia: false);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
441
var token = root.
FindToken
(position, findInsideTrivia: true);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3417
var endToken = root.
FindToken
(position);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Attributes\AttributeTests.cs (1)
5718
var m = (ExpressionSyntax)cm.SyntaxTrees[0].GetCompilationUnitRoot().
FindToken
(index).Parent.Parent;
FlowAnalysis\RegionAnalysisTests.cs (1)
4427
var tok = tree.GetCompilationUnitRoot().
FindToken
(index);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\LookupPositionTests.cs (1)
3129
SyntaxToken token = model.SyntaxTree.GetCompilationUnitRoot().
FindToken
(position, findInsideTrivia: true);
Semantics\QueryTests.cs (7)
2177
SelectClauseSyntax selectClause = (SelectClauseSyntax)tree.GetCompilationUnitRoot().
FindToken
(sourceCode.IndexOf("select", StringComparison.Ordinal)).Parent;
2207
SelectClauseSyntax selectClause = (SelectClauseSyntax)tree.GetCompilationUnitRoot().
FindToken
(sourceCode.IndexOf("select w", StringComparison.Ordinal)).Parent;
2234
var e = (IdentifierNameSyntax)tree.GetCompilationUnitRoot().
FindToken
(sourceCode.IndexOf("x+1", StringComparison.Ordinal)).Parent;
2240
e = (IdentifierNameSyntax)tree.GetCompilationUnitRoot().
FindToken
(sourceCode.IndexOf("w+1", StringComparison.Ordinal)).Parent;
2299
var selectExpression = tree.GetCompilationUnitRoot().
FindToken
(sourceCode.IndexOf('5'));
3134
var selectNode = tree.GetCompilationUnitRoot().
FindToken
(index).Parent as SelectClauseSyntax;
3162
var joinNode = tree.GetCompilationUnitRoot().
FindToken
(index).Parent as JoinClauseSyntax;
Semantics\TargetTypedDefaultTests.cs (1)
2483
var digit = tree.GetCompilationUnitRoot().
FindToken
(source.IndexOf('2'));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (30)
Compilation\GetSemanticInfoTests.cs (3)
4212
var syntax = tree.GetCompilationUnitRoot().
FindToken
(position).Parent.DescendantNodesAndSelf().OfType<OmittedTypeArgumentSyntax>().Single();
4242
var syntax = tree.GetCompilationUnitRoot().
FindToken
(position).Parent.DescendantNodesAndSelf().OfType<OmittedTypeArgumentSyntax>().Single();
4272
var syntax = tree.GetCompilationUnitRoot().
FindToken
(position).Parent.DescendantNodesAndSelf().OfType<GenericNameSyntax>().Single();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (16)
429
var node = root.
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("public event D Iter3", StringComparison.Ordinal)).Parent as BasePropertyDeclarationSyntax;
3314
var paramNode = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("param1", StringComparison.Ordinal)).Parent;
3341
var paramNode = root.
FindToken
(root.ToFullString().IndexOf('x')).Parent;
3367
var paramNode = root.
FindToken
(root.ToFullString().IndexOf('x')).Parent;
3408
var foreachNode = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("foreach", StringComparison.Ordinal)).Parent;
3429
var delegateNode = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("delegate", StringComparison.Ordinal)).Parent;
3448
var usingNode = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("using", StringComparison.Ordinal)).Parent;
3477
var foreachNode = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent;
3501
var foreachNode = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent;
3528
var foreachNode1 = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent;
3534
var foreachNode2 = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("bbb", StringComparison.Ordinal)).Parent;
3565
var catchDeclaration = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent;
3586
var methodDecl = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("Goo", StringComparison.Ordinal)).Parent;
3611
var methodDecl = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("Goo", StringComparison.Ordinal)).Parent;
3668
dynamic methodDecl = (MethodDeclarationSyntax)tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf("Main", StringComparison.Ordinal)).Parent;
3686
var globalStmt = tree.GetCompilationUnitRoot().
FindToken
(tree.GetCompilationUnitRoot().ToFullString().IndexOf('/')).Parent.AncestorsAndSelf().Single(x => x.IsKind(SyntaxKind.GlobalStatement));
DeclarationTests.cs (1)
918
var token = _countedSyntaxTree.GetCompilationUnitRoot(cancellationToken).
FindToken
(nodeInUnderlying.SpanStart);
Symbols\ConversionTests.cs (3)
394
.
FindToken
(source.IndexOf("ii", StringComparison.Ordinal)).Parent;
401
.
FindToken
(source.IndexOf("jj)", StringComparison.Ordinal)).Parent;
407
.
FindToken
(source.IndexOf("ss)", StringComparison.Ordinal)).Parent;
Symbols\ExtensionMethodTests.cs (2)
2727
var node = tree.GetCompilationUnitRoot().
FindToken
(code.IndexOf("GetHashCode", StringComparison.Ordinal)).Parent;
2737
node = tree.GetCompilationUnitRoot().
FindToken
(code.IndexOf("Cast<T1>", StringComparison.Ordinal)).Parent;
Symbols\Source\DeclaringSyntaxNodeTests.cs (5)
155
var node = tree.GetCompilationUnitRoot().
FindToken
(position).Parent.FirstAncestorOrSelf<TNode>();
263
var declaratorA1 = tree.GetCompilationUnitRoot().
FindToken
(posA1).Parent.FirstAncestorOrSelf<VariableDeclaratorSyntax>();
307
var declaratorQ = tree.GetCompilationUnitRoot().
FindToken
(posQ).Parent.FirstAncestorOrSelf<VariableDeclaratorSyntax>();
314
var declaratorX = tree.GetCompilationUnitRoot().
FindToken
(posX).Parent.FirstAncestorOrSelf<VariableDeclaratorSyntax>();
321
var declaratorZ = tree.GetCompilationUnitRoot().
FindToken
(posZ).Parent.FirstAncestorOrSelf<VariableDeclaratorSyntax>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (5)
Diagnostics\LocationsTests.cs (1)
455
var token = syntaxTree.GetCompilationUnitRoot().
FindToken
(sampleProgram.IndexOf("ct", StringComparison.Ordinal));
Syntax\StructuredTriviaTests.cs (1)
77
var result = identExpr.
FindToken
(3, true);
Syntax\SyntaxNodeTests.cs (3)
674
var token = tree.GetCompilationUnitRoot().
FindToken
("class\n #i".Length);
677
token = tree.GetCompilationUnitRoot().
FindToken
("class\n #i".Length, findInsideTrivia: true);
3403
var token = syntaxTree.GetCompilationUnitRoot().
FindToken
(code.IndexOf("using Lib;", StringComparison.Ordinal));
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
441
var token = root.
FindToken
(position, findInsideTrivia: true);