233 references to GetLastToken
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
71var argName = operation.Syntax.GetLastToken().Text;
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (1)
121: root.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true)
Microsoft.CodeAnalysis (3)
Syntax\SyntaxNode.cs (1)
1075return GetLastToken(includeZeroWidth: true).TrailingTrivia;
Syntax\SyntaxNodeExtensions.cs (2)
395var last = node.GetLastToken(includeZeroWidth: true); 407var last = node.GetLastToken(includeZeroWidth: true);
Microsoft.CodeAnalysis.CodeStyle (16)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
71var endToken = block.GetLastToken();
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
157var lastToken = TryGetLastToken(previous.Value.node) ?? previous.Value.node.GetLastToken();
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
111parenthesizedExpression.GetLastToken().GetLocation());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
606: root.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true) 963var current = node.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
152var token = trivia.GetStructure()!.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
373lastVisibleToken = (lastVisibleToken.RawKind == 0) ? root.GetLastToken() : lastVisibleToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
113endToken: _rootNode.GetLastToken(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
45_lastToken = Root.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
283? (childNode.GetFirstToken(includeZeroWidth: true), childNode.GetLastToken(includeZeroWidth: true))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
473var lastToken = trivia1.GetStructure()!.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
175if (token == member.GetLastToken() &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
368var nextToken = node.GetLastToken().GetNextToken(); 371syntaxFacts.IsWordOrNumber(resultNode.GetLastToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
105root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End); 121endToken = (endToken.RawKind != 0) ? endToken : root.GetLastToken(includeZeroWidth: true);
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
142if (!sourceText.AreOnSameLine(condition.GetFirstToken(), condition.GetLastToken()) || 143!sourceText.AreOnSameLine(trueSyntax.GetFirstToken(), trueSyntax.GetLastToken()) || 144!sourceText.AreOnSameLine(falseSyntax.GetFirstToken(), falseSyntax.GetLastToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
32var lastToken = node.GetLastToken(includeZeroWidth: true, includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
288if (leftNode.GetLastToken().Span.End != location && leftNode.Span.End != location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (1)
165if (text.AreOnSameLine(lastParameter.GetLastToken(), thisParameter.GetFirstToken()))
Microsoft.CodeAnalysis.CSharp (11)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1073Debug.Assert(token == this.syntaxTree.GetRoot().GetLastToken());
FlowAnalysis\NullableWalker.cs (5)
1051_ => syntaxOpt ?? (SyntaxNodeOrToken)methodMainNode.Syntax.GetLastToken() 1124Diagnostics.Add(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(), member.Name, sense ? "true" : "false"); 1279location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(); 1365var location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(); 1388ReportDiagnostic(ErrorCode.WRN_ShouldNotReturn, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation());
Syntax\CSharpSyntaxNode.cs (1)
351return base.GetLastToken(includeZeroWidth, includeSkipped, includeDirectives, includeDocumentationComments);
Syntax\LookupPosition.cs (1)
503return IsBetweenTokens(position, firstIncluded, lambdaExpressionOrQueryNode.GetLastToken().GetNextToken());
Syntax\SyntaxFactory.cs (2)
2369var closingToken = lastNode.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true); 2374var token = lastNode.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
Syntax\SyntaxNormalizer.cs (1)
1250return IsLineBreak(node.GetLastToken());
Microsoft.CodeAnalysis.CSharp.CodeStyle (42)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (6)
162if (FormattingRangeHelper.AreTwoTokensOnSameLine(statement.GetFirstToken(), statement.GetLastToken())) 186if (!FormattingRangeHelper.AreTwoTokensOnSameLine(embeddedStatement.GetFirstToken(), embeddedStatement.GetLastToken())) 198if (statement.GetLastToken() != embeddedStatement.GetLastToken()) 215var firstTokenAfterEmbeddedStatement = embeddedStatement.GetLastToken().GetNextToken(); 216if (!FormattingRangeHelper.AreTwoTokensOnSameLine(firstTokenAfterEmbeddedStatement, statement.GetLastToken()))
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveStatementPlacement\CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
44=> block.GetLastToken().GetLocation();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
202var endsWithNewLine = trivia.GetStructure()!.GetLastToken(includeSkipped: true).Kind() == SyntaxKind.XmlTextLiteralNewLineToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
24var formatter = new CSharpStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.GetFirstToken(includeZeroWidth: true), root.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\AnchorIndentationFormattingRule.cs (1)
90=> AddAnchorIndentationOperation(list, node.GetFirstToken(includeZeroWidth: true), node.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (2)
127var firstTokenAfterTypeConstraint = currentToken.Parent.GetLastToken().GetNextToken(); 128var lastTokenForTypeConstraint = currentToken.Parent.GetLastToken().GetNextToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
70AddIndentBlockOperation(list, baseToken, node.GetFirstToken(), node.GetLastToken()); 211var lastToken = body.GetLastToken(includeZeroWidth: true); 281var lastToken = node.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
586var lastToken = node.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (6)
83AddSuppressWrappingIfOnSingleLineOperation(list, node.GetFirstToken(), node.GetLastToken()); 91AddSuppressWrappingIfOnSingleLineOperation(list, node.GetFirstToken(), node.GetLastToken()); 161var endToken = node.GetLastToken(includeZeroWidth: true); 216node.GetLastToken(includeZeroWidth: true), 402AddSuppressWrappingIfOnSingleLineOperation(list, parent.GetFirstToken(includeZeroWidth: true), parent.GetLastToken(includeZeroWidth: true)); 408var lastToken = item.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
564simpleName.GetLastToken().GetNextToken().Kind() == SyntaxKind.LessThanToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (19)
107return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 131return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken()); 145return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken()); 153return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 158return ValueTuple.Create(GetAppropriatePreviousToken(container.GetFirstToken()), container.GetLastToken()); 161return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken()); 180return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 190return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 193return ValueTuple.Create(containerOfList.GetFirstToken(), containerOfList.GetLastToken()); 198return ValueTuple.Create(parent.GetFirstToken(), parent.GetLastToken()); 206return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 216var lastTokenOfInnerBlock = parent.GetLastToken(); 226return ValueTuple.Create(parentOfParent.GetFirstToken(), parentOfParent.GetLastToken()); 234return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 241return ValueTuple.Create(GetAppropriatePreviousToken(containerOfBlock.GetFirstToken()), containerOfBlock.GetLastToken()); 251var lastTokenOfInnerBlock = parent.GetLastToken(); 261return ValueTuple.Create(GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken()); 277return (GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken()); 280return (GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (2)
88ifStatement.GetLastToken(), 89ifStatement.GetLastToken().WithPrependedLeadingTrivia(trivia));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
763if (!document.Text.AreOnSameLine(component.GetFirstToken(), component.GetLastToken()))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
98=> sourceText.AreOnSameLine(node.GetFirstToken(), node.GetLastToken());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1548while (node is ExpressionSyntax && node.GetLastToken(includeZeroWidth: true) == leftToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
57var lastToken = node.GetLastToken(includeZeroWidth: true, includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
204node.GetLastToken(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true),
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
252lastToken = owningNode.GetLastToken(includeZeroWidth: true);
Microsoft.CodeAnalysis.CSharp.Features (28)
ChangeSignature\ChangeSignatureFormattingRule.cs (1)
44var endToken = node.GetLastToken();
ChangeSignature\CSharpChangeSignatureService.cs (1)
220var start = lastAttributes?.GetLastToken().GetNextToken().SpanStart ??
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
229var nextToken = firstToken.Parent.GetLastToken(includeDirectives: true).GetNextToken(includeDirectives: true); 232firstToken = nextToken.Parent.GetLastToken(includeDirectives: true).GetNextToken(includeDirectives: true);
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (2)
248if (!token.IsKind(SyntaxKind.CommaToken) && token != typeSyntax.GetLastToken()) 296if (typeSyntax == null || token != typeSyntax.GetLastToken())
EditAndContinue\BreakpointSpans.cs (2)
113=> CreateSpan(node.GetFirstToken(), node.GetLastToken()); 160return nodeOrToken.AsNode()!.GetLastToken().Span.End;
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
76TriviaLocation.AfterEndOfSpan => callsite.GetLastToken(includeZeroWidth: true).GetNextToken(includeZeroWidth: true),
ExtractMethod\CSharpSelectionResult.cs (1)
97current.GetLastToken().Span.End <= lastToken.Span.End;
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
50? foundBrokenLoop.GetLastToken().Span.End
LineSeparators\CSharpLineSeparatorService.cs (1)
351return node.GetLastToken().Span;
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (6)
162if (FormattingRangeHelper.AreTwoTokensOnSameLine(statement.GetFirstToken(), statement.GetLastToken())) 186if (!FormattingRangeHelper.AreTwoTokensOnSameLine(embeddedStatement.GetFirstToken(), embeddedStatement.GetLastToken())) 198if (statement.GetLastToken() != embeddedStatement.GetLastToken()) 215var firstTokenAfterEmbeddedStatement = embeddedStatement.GetLastToken().GetNextToken(); 216if (!FormattingRangeHelper.AreTwoTokensOnSameLine(firstTokenAfterEmbeddedStatement, statement.GetLastToken()))
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveStatementPlacement\CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
44=> block.GetLastToken().GetLocation();
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (2)
88ifStatement.GetLastToken(), 89ifStatement.GetLastToken().WithPrependedLeadingTrivia(trivia));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
763if (!document.Text.AreOnSameLine(component.GetFirstToken(), component.GetLastToken()))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
98=> sourceText.AreOnSameLine(node.GetFirstToken(), node.GetLastToken());
Structure\CSharpStructureHelpers.cs (4)
86var lastToken = node.GetLastToken(includeZeroWidth: true); 292_ => node.GetLastToken() 337node, syntaxToken, node.GetLastToken(), compressEmptyLines, 448var (end, hintEnd) = GetCollapsibleEnd(syntaxList.Last().GetLastToken(), compressEmptyLines);
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (1)
64? attributes.Last().GetLastToken().GetNextToken()
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Parsing\SyntaxExtensions.cs (1)
24return node.GetLastToken(includeSkipped: true).TrailingTrivia;
Syntax\SyntaxNodeTests.cs (1)
1190var token = syntaxTree.GetRoot().GetLastToken(includeZeroWidth: false); // skip EOF
Microsoft.CodeAnalysis.CSharp.Workspaces (38)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
202var endsWithNewLine = trivia.GetStructure()!.GetLastToken(includeSkipped: true).Kind() == SyntaxKind.XmlTextLiteralNewLineToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
24var formatter = new CSharpStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.GetFirstToken(includeZeroWidth: true), root.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\AnchorIndentationFormattingRule.cs (1)
90=> AddAnchorIndentationOperation(list, node.GetFirstToken(includeZeroWidth: true), node.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (2)
127var firstTokenAfterTypeConstraint = currentToken.Parent.GetLastToken().GetNextToken(); 128var lastTokenForTypeConstraint = currentToken.Parent.GetLastToken().GetNextToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
70AddIndentBlockOperation(list, baseToken, node.GetFirstToken(), node.GetLastToken()); 211var lastToken = body.GetLastToken(includeZeroWidth: true); 281var lastToken = node.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
586var lastToken = node.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (6)
83AddSuppressWrappingIfOnSingleLineOperation(list, node.GetFirstToken(), node.GetLastToken()); 91AddSuppressWrappingIfOnSingleLineOperation(list, node.GetFirstToken(), node.GetLastToken()); 161var endToken = node.GetLastToken(includeZeroWidth: true); 216node.GetLastToken(includeZeroWidth: true), 402AddSuppressWrappingIfOnSingleLineOperation(list, parent.GetFirstToken(includeZeroWidth: true), parent.GetLastToken(includeZeroWidth: true)); 408var lastToken = item.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
564simpleName.GetLastToken().GetNextToken().Kind() == SyntaxKind.LessThanToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (19)
107return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 131return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken()); 145return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken()); 153return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 158return ValueTuple.Create(GetAppropriatePreviousToken(container.GetFirstToken()), container.GetLastToken()); 161return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken()); 180return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 190return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 193return ValueTuple.Create(containerOfList.GetFirstToken(), containerOfList.GetLastToken()); 198return ValueTuple.Create(parent.GetFirstToken(), parent.GetLastToken()); 206return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 216var lastTokenOfInnerBlock = parent.GetLastToken(); 226return ValueTuple.Create(parentOfParent.GetFirstToken(), parentOfParent.GetLastToken()); 234return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken()); 241return ValueTuple.Create(GetAppropriatePreviousToken(containerOfBlock.GetFirstToken()), containerOfBlock.GetLastToken()); 251var lastTokenOfInnerBlock = parent.GetLastToken(); 261return ValueTuple.Create(GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken()); 277return (GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken()); 280return (GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1548while (node is ExpressionSyntax && node.GetLastToken(includeZeroWidth: true) == leftToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
57var lastToken = node.GetLastToken(includeZeroWidth: true, includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
204node.GetLastToken(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true),
Microsoft.CodeAnalysis.Features (18)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
122if (containingStatement is not null && containingStatement.GetLastToken() != token) 124indexOfLine = lines.IndexOf(containingStatement.GetLastToken().SpanStart);
GenerateEqualsAndGetHashCodeFromMembers\FormatLargeBinaryExpressionRule.cs (1)
54node.GetLastToken(),
SignatureHelp\CommonSignatureHelpUtilities.cs (2)
93var lastToken = argumentList.GetLastToken(); 97nextToken = argumentList.AncestorsAndSelf().Last().GetLastToken(includeZeroWidth: true);
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
71var endToken = block.GetLastToken();
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
157var lastToken = TryGetLastToken(previous.Value.node) ?? previous.Value.node.GetLastToken();
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
111parenthesizedExpression.GetLastToken().GetLocation());
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
142if (!sourceText.AreOnSameLine(condition.GetFirstToken(), condition.GetLastToken()) || 143!sourceText.AreOnSameLine(trueSyntax.GetFirstToken(), trueSyntax.GetLastToken()) || 144!sourceText.AreOnSameLine(falseSyntax.GetFirstToken(), falseSyntax.GetLastToken()))
Wrapping\AbstractWrapper.cs (1)
53var lastToken = item.IsToken ? item.AsToken() : item.AsNode()!.GetLastToken();
Wrapping\Edit.cs (1)
68var leftLastToken = left.IsToken ? left.AsToken() : left.AsNode()!.GetLastToken();
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (5)
221result.Add(Edit.DeleteBetween(last, _listSyntax.GetLastToken())); 351_listSyntax.GetLastToken())); 355result.Add(Edit.DeleteBetween(itemsAndSeparators.Last(), _listSyntax.GetLastToken())); 461_listSyntax.GetLastToken())); 466result.Add(Edit.DeleteBetween(itemsAndSeparators.Last(), _listSyntax.GetLastToken()));
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1665ReportDiagnosticsCore(addDiagnostic, tree.GetRoot().GetLastToken().GetLocation(), tree.FilePath);
Microsoft.CodeAnalysis.VisualBasic (7)
Syntax\SyntaxFacts.vb (1)
308Dim followingToken As SyntaxToken = possibleBlock.GetLastToken(includeZeroWidth:=True).GetNextToken()
Syntax\SyntaxNormalizer.vb (5)
304(token.Parent IsNot Nothing AndAlso token.Parent.GetLastToken() = token) 629If trivia.GetStructure.GetLastToken.HasTrailingTrivia AndAlso 630trivia.GetStructure.GetLastToken.TrailingTrivia.Last.Kind = SyntaxKind.EndOfLineTrivia Then 692_lineBreaksAfterToken(listElement.GetLastToken()) = 1 694AddLinebreaksAfterTokenIfNeeded(listElement.GetLastToken(), If(elementIndex = lastElementIndex,
Syntax\VisualBasicSyntaxNode.vb (1)
327Return CType(MyBase.GetLastToken(includeZeroWidth, includeSkipped, includeDirectives, includeDocumentationComments), SyntaxToken)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (6)
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (1)
61Dim lastToken = node.GetLastToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (2)
63Return current.GetLastToken(includeZeroWidth:=True) = token 66Return current.GetLastToken(includeZeroWidth:=True) = token
src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (1)
29_lastToken = node.GetLastToken(includeZeroWidth:=True)
src\Workspaces\VisualBasic\Portable\Formatting\Engine\VisualBasicStructuredTriviaFormatEngine.vb (1)
21Dim formatter = New VisualBasicStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.GetFirstToken(includeZeroWidth:=True), root.GetLastToken(includeZeroWidth:=True))
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (1)
22AddAnchorIndentationOperation(operations, baseToken, node.GetLastToken(includeZeroWidth:=True))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (1)
703If Not (targetToken.FollowsEndOfStatement(position) AndAlso targetToken = ancestor.GetLastToken()) Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
63Dim endToken = node.GetLastToken() 98Dim closeBrace = parameterOrArgumentList.GetLastToken(includeZeroWidth:=True)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
LineCommit\ContainingStatementInfo.vb (1)
22IsIncomplete = node.GetLastToken(includeZeroWidth:=True).IsMissing
Microsoft.CodeAnalysis.VisualBasic.Features (9)
ChangeSignature\ChangeSignatureFormattingRule.vb (1)
25Dim lastToken As SyntaxToken = node.GetLastToken()
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (1)
216Dim nextNode = endStatement.Parent.GetLastToken().GetNextToken().Parent
ExtractMethod\VisualBasicMethodExtractor.TriviaResult.vb (1)
63Return callsite.GetLastToken(includeZeroWidth:=True).GetNextToken(includeZeroWidth:=True)
ExtractMethod\VisualBasicSelectionResult.vb (1)
88current.GetLastToken().Span.End <= lastToken.Span.End
ExtractMethod\VisualBasicSelectionValidator.vb (1)
519commonRoot.GetLastToken(includeZeroWidth:=True) = lastTokenInSelection
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (1)
52Return exitTarget.GetLastToken().Span.End
SignatureHelp\AbstractIntrinsicOperatorSignatureHelpProvider.vb (1)
88Dim nextToken = node.GetLastToken().GetNextToken()
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (1)
61Dim lastToken = node.GetLastToken()
Structure\VisualBasicStructureHelpers.vb (1)
164Return node.GetLastToken()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (9)
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (1)
364Dim lastToken = node.GetLastToken(includeZeroWidth:=True)
Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (1)
29_lastToken = node.GetLastToken(includeZeroWidth:=True)
Formatting\Engine\VisualBasicStructuredTriviaFormatEngine.vb (1)
21Dim formatter = New VisualBasicStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.GetFirstToken(includeZeroWidth:=True), root.GetLastToken(includeZeroWidth:=True))
Formatting\Rules\NodeBasedFormattingRule.vb (1)
22AddAnchorIndentationOperation(operations, baseToken, node.GetLastToken(includeZeroWidth:=True))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (2)
63Return current.GetLastToken(includeZeroWidth:=True) = token 66Return current.GetLastToken(includeZeroWidth:=True) = token
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (1)
703If Not (targetToken.FollowsEndOfStatement(position) AndAlso targetToken = ancestor.GetLastToken()) Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
63Dim endToken = node.GetLastToken() 98Dim closeBrace = parameterOrArgumentList.GetLastToken(includeZeroWidth:=True)
Microsoft.CodeAnalysis.Workspaces (19)
CodeCleanup\AbstractCodeCleanerService.cs (3)
294nextToken = (nextToken.RawKind == 0) ? root.GetLastToken(includeZeroWidth: true) : nextToken; 342nextToken = (nextToken.RawKind == 0) ? root.GetLastToken(includeZeroWidth: true) : nextToken; 409return root.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
606: root.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true) 963var current = node.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
152var token = trivia.GetStructure()!.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
373lastVisibleToken = (lastVisibleToken.RawKind == 0) ? root.GetLastToken() : lastVisibleToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
113endToken: _rootNode.GetLastToken(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
45_lastToken = Root.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
283? (childNode.GetFirstToken(includeZeroWidth: true), childNode.GetLastToken(includeZeroWidth: true))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
473var lastToken = trivia1.GetStructure()!.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
175if (token == member.GetLastToken() &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
368var nextToken = node.GetLastToken().GetNextToken(); 371syntaxFacts.IsWordOrNumber(resultNode.GetLastToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (2)
105root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End); 121endToken = (endToken.RawKind != 0) ? endToken : root.GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
32var lastToken = node.GetLastToken(includeZeroWidth: true, includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
288if (leftNode.GetLastToken().Span.End != location && leftNode.Span.End != location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (1)
165if (text.AreOnSameLine(lastParameter.GetLastToken(), thisParameter.GetFirstToken()))
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
CodeCleanup\CodeCleanupTests.cs (1)
351var nextToken = member.GetLastToken().GetNextToken().GetNextToken();
CodeCleanup\Extensions.cs (1)
21var endToken = node.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true).GetNextToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
UtilityTest\FormattingRangeHelperTests.cs (2)
21var token2 = root.GetLastToken(); 31var token2 = root.GetLastToken();