363 references to FindToken
Microsoft.CodeAnalysis (2)
Syntax\SyntaxNode.cs (2)
966var node = FindToken(span.Start, findInsideTrivia) 1512var token = this.FindToken(position, findInsideTrivia: false);
Microsoft.CodeAnalysis.CodeStyle (16)
AbstractHeaderFacts.cs (1)
73var tokenToRightOrIn = root.FindToken(position);
AbstractIndentation.Indenter.cs (1)
125var token = Root.FindToken(LineToBeIndented.Start);
AbstractSelectedMembers.cs (2)
66? root.FindToken(textSpan.Start) 167var token = root.FindToken(position);
BaseIndentationFormattingRule.cs (1)
152token1 = root.FindToken(span.Start);
BottomUpBaseIndentationFinder.cs (1)
167baseToken = baseToken.SyntaxTree.GetRoot(cancellationToken).FindToken(textLine.Start);
CommonFormattingHelpers.cs (5)
83var startToken = root.FindToken(textSpan.Start); 101root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End); 284nextToken = parentNode.FindToken(backwardPosition + 1); 310previousToken = parentNode.FindToken(forwardPosition + 1); 364var startToken = root.FindToken(span.Start).GetPreviousToken();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
77var token = root.FindToken(position, findInsideTrivia); 134var result = root.FindToken(position, findInsideTrivia: true);
LocationExtensions.cs (1)
20=> location.GetSourceTreeOrThrow().GetRoot(cancellationToken).FindToken(location.SourceSpan.Start);
SyntaxNodeExtensions.cs (1)
622? root.FindToken(position, includeSkipped || includeDirectives || includeDocumentationComments)
SyntaxTokenExtensions.cs (1)
71var token = root.FindToken(position, findInsideTrivia);
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
AbstractCodeGenerationService.cs (3)
528var previousToken = root.FindToken(attributeToRemove.FullSpan.Start - 1); 530var nextToken = root.FindToken(attributeToRemove.FullSpan.End + 1); 540var tokenToInsertTrivia = node.FindToken(position);
AbstractConvertToAsyncCodeFixProvider.cs (1)
51var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
AbstractIteratorCodeFixProvider.cs (1)
47var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
AbstractMoveDeclarationNearReferenceService.State.cs (1)
107let token = syntaxRoot.FindToken(r.Location.SourceSpan.Start)
AbstractMultipleBlankLinesCodeFixProvider.cs (1)
57var token = root.FindToken(diagnostic.AdditionalLocations[0].SourceSpan.Start);
DocumentExtensions.cs (1)
119var token = root.FindToken(span.Start);
Microsoft.CodeAnalysis.CSharp (8)
Compilation\CSharpCompilation.cs (1)
2419var node = info.Tree.GetRoot(cancellationToken).FindToken(info.Span.Start, findInsideTrivia: false).
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
58var attributedNode = model.SyntaxTree.GetRoot().FindToken(position).Parent;
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (3)
51var token = semanticModelOpt.SyntaxTree.GetRoot().FindToken(positionOpt); 188var token = semanticModel.SyntaxTree.GetRoot().FindToken(position); 228var token = location.SourceTree.GetRoot().FindToken(positionOpt);
Symbols\RangeVariableSymbol.cs (1)
64SyntaxToken token = (SyntaxToken)_locations[0].SourceTree.GetRoot().FindToken(_locations[0].SourceSpan.Start);
Symbols\Symbol.cs (1)
381SyntaxToken token = location.SourceTree.GetRoot().FindToken(location.SourceSpan.Start);
Syntax\CSharpSyntaxNode.cs (1)
384return base.FindToken(position, findInsideTrivia);
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
CSharpSyntaxFacts.cs (2)
624.FindToken(position) 706var node = root.FindToken(position).Parent;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
418var token = syntaxTree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia: true);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (15)
ArrowExpressionClausePlacementCodeFixProvider.cs (1)
58var arrowToken = root.FindToken(diagnostic.Location.SourceSpan.Start);
ConditionalExpressionPlacementCodeFixProvider.cs (1)
58var questionToken = root.FindToken(diagnostic.Location.SourceSpan.Start);
ConsecutiveBracePlacementCodeFixProvider.cs (1)
72var token = root.FindToken(diagnostic.Location.SourceSpan.Start);
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
42var token = root.FindToken(diagnosticSpan.Start);
CSharpAddYieldCodeFixProvider.cs (1)
217var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
CSharpCodeGenerationHelpers.cs (1)
203return contextTree?.GetRoot(cancellationToken).FindToken(contextLocation!.SourceSpan.Start).Parent;
CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
50var token = root.FindToken(diagnostic.Location.SourceSpan.Start);
CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
55.Select(d => root.FindToken(d.Location.SourceSpan.Start))
CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
46var token = syntaxRoot.FindToken(context.Span.Start); 74var defaultToken = syntaxRoot.FindToken(span.Start);
CSharpTypeInferenceService.TypeInferrer.cs (1)
2104var tokenInOriginalTree = originalSemanticModel.SyntaxTree.GetRoot(CancellationToken).FindToken(currentSemanticModel.OriginalPositionForSpeculation);
HideBaseCodeFixProvider.cs (1)
40var token = root.FindToken(diagnosticSpan.Start);
ITypeSymbolExtensions.cs (1)
144var namespaceUsings = root.FindToken(position).Parent!.GetAncestors<BaseNamespaceDeclarationSyntax>().SelectMany(n => n.Usings);
RemoveInKeywordCodeFixProvider.cs (1)
45var token = root.FindToken(diagnosticSpan.Start);
RemoveNewModifierCodeFixProvider.cs (1)
43var token = root.FindToken(diagnosticSpan.Start);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (9)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (2)
70var endToken = document.Root.FindToken(caretPosition); 103var endToken = root.FindToken(position);
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
131var token = parsedDocument.Root.FindToken(caret);
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandler.cs (1)
79var token = root.FindToken(position - 3);
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (1)
93var token = parsedDocument.Root.FindToken(position);
RawStringLiteral\RawStringLiteralCommandHandler_TypeChar.cs (3)
114var token = root.FindToken(start); 166var token = root.FindToken(start); 215var token = root.FindToken(start);
StringCopyPaste\StringCopyPasteHelpers.cs (1)
247var node = root.FindToken(position).Parent;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
EditAndContinue\BreakpointSpansTests.cs (1)
76var declarationNode = root.FindToken(position).Parent.FirstAncestorOrSelf<TDeclaration>();
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
57var token = tree.GetRoot().FindToken(expected.Start);
Formatting\Indentation\CSharpFormatterTestsBase.cs (1)
85var token = documentSyntax.Root.FindToken(position);
TypeInferrer\TypeInferrerTests.cs (1)
70var token = root.FindToken(textSpan.Start);
Microsoft.CodeAnalysis.CSharp.Features (44)
ArrowExpressionClausePlacementCodeFixProvider.cs (1)
58var arrowToken = root.FindToken(diagnostic.Location.SourceSpan.Start);
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
271var closeBraceToken = root.FindToken(closingBraceEndPoint - 1);
BraceCompletion\CurlyBraceCompletionService.cs (1)
71var startToken = document.Root.FindToken(startPoint, findInsideTrivia: true);
BraceCompletion\InterpolatedStringBraceCompletionService.cs (1)
76var token = document.Root.FindToken(start);
BraceMatching\StringLiteralBraceMatcher.cs (1)
31var token = root.FindToken(position);
ChangeSignature\CSharpChangeSignatureService.cs (1)
111var token = root.FindToken(position != tree.Length ? position : Math.Max(0, position - 1));
CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
53var token = root.FindToken(span.Start);
CodeRefactorings\CSharpRefactoringHelpersService.cs (1)
35var token = root.FindToken(position);
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
46var token = root.FindToken(textSpan.Start, findInsideTrivia: true); 48token = root.FindToken(textSpan.Start - 1, findInsideTrivia: true);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
61var node = root.FindToken(textSpan.Start).Parent;
Completion\CompletionProviders\Scripting\DirectiveCompletionProviderUtilities.cs (1)
16var token = tree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia: true);
Completion\CompletionProviders\SymbolCompletionProvider.cs (1)
154var token = root.FindToken(characterPosition);
ConditionalExpressionPlacementCodeFixProvider.cs (1)
58var questionToken = root.FindToken(diagnostic.Location.SourceSpan.Start);
ConsecutiveBracePlacementCodeFixProvider.cs (1)
72var token = root.FindToken(diagnostic.Location.SourceSpan.Start);
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (2)
63var token = root.FindToken(span.Start); 197var token = root.FindToken(span.Start);
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
42var token = root.FindToken(diagnosticSpan.Start);
CSharpAddYieldCodeFixProvider.cs (1)
217var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
50var token = root.FindToken(diagnostic.Location.SourceSpan.Start);
CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
55.Select(d => root.FindToken(d.Location.SourceSpan.Start))
CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
46var token = syntaxRoot.FindToken(context.Span.Start); 74var defaultToken = syntaxRoot.FindToken(span.Start);
Debugging\BreakpointResolver.cs (1)
42var token = tree.GetRoot(cancellationToken).FindToken(location.SourceSpan.Start);
Debugging\CSharpProximityExpressionsService.cs (1)
57var token = root.FindToken(position);
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
38_token = _syntaxTree.GetRoot(cancellationToken).FindToken(_position);
Debugging\DataTipInfoGetter.cs (1)
32var token = root.FindToken(position);
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
48return syntaxTree.GetRoot(cancellationToken).FindToken(position).GetAncestor<MemberDeclarationSyntax>();
EditAndContinue\BreakpointSpans.cs (1)
65var node = root.FindToken(position).Parent;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
372node = declarationBody.FindToken(position).Parent!;
ExtractInterface\CSharpExtractInterfaceService.cs (1)
38var token = root.FindToken(position != tree.Length ? position : Math.Max(0, position - 1));
ExtractMethod\CSharpMethodExtractor.cs (2)
43var basePosition = root.FindToken(originalSpanStart); 232methodName = newRoot.FindToken(methodName.SpanStart);
ExtractMethod\CSharpSelectionValidator.cs (1)
449var lastToken = root.FindToken(textSpan.End);
GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
47var node = semanticDocument.Root.FindToken(textSpan.Start).GetAncestor<TypeSyntax>();
HideBaseCodeFixProvider.cs (1)
40var token = root.FindToken(diagnosticSpan.Start);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
131var token = root.FindToken(span.Start);
ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
47var token = root.FindToken(span.Start);
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
115var nextToken = block.FindToken(openBrace.FullSpan.End);
RemoveInKeywordCodeFixProvider.cs (1)
45var token = root.FindToken(diagnosticSpan.Start);
RemoveNewModifierCodeFixProvider.cs (1)
43var token = root.FindToken(diagnosticSpan.Start);
SplitStringLiteral\StringSplitter.cs (1)
50var token = document.Root.FindToken(position);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
70var node = root.FindToken(position).Parent!;
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
98var token = root.FindToken(position);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\QueryTests.cs (2)
2272var queryContinuation = tree.GetRoot().FindToken(sourceCode.IndexOf("into w", StringComparison.Ordinal)).Parent; 2325var joinInto = tree.GetRoot().FindToken(sourceCode.IndexOf("into x8", StringComparison.Ordinal)).Parent;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\GetSemanticInfoTests.cs (1)
4910var equalsToken = tree.GetRoot().FindToken(position);
Compilation\SemanticModelAPITests.cs (1)
4059var x = tree.GetRoot().FindToken(match.Index + 4).Parent;
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
140var node = tree.GetRoot().FindToken(position).Parent.FirstAncestorOrSelf<TNode>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
691var token = node.FindToken(i);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
CSharpTestBase.cs (1)
1672var node = tree.GetRoot().FindToken(start).Parent;
SemanticModelTestBase.cs (1)
141var nameSyntaxToBind = tree.GetRoot().FindToken(position, findInsideTrivia: true).Parent as IdentifierNameSyntax;
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
CSharpCodeGenerationHelpers.cs (1)
203return contextTree?.GetRoot(cancellationToken).FindToken(contextLocation!.SourceSpan.Start).Parent;
CSharpSyntaxFacts.cs (2)
624.FindToken(position) 706var node = root.FindToken(position).Parent;
CSharpTypeInferenceService.TypeInferrer.cs (1)
2104var tokenInOriginalTree = originalSemanticModel.SyntaxTree.GetRoot(CancellationToken).FindToken(currentSemanticModel.OriginalPositionForSpeculation);
Formatting\CSharpSyntaxFormattingService.cs (2)
55var token = documentSyntax.Root.FindToken(Math.Max(0, caretPosition - 1), findInsideTrivia: true); 100var token = root.FindToken(Math.Max(0, caretPosition - 1), findInsideTrivia: true);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (1)
418var token = syntaxTree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia: true);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
144var namespaceUsings = root.FindToken(position).Parent!.GetAncestors<BaseNamespaceDeclarationSyntax>().SelectMany(n => n.Usings);
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
372token = originalSemanticMode.SyntaxTree.GetRoot(cancellationToken).FindToken(semanticModel.OriginalPositionForSpeculation);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CSharpSyntaxFactsServiceTests.cs (1)
19var token = tree.GetRoot().FindToken(position);
Microsoft.CodeAnalysis.EditorFeatures (2)
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (2)
101var token = root.FindToken(position, findInsideTrivia: true); 331token = syntaxTree.GetRoot(cancellationToken).FindToken(point, true);
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (2)
NavigationCommandHandlers\FindImplementingMembersCommandHandler.cs (1)
99var documentToken = nodeRoot.FindToken(caretPosition);
Snippets\CSharpSnippets\SnippetCommandHandler.cs (1)
112var token = syntaxTree.GetRoot(cancellationToken).FindToken(startPosition);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
Completion\AbstractArgumentProviderTests`1.cs (1)
79var token = root.FindToken(position);
Completion\AbstractCompletionProviderTests.cs (1)
98var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
EditAndContinue\EditAndContinueTestHelpers.cs (1)
358var result = root.FindToken(span.Start).Parent!;
QuickInfo\AbstractSemanticQuickInfoSourceTests.cs (1)
157var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
124var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
Structure\AbstractSyntaxNodeStructureProviderTests.cs (1)
25var token = root.FindToken(position, findInsideTrivia: true);
TypeInferrer\TypeInferrerTestBase.cs (1)
30var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (2)
921var token = semanticModel.SyntaxTree.GetRoot().FindToken(selection.Start); 933var token = SemanticModel.SyntaxTree.GetRoot().FindToken(destSpan.Start);
Completion\CompletionServiceTests.cs (1)
135var token = root.FindToken(result.Start);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Peek\PeekHelpers.cs (1)
51var node = root.FindToken(identifierLocation.SourceSpan.Start).Parent;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (15)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (1)
239Return doc.GetSyntaxRootAsync().Result.FindToken(position).Parent
Expansion\AbstractExpansionTest.vb (2)
35Dim node = GetExpressionSyntaxWithSameSpan(root.FindToken(span.Start).Parent, span.End) 40Dim node = GetExpressionSyntaxWithSameSpan(root.FindToken(span.Start).Parent, span.End)
Rename\RenameCommandHandlerTests.vb (1)
44Dim expectedTriggerToken = workspace.CurrentSolution.Projects.Single().Documents.Single().GetSyntaxRootAsync().Result.FindToken(view.Caret.Position.BufferPosition)
Rename\RenameEngineResult.vb (1)
223Dim newToken = newTree.GetRoot.FindToken(newLocation.Start, findInsideTrivia:=True)
Rename\RenameTestHelpers.vb (1)
41Dim token = solution.GetDocument(hostdoc.Id).GetSyntaxRootAsync().Result.FindToken(caretPosition)
Rename\RenameViewModelTests.vb (3)
566Dim token = document.GetSyntaxTreeAsync().Result.GetRoot().FindToken(cursorPosition) 576document, document.GetSyntaxTreeAsync().Result.GetRoot().FindToken(cursorPosition).Span, CancellationToken.None) 707document, document.GetSyntaxTreeAsync().Result.GetRoot().FindToken(cursorPosition).Span, CancellationToken.None)
Simplification\AbstractSimplificationTests.vb (5)
81Dim node = root.FindToken(span.Start).Parent 87Dim token = root.FindToken(span.Start) 93Dim node = root.FindToken(span.Start).Parent.Parent 99Dim node = root.FindToken(span.Start).Parent.Parent.Parent 105Dim node = GetExpressionSyntaxWithSameSpan(root.FindToken(span.Start).Parent, span.End)
Simplification\TypeNameSimplifierTest.vb (1)
4253Dim node = root.FindToken(span.Start).Parent.Parent
Microsoft.CodeAnalysis.Features (60)
AbstractConvertToAsyncCodeFixProvider.cs (1)
51var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
AbstractIteratorCodeFixProvider.cs (1)
47var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
AbstractMultipleBlankLinesCodeFixProvider.cs (1)
57var token = root.FindToken(diagnostic.AdditionalLocations[0].SourceSpan.Start);
AddImport\AbstractAddImportFeatureService.cs (1)
87var node = root.FindToken(span.Start, findInsideTrivia: true)
BraceCompletion\IBraceCompletionService.cs (1)
122=> Document.Root.FindToken(OpeningPoint, findInsideTrivia: true);
BraceMatching\AbstractBraceMatcher.cs (1)
65var token = root.FindToken(position);
BraceMatching\AbstractDirectiveTriviaBraceMatcher.cs (1)
33var token = root.FindToken(position, findInsideTrivia: true);
BraceMatching\AbstractEmbeddedLanguageBraceMatcher.cs (1)
35var token = root.FindToken(position);
CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
65var token = root.FindToken(span.Start);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (5)
111token = root.FindToken(line.Start); 128token = root.FindToken(line.End); 135token = root.FindToken(lines[indexOfLine].End, findInsideTrivia: true); 278var startToken = root.FindToken(lineAtPos.Start); 285var endToken = root.FindToken(lineAtPos.End);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
268suppressionTargetInfo.StartToken = root.FindToken(startToken.SpanStart); 269suppressionTargetInfo.EndToken = root.FindToken(endToken.SpanStart);
CodeLens\CodeLensReferencesService.cs (1)
120var token = (await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false)).FindToken(position, true);
CodeRefactoringHelpers.cs (3)
79var selectionStartToken = node.FindToken(selection.Start); 86var beginningNode = node.FindToken(node.Span.Start).Parent; 87var endNode = node.FindToken(node.Span.End - 1).Parent;
CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
170var tokenOnLocation = root.FindToken(location);
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
177var declaration = GetAsyncSupportingDeclaration(root.FindToken(tokenPosition));
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
253var token = root.FindToken(result.Start);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (2)
111var declaration = GetSyntax(newRoot.FindToken(destinationSpan.End)); 193var firstToken = insertionRoot.FindToken(position.Value);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (1)
148var token = root.FindToken(position);
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
259var token = root.FindToken(characterPosition);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
126var addImportContextNode = root.FindToken(completionItem.Span.Start, findInsideTrivia: true).Parent;
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
39var token = root.FindToken(context.Span.Start);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
248var token = root.FindToken(renamedToken.span.Start);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
56var token = syntaxTree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia: true);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (2)
96var token = root.FindToken(position); 319var token = root.FindToken(location.SourceSpan.Start, findInsideTrivia: true);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (4)
851var oldEnclosingLambdaBody = FindEnclosingLambdaBody(oldBody, oldMember.FindToken(adjustedOldStatementStart).Parent!); 1330newStatementSyntax = bodyMatch.NewRoot.FindToken(newStatementSyntaxSpan.Start).Parent; 1572var token = syntaxRoot.FindToken(unmappedActiveStatementSpan.Start); 5999=> root.FullSpan.Contains(position) ? root.FindToken(position).Parent : null;
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeEmbeddedLanguage.cs (1)
42var token = root.FindToken(position);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedLanguage.cs (1)
37var token = root.FindToken(position);
ExtractMethod\MethodExtractor.VariableSymbol.cs (1)
241var token = tree.GetRoot(cancellationToken).FindToken(span.Start);
ExtractMethod\SelectionValidator.cs (2)
107var token1 = root.FindToken(textSpan.Start); 167var token1 = root.FindToken(textSpan.Start);
FullyQualify\AbstractFullyQualifyService.cs (1)
69var node = root.FindToken(span.Start).GetAncestors<SyntaxNode>().First(n => n.Span.Contains(span));
Highlighting\Keywords\AbstractKeywordHighlighter.cs (2)
85var token = root.FindToken(position, findInsideTrivia); 92var previous = root.FindToken(position - 1, findInsideTrivia);
ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
33var token = root.FindToken(context.Span.Start);
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
45.Select(loc => root.FindToken(loc.Location.SourceSpan.Start).Parent as TIdentifierNameSyntax)
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
79var token = root.FindToken(position);
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
145var linkedToken = root.FindToken(token.SpanStart);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (2)
29var token = root.FindToken(span.Start, findInsideTrivia: true); 130var token = root.FindToken(position);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
254var nameToken = root.FindToken(location.SourceSpan.Start); 294var nameToken = root.FindToken(location.SourceSpan.Start);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
263var nameToken = root.FindToken(location.SourceSpan.Start, findInsideTrivia: true);
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
88var token = root.FindToken(location.SourceSpan.Start);
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (1)
48var token = root.FindToken(span.Start, findInsideTrivia: true);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
57var token = syntaxRoot.FindToken(span.Start);
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (2)
37var token = root.FindToken(textSpan.Start); 67var token = root.FindToken(tokenSpan.Start);
Wrapping\AbstractWrappingCodeRefactoringProvider.cs (1)
46var token = root.FindToken(position);
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\DiagnosticDescription.cs (2)
284if (!_syntaxPredicate(d._location.SourceTree.GetRoot().FindToken(_location.SourceSpan.Start, true).Parent)) 297if (!d._syntaxPredicate(_location.SourceTree.GetRoot().FindToken(_location.SourceSpan.Start, true).Parent))
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1397var token = model.SyntaxTree.GetRoot().FindToken(pos);
Microsoft.CodeAnalysis.VisualBasic (8)
Compilation\SemanticModel.vb (4)
616token = SyntaxTree.GetRoot().FindToken(position, True) 618token = Root.FindToken(position, True) 624token = SyntaxTree.GetRoot().FindToken(position) 626token = Root.FindToken(position)
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (2)
12Dim token = semanticModelOpt.SyntaxTree.GetRoot().FindToken(positionOpt) 153Dim token = semanticModelOpt.SyntaxTree.GetRoot().FindToken(positionOpt)
Symbols\Symbol.vb (1)
314Dim token = CType(location.SourceTree.GetRoot().FindToken(location.SourceSpan.Start), SyntaxToken)
Syntax\VisualBasicSyntaxNode_TreeTraversalHelpers.vb (1)
20Return MyBase.FindToken(position, findInsideTrivia)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
SyntaxTreeExtensions.vb (1)
359Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(line.Start)
VisualBasicSyntaxFacts.vb (2)
640FindToken(position). 718Dim node = root.FindToken(position).Parent
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
SyntaxTreeExtensions.vb (1)
107Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(position)
VisualBasicTypeInferenceService.TypeInferrer.vb (1)
788Dim tokenInOriginalTree = originalSemanticModel.SyntaxTree.GetRoot(CancellationToken).FindToken(currentSemanticModel.OriginalPositionForSpeculation)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (5)
AutomaticEndConstructCorrection\AutomaticEndConstructCorrector.vb (1)
148token = root.FindToken(textChange.OldPosition)
EndConstructGeneration\EndConstructCommandHandler.vb (1)
132Dim statement = root.FindToken(position.Value).GetAncestor(Of StatementSyntax)()
LineCommit\CommitFormatter.vb (1)
235Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(Math.Min(endPosition, syntaxTree.GetRoot(cancellationToken).FullSpan.End))
LineCommit\ContainingStatementInfo.vb (1)
98Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(point, findInsideTrivia:=True)
NavigationBar\VisualBasicEditorNavigationBarItemService.vb (1)
57Dim methodBlock = root.FindToken(navigationLocation.position).GetAncestor(Of MethodBlockBaseSyntax)()
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (2)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
45Dim node = tree.GetRoot().FindToken(expected.Key).Parent
TypeInferrer\TypeInferrerTests.vb (1)
49Dim token = root.FindToken(textSpan.Start)
Microsoft.CodeAnalysis.VisualBasic.Features (24)
BraceMatching\InterpolatedStringBraceMatcher.vb (1)
30Dim token = root.FindToken(position)
BraceMatching\StringLiteralBraceMatcher.vb (1)
26Dim token = root.FindToken(position)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
101Dim token = tree.GetRoot(cancellationToken).FindToken(If(position <> tree.Length, position, Math.Max(0, position - 1)))
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (1)
67Dim token = root.FindToken(context.Span.Start)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
47Dim token = root.FindToken(context.Span.Start)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
64Dim token = root.FindToken(span.Start)
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
47Dim token = root.FindToken(span.Start)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
49Dim token = root.FindToken(span.Start)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.vb (1)
42Dim token = root.FindToken(diagnosticSpan.Start)
CodeRefactorings\VisualBasicRefactoringHelpersService.vb (1)
26Dim token = root.FindToken(position)
Debugging\BreakpointResolver.vb (1)
32Dim token = tree.GetRoot(cancellationToken).FindToken(location.SourceSpan.Start)
Debugging\DataTipInfoGetter.vb (1)
17Dim token = root.FindToken(position)
Debugging\ProximityExpressionsGetter.vb (1)
63Dim token = root.FindToken(position)
Debugging\ProximityExpressionsGetter.Worker.vb (1)
27Dim token = _syntaxTree.GetRoot(cancellationToken).FindToken(_position)
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (1)
27Return syntaxTree.GetRoot(cancellationToken).FindToken(position).GetContainingMember()
EditAndContinue\BreakpointSpans.vb (1)
59Dim node = root.FindToken(position).Parent
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
578node = declarationBody.FindToken(position).Parent
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
32Dim token = root.FindToken(If(position <> tree.Length, position, Math.Max(0, position - 1)))
ExtractMethod\VisualBasicMethodExtractor.vb (1)
35Dim basePosition = root.FindToken(originalSpanStart)
ExtractMethod\VisualBasicSelectionValidator.vb (2)
296Dim forBlock = root.FindToken(startPosition).GetAncestor(Of ForOrForEachBlockSyntax)() 612Dim lastToken = root.FindToken(textSpan.End)
GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
38Dim token = semanticDocument.Root.FindToken(textSpan.Start)
ImplementInterface\VisualBasicImplementInterfaceCodeFixProvider.vb (1)
44Dim token = root.FindToken(span.Start)
Wrapping\SeparatedSyntaxList\VisualBasicArgumentWrapper.vb (1)
75Dim token = root.FindToken(position)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (33)
DocumentationComments\DocCommentTests.vb (1)
12089Dim token As SyntaxToken = tree.GetRoot().FindToken(position, True)
SymbolDisplay\SymbolDisplayTests.vb (2)
6000Dim tokenPosition = tree.GetRoot().FindToken(position).SpanStart 6004Dim token = newTree.GetRoot().FindToken(position)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (30)
109Dim declaratorQ = tree.GetRoot().FindToken(posQ).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 116Dim declaratorX = tree.GetRoot().FindToken(posX).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 123Dim declaratorZ = tree.GetRoot().FindToken(posZ).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 245Dim declaratorW = tree.GetRoot().FindToken(posW).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 250Dim declaratorZF = tree.GetRoot().FindToken(posZF).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 252tree.GetRoot().FindToken(select1).GetLocation, 255tree.GetRoot().FindToken(x2 - 2).GetLocation(), 256tree.GetRoot().FindToken(y4 - 2).GetLocation()) 260Dim declaratorZL = tree.GetRoot().FindToken(posZL).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 262tree.GetRoot().FindToken(select2).GetLocation, 265tree.GetRoot().FindToken(x5 - 2).GetLocation(), 266tree.GetRoot().FindToken(y5 - 2).GetLocation()) 316Dim declaratorT = tree.GetRoot().FindToken(posT).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 321Dim declaratorA = tree.GetRoot().FindToken(posA).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 323tree.GetRoot().FindToken(sub2).Parent.Parent.GetLocation, 326tree.GetRoot().FindToken(x1 - 2).GetLocation(), 327tree.GetRoot().FindToken(y1 - 2).GetLocation()) 331Dim declaratorB = tree.GetRoot().FindToken(posB).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 333tree.GetRoot().FindToken(sub4).Parent.Parent.GetLocation, 336tree.GetRoot().FindToken(x2 - 2).GetLocation(), 337tree.GetRoot().FindToken(y2 - 2).GetLocation()) 383Dim declaratorT = tree.GetRoot().FindToken(posT).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 388Dim declaratorA = tree.GetRoot().FindToken(posA).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 390tree.GetRoot().FindToken(sub1).Parent.Parent.GetLocation, 393tree.GetRoot().FindToken(x1 - 2).GetLocation(), 394tree.GetRoot().FindToken(y1 - 2).GetLocation()) 398Dim declaratorB = tree.GetRoot().FindToken(posB).Parent.FirstAncestorOrSelf(Of VariableDeclaratorSyntax)() 401tree.GetRoot().FindToken(sub2).Parent.Parent.GetLocation, 404tree.GetRoot().FindToken(x2 - 2).GetLocation(), 405tree.GetRoot().FindToken(y2 - 2).GetLocation())
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (15)
Parser\ParseDirectives.vb (2)
1262Dim tk = tree.GetRoot().FindToken(text.IndexOf("class c2", StringComparison.Ordinal)) 1265tk = tree.GetRoot().FindToken(text.IndexOf("class c1", StringComparison.Ordinal))
Parser\XmlDocComments.vb (2)
88Dim tk = node.GetRoot().FindToken(25) 105Dim tk = node.GetRoot().FindToken(25)
Syntax\ManualTests.vb (1)
227Dim token = tree.GetRoot().FindToken(text.Lines.Item(3).Start)
TestSyntaxNodes.vb (10)
1736Assert.Equal(0, tree.GetRoot().FindToken(node.FullSpan.Length - 1).TrailingTrivia.Count) 1737Assert.Equal(1, tree.GetRoot().FindToken(0).LeadingTrivia.Count) 1924Dim tk0 = prog.GetRoot().FindToken(25) 1954Dim tk0 = prog.GetRoot().FindToken(32) 1985Dim openParenToken = CType(tree.GetRoot().FindToken(location + "List".Length), SyntaxToken) 2001Dim trivia = prog.GetRoot().FindToken(28).TrailingTrivia 2019Dim tk0 As SyntaxNodeOrToken = prog.GetRoot().FindToken(31) 2044Dim tk0 As SyntaxNodeOrToken = prog.GetRoot().FindToken(35) 2075Dim tk0 As SyntaxNodeOrToken = prog.GetRoot().FindToken(35) 2336Dim token = node.FindToken(i)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (6)
CompilationTestUtils.vb (4)
417Dim token = tree.GetRoot().FindToken(bindPoint, True) 496Dim token As SyntaxToken = tree.GetRoot().FindToken(bindPoint) 648Dim node = tree.GetRoot().FindToken(position) 1126node = tree.GetRoot().FindToken(pos).Parent
SemanticModelTestBase.vb (2)
33Dim token As SyntaxToken = tree.GetRoot().FindToken(bindPoint) 74Dim token As SyntaxToken = tree.GetRoot().FindToken(bindPoint)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb\SyntaxTreeExtensions.vb (1)
359Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(line.Start)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb\SyntaxTreeExtensions.vb (1)
107Dim token = syntaxTree.GetRoot(cancellationToken).FindToken(position)
VisualBasicSyntaxFacts.vb (2)
640FindToken(position). 718Dim node = root.FindToken(position).Parent
VisualBasicTypeInferenceService.TypeInferrer.vb (1)
788Dim tokenInOriginalTree = originalSemanticModel.SyntaxTree.GetRoot(CancellationToken).FindToken(currentSemanticModel.OriginalPositionForSpeculation)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
VisualBasicSyntaxFactsServiceTests.vb (2)
528Dim token = tree.GetRoot().FindToken(position) 544Dim node = tree.GetRoot().FindToken(position).Parent
Microsoft.CodeAnalysis.Workspaces (25)
AbstractCodeGenerationService.cs (3)
528var previousToken = root.FindToken(attributeToRemove.FullSpan.Start - 1); 530var nextToken = root.FindToken(attributeToRemove.FullSpan.End + 1); 540var tokenToInsertTrivia = node.FindToken(position);
AbstractHeaderFacts.cs (1)
73var tokenToRightOrIn = root.FindToken(position);
AbstractIndentation.Indenter.cs (1)
125var token = Root.FindToken(LineToBeIndented.Start);
AbstractMoveDeclarationNearReferenceService.State.cs (1)
107let token = syntaxRoot.FindToken(r.Location.SourceSpan.Start)
AbstractSelectedMembers.cs (2)
66? root.FindToken(textSpan.Start) 167var token = root.FindToken(position);
BaseIndentationFormattingRule.cs (1)
152token1 = root.FindToken(span.Start);
BottomUpBaseIndentationFinder.cs (1)
167baseToken = baseToken.SyntaxTree.GetRoot(cancellationToken).FindToken(textLine.Start);
CodeCleanup\AbstractCodeCleanerService.cs (1)
367startToken = root.FindToken(span.Start, findInsideTrivia: true);
CommonFormattingHelpers.cs (5)
83var startToken = root.FindToken(textSpan.Start); 101root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End); 284nextToken = parentNode.FindToken(backwardPosition + 1); 310previousToken = parentNode.FindToken(forwardPosition + 1); 364var startToken = root.FindToken(span.Start).GetPreviousToken();
DocumentExtensions.cs (1)
119var token = root.FindToken(span.Start);
FindSymbols\FindReferences\FindReferenceCache.cs (1)
145var token = root.FindToken(index, findInsideTrivia: true);
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
77var token = root.FindToken(position, findInsideTrivia); 134var result = root.FindToken(position, findInsideTrivia: true);
LocationExtensions.cs (1)
20=> location.GetSourceTreeOrThrow().GetRoot(cancellationToken).FindToken(location.SourceSpan.Start);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
419var baseToken = baseRoot.FindToken(conflictAnnotation.OriginalSpan.Start, true);
Rename\RenameUtilities.cs (1)
47var bindableToken = semanticModel.SyntaxTree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia: true);
SyntaxNodeExtensions.cs (1)
622? root.FindToken(position, includeSkipped || includeDirectives || includeDocumentationComments)
SyntaxTokenExtensions.cs (1)
71var token = root.FindToken(position, findInsideTrivia);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
126var token = root.FindToken(sourceSpan.Start);
Microsoft.VisualStudio.LanguageServices (4)
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (1)
93var prevToken = root.FindToken(start).GetPreviousToken();
Venus\ContainedDocument.cs (3)
835var current = root.FindToken(visibleTextSpan.Start).Parent; 976var token = root.FindToken(end); 1000var token = root.FindToken(end, findInsideTrivia: true);
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (2)
3202var startToken = root.FindToken(span.Start).GetPreviousToken(); 3208var endToken = root.FindToken(span.End).GetNextToken();
Snippets\SnippetExpansionClient.cs (1)
106var contextLocation = root.FindToken(position).GetRequiredParent();
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CodeModel\CSharp\SyntaxNodeKeyTests.vb (1)
241Dim node = tree.GetRoot().FindToken(cursorPosition).Parent
GoToDefinition\GoToDefinitionApiTests.vb (1)
29Dim symbol = root.FindToken(cursorPosition).Parent _
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
CodeModel\VisualBasicCodeModelService.vb (2)
3732Dim startToken = GetTokenWithoutAnnotation(root.FindToken(span.Start).GetPreviousToken(), Function(t) t.GetPreviousToken()) 3733Dim endToken = GetTokenWithoutAnnotation(root.FindToken(span.End), Function(t) t.GetNextToken())
Help\VisualBasicHelpContextService.vb (1)
41Dim token = tree.GetRoot(cancellationToken).FindToken(span.Start, findInsideTrivia:=True)