115 references to Last
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
94var endOfAttributeLists = attributeList.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
455var endOfAttributeLists = attributeList.Last().Span.End;
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
271return block.Statements.Last(); 274return switchSection.Statements.Last();
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
294lastStatement: block.Statements.Last()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
498var lastAttributeToken = attributes.Last().GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
110var lastSection = switchStatement.Sections.Last() == node; 115var lastTokenOfLabel = section.Labels.Last().GetLastToken(includeZeroWidth: true); 125var endToken = section.Statements.Last().GetLastToken(includeZeroWidth: true);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (2)
177var newLastStatement = statements.Last() 179statements = statements.Replace(statements.Last(), newLastStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
56var end = usings.Last().Span.End; 65var end = rootUsings.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
47start = members.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
181var endToken = section.Statements.Last().GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (4)
163var nextToken = compilationUnit.Usings.Last().GetLastToken().GetNextTokenOrEndOfFile(); 176var nextToken = compilationUnit.Usings.Last().GetLastToken().GetNextTokenOrEndOfFile(); 215var nextToken = namespaceDeclaration.Usings.Last().GetLastToken().GetNextTokenOrEndOfFile(); 228var nextToken = namespaceDeclaration.Usings.Last().GetLastToken().GetNextToken();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
261var df = model.AnalyzeDataFlow(body.Statements.First(), body.Statements.Last());
Microsoft.CodeAnalysis.CSharp.Features (16)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
283var last = members.Last();
Completion\CompletionProviders\CompletionUtilities.cs (1)
184var lastStatement = methodDeclaration.Body.Statements.Last();
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
76var lastContent = stringExpression.Contents.Last();
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1810return ((SwitchSectionSyntax)node).Labels.Last().Span; 2699: tryStatement.Catches.Last().Span.End);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
549if (statements.Last() == lastStatement)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
69var lastStatement = block.Statements.Last();
LineSeparators\CSharpLineSeparatorService.cs (2)
250AddLineSeparatorSpanForNode(usings.Last(), spans, cancellationToken); 295var lastChild = children.Last();
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
271return block.Statements.Last(); 274return switchSection.Statements.Last();
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
294lastStatement: block.Statements.Last()))
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (2)
177var newLastStatement = statements.Last() 179statements = statements.Replace(statements.Last(), newLastStatement);
Structure\Providers\SwitchStatementStructureProvider.cs (2)
32var start = section.Labels.Last().ColonToken.Span.End; 33var end = section.Statements.Last().Span.End;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\UsedAssembliesTests.cs (1)
146var afterUsings = source.Substring(unit.Usings.Last().FullSpan.End);
Microsoft.CodeAnalysis.CSharp.Workspaces (14)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1807method.ParameterList.GetTrailingTrivia().Add(SyntaxFactory.ElasticMarker).AddRange(method.ConstraintClauses.Last().GetTrailingTrivia())));
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
88=> TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
498var lastAttributeToken = attributes.Last().GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
110var lastSection = switchStatement.Sections.Last() == node; 115var lastTokenOfLabel = section.Labels.Last().GetLastToken(includeZeroWidth: true); 125var endToken = section.Statements.Last().GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (2)
56var end = usings.Last().Span.End; 65var end = rootUsings.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
47start = members.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
181var endToken = section.Statements.Last().GetLastToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (4)
163var nextToken = compilationUnit.Usings.Last().GetLastToken().GetNextTokenOrEndOfFile(); 176var nextToken = compilationUnit.Usings.Last().GetLastToken().GetNextTokenOrEndOfFile(); 215var nextToken = namespaceDeclaration.Usings.Last().GetLastToken().GetNextTokenOrEndOfFile(); 228var nextToken = namespaceDeclaration.Usings.Last().GetLastToken().GetNextToken();
Microsoft.CodeAnalysis.Features (2)
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
250consumedLastSurroundingStatement = lastUsageStatement == surroundingStatements.Last();
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
408builder.Add(new StatementRange(nextStatement, GetStatements(node).Last()));
Microsoft.CodeAnalysis.VisualBasic (2)
Syntax\SyntaxNormalizer.vb (2)
714_lastStatementsInBlocks.Add(list.Last) 866previousNode = node.Statements.Last()
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
586Return queryExpression.Clauses.Last() Is selectClause 591Return aggregateClause.AdditionalQueryOperators().Last() Is selectClause
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
127Dim nextToken = compilationUnit.Imports.Last().GetLastToken().GetNextTokenOrEndOfFile()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
893Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (2)
407[ifBlock].Statements.Last().GetLastToken(includeZeroWidth:=True)) 434[try].Statements.Last().GetLastToken(includeZeroWidth:=True))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (9)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (1)
90Dim lastImport = rootWithNewImports.Imports.Last()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (2)
926Return GetQueryClauseTerminatingToken(queryExpression.Clauses.Last()) 995Return GetQueryClauseTerminatingToken(aggregateClause.AdditionalQueryOperators.Last())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (5)
38indices.Add(Not destination.OverlapsHiddenPosition(destination.Members.Last, destination.EndBlockStatement, cancellationToken)) 50If Not allElements.Last().GetTrailingTrivia().Any(Function(t) t.Kind = SyntaxKind.EndOfLineTrivia OrElse t.Kind = SyntaxKind.ColonTrivia) Then 52allElements.Last().WithAppendedTrailingTrivia(SyntaxFactory.ElasticCarriageReturnLineFeed)) 53ElseIf allElements.Last().GetTrailingTrivia().Any(Function(t) t.Kind = SyntaxKind.ColonTrivia) Then 55allElements.Take(allElements.Count - 1).Concat(ReplaceTrailingColonToEndOfLineTrivia(allElements.Last())))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
LineCommit\ContainingStatementInfo.vb (1)
186Return New ContainingStatementInfo(node, TextSpan.FromBounds(attributes.Last.Span.End, node.Span.End))
Utilities\NavigationPointHelpers.vb (1)
36Return eventBlock.EventStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart
Microsoft.CodeAnalysis.VisualBasic.Features (10)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (3)
105destinationLine = root.Options.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1 143destinationLine = root.Imports.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1 145destinationLine = root.Options.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
133Dim trailingTrivia = compilationRoot.Attributes.Last().GetTrailingTrivia()
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (1)
155Dim lastXmlText = TryCast(documentationComment.Content.Last(), XmlTextSyntax)
EditAndContinue\DeclarationBody\MethodBody.vb (1)
27Return model.AnalyzeDataFlow(methodBlock.Statements.First, methodBlock.Statements.Last).CapturedInside
LineSeparators\VisualBasicLineSeparatorService.vb (2)
130Dim lastChild = children.Last() 147spans.Add(GetLineSeparatorSpanForNode(importsList.Last()))
SplitOrMergeIfStatements\VisualBasicMergeConsecutiveIfStatementsCodeRefactoringProvider.vb (1)
40If ifBlock.Statements.Count > 0 AndAlso span.IsAround(ifBlock, ifBlock.Statements.Last()) Then
Structure\Providers\CompilationUnitStructureProvider.vb (1)
25Dim endPos = compilationUnit.Imports.Last().Span.End
Microsoft.CodeAnalysis.VisualBasic.Workspaces (16)
Formatting\Rules\NodeBasedFormattingRule.vb (2)
407[ifBlock].Statements.Last().GetLastToken(includeZeroWidth:=True)) 434[try].Statements.Last().GetLastToken(includeZeroWidth:=True))
OrganizeImports\VisualBasicOrganizeImportsService.Rewriter.vb (1)
75Return TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.[End])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
586Return queryExpression.Clauses.Last() Is selectClause 591Return aggregateClause.AdditionalQueryOperators().Last() Is selectClause
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
127Dim nextToken = compilationUnit.Imports.Last().GetLastToken().GetNextTokenOrEndOfFile()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
893Return TextSpan.FromBounds(list.First.SpanStart, list.Last.Span.End)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
86TextSpan.FromBounds(destination.Members.Last.Span.End, destination.EndOfFileToken.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (1)
90Dim lastImport = rootWithNewImports.Imports.Last()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (2)
926Return GetQueryClauseTerminatingToken(queryExpression.Clauses.Last()) 995Return GetQueryClauseTerminatingToken(aggregateClause.AdditionalQueryOperators.Last())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (5)
38indices.Add(Not destination.OverlapsHiddenPosition(destination.Members.Last, destination.EndBlockStatement, cancellationToken)) 50If Not allElements.Last().GetTrailingTrivia().Any(Function(t) t.Kind = SyntaxKind.EndOfLineTrivia OrElse t.Kind = SyntaxKind.ColonTrivia) Then 52allElements.Last().WithAppendedTrailingTrivia(SyntaxFactory.ElasticCarriageReturnLineFeed)) 53ElseIf allElements.Last().GetTrailingTrivia().Any(Function(t) t.Kind = SyntaxKind.ColonTrivia) Then 55allElements.Take(allElements.Count - 1).Concat(ReplaceTrailingColonToEndOfLineTrivia(allElements.Last())))
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
94var endOfAttributeLists = attributeList.Last().Span.End;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
455var endOfAttributeLists = attributeList.Last().Span.End;
Microsoft.VisualStudio.LanguageServices.CSharp (8)
CodeModel\CSharpCodeModelService.NodeLocator.cs (7)
900endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 941endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 1015endPosition = node.AttributeLists.Last().Span.End; 1114endPosition = node.AttributeLists.Last().Span.End; 1237endPosition = node.AttributeLists.Last().GetLastToken().Span.End; 1279endPosition = field.AttributeLists.Last().GetLastToken().Span.End; 1320endPosition = node.AttributeLists.Last().GetLastToken().Span.End;
CodeModel\SyntaxNodeExtensions.cs (1)
65return attributeLists.Last().GetLastToken().GetNextToken();
Microsoft.VisualStudio.LanguageServices.VisualBasic (7)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (7)
265startPosition = attributes.Last().GreaterThanToken.Span.End 281Return New VirtualTreePoint(attributes.Last().SyntaxTree, text, startPosition) 535startPosition = declareStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 600startPosition = methodStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 717startPosition = propertyStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 845startPosition = eventStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart 926startPosition = delegateStatement.AttributeLists.Last().GetLastToken().GetNextToken().SpanStart