105 references to First
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
191parentExpression is InterpolatedStringExpressionSyntax { Contents: var contents } && contents.First() == token.GetRequiredParent();
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
182(parentExpression is InterpolatedStringExpressionSyntax { Contents: var contents } && contents.First() == token.GetRequiredParent());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
124var startToken = section.Statements.First().GetFirstToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
225var anchorToken = parameterNode.AttributeLists.First().OpenBracketToken;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
64? ((BlockSyntax)newParentScope).Statements.First() 65: ((SwitchSectionSyntax)newParentScope).Statements.First();
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (6)
155var newFirstStatement = statements.First() 157statements = statements.Replace(statements.First(), newFirstStatement); 162var newFirstStatement = statements.First() 164statements = statements.Replace(statements.First(), newFirstStatement); 169var newFirstStatement = statements.First() 171statements = statements.Replace(statements.First(), newFirstStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
55var start = usings.First().SpanStart; 64var start = rootUsings.First().SpanStart; 72? root.Members.First().GetFirstToken().Span.End
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
36var end = destination.Members.First().SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180var startToken = section.Statements.First().GetFirstToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
239var firstToken = resultNamespace.Members.First().GetFirstToken();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
261var df = model.AnalyzeDataFlow(body.Statements.First(), body.Statements.Last());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\OutVarTests.cs (1)
1291methodDeclParent.Body.Statements.First() != containingReturnOrThrow))
Microsoft.CodeAnalysis.CSharp.Features (17)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
279var first = members.First();
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
75var firstContent = stringExpression.Contents.First();
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
2696tryStatement.Catches.First().SpanStart,
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
65var firstStatement = block.Statements.First();
GenerateConstructorFromMembers\CSharpGenerateConstructorFromMembersCodeRefactoringProvider.cs (1)
95return GetAccessedMemberName(block.Statements.First());
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
330token != node.RankSpecifiers.First().CloseBracketToken; 353openBrace = arrayTypeSyntax.RankSpecifiers.First().OpenBracketToken;
Snippets\CSharpIntMainSnippetProvider.cs (2)
42var returnStatement = body.Statements.First(); 55var returnStatement = body.Statements.First();
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
64? ((BlockSyntax)newParentScope).Statements.First() 65: ((SwitchSectionSyntax)newParentScope).Statements.First();
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (6)
155var newFirstStatement = statements.First() 157statements = statements.Replace(statements.First(), newFirstStatement); 162var newFirstStatement = statements.First() 164statements = statements.Replace(statements.First(), newFirstStatement); 169var newFirstStatement = statements.First() 171statements = statements.Replace(statements.First(), newFirstStatement);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\ConditionalOperatorTests.cs (3)
1289var classC = (TypeDeclarationSyntax)compUnit.Members.First(); 1290var methodTest = (MethodDeclarationSyntax)classC.Members.First(); 1291var stmt = (ExpressionStatementSyntax)methodTest.Body!.Statements.First();
Semantics\ScriptSemanticsTests.cs (1)
1390var node2 = (GlobalStatementSyntax)node1.Members.First();
Semantics\TargetTypedConditionalOperatorTests.cs (3)
337var classC = (TypeDeclarationSyntax)compUnit.Members.First(); 338var methodTest = (MethodDeclarationSyntax)classC.Members.First(); 339var stmt = (LocalDeclarationStatementSyntax)methodTest.Body!.Statements.First();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (9)
Compilation\SemanticModelAPITests.cs (1)
3557return SyntaxFactory.ParseCompilationUnit(source + " class X {}").Members.First().AsTypeDeclarationSyntax().AttributeLists.First().Attributes.First();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
4106return SyntaxFactory.ParseCompilationUnit(source + " class X {}").Members.First().AsTypeDeclarationSyntax().AttributeLists.First().Attributes.First(); 4369var attr8 = SyntaxFactory.ParseCompilationUnit(@"[assembly: O(""hello"")]").AttributeLists.First().Attributes.First();
Compilation\UsedAssembliesTests.cs (1)
145var beforeUsings = source.Substring(0, unit.Usings.First().FullSpan.Start);
Symbols\Source\FileModifierTests.cs (4)
3645var info = model.GetSymbolInfo(((ExpressionStatementSyntax)body.Statements.First()).Expression); 3715var info = model.GetSymbolInfo(((ExpressionStatementSyntax)body.Statements.First()).Expression); 3779var info = speculativeModel!.GetSymbolInfo(((ExpressionStatementSyntax)newBody.Statements.First()).Expression); 3820var info = speculativeModel!.GetSymbolInfo(((ExpressionStatementSyntax)newBody.Statements.First()).Expression);
Symbols\Source\UsingAliasTests.cs (1)
523UsingDirectiveSyntax usingAlias = syntaxTree.GetCompilationUnitRoot().Usings.First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
IncrementalParsing\IncrementalParsingTests.cs (1)
3040tree.GetCompilationUnitRoot().Members.First().Green;
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
88=> TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
182(parentExpression is InterpolatedStringExpressionSyntax { Contents: var contents } && contents.First() == token.GetRequiredParent());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
124var startToken = section.Statements.First().GetFirstToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
225var anchorToken = parameterNode.AttributeLists.First().OpenBracketToken;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
55var start = usings.First().SpanStart; 64var start = rootUsings.First().SpanStart; 72? root.Members.First().GetFirstToken().Span.End
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
36var end = destination.Members.First().SpanStart;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
180var startToken = section.Statements.First().GetFirstToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
239var firstToken = resultNamespace.Members.First().GetFirstToken();
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
62Return TryCast(methodSyntax.Statements.First(), ThrowStatementSyntax) IsNot Nothing
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\MemberAccessExpressionSyntaxExtensions.vb (1)
60DirectCast(statement.Parent, ConstructorBlockSyntax).Statements.First() Is statement
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
615Return node.WithBody(statements.First())
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 (1)
273If element.Content.First().GetFirstToken(includeZeroWidth:=True) = baseToken Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
73indices.Add(Not destination.OverlapsHiddenPosition(TextSpan.FromBounds(0, destination.Members.First.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (1)
26indices.Add(Not destination.OverlapsHiddenPosition(destination.BlockStatement, destination.Members.First, cancellationToken))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
EndConstructGeneration\EndConstructStatementVisitor_LambdaHeader.vb (2)
71If(newBodyHasCode, CType(newExpression.Statements.First().SpanStart, Integer?), Nothing)) 96newBody = DirectCast(newExpression.Statements.First(), ReturnStatementSyntax)
Microsoft.CodeAnalysis.VisualBasic.Features (14)
AddImport\VisualBasicAddImportFeatureService.vb (1)
259Dim fromOrAggregateClause = query.Clauses.First()
Completion\KeywordRecommenders\Declarations\ImportsKeywordRecommender.vb (1)
33If context.Position <= compilationUnit.Options.First().SpanStart Then
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (1)
154Dim firstXmlText = TryCast(documentationComment.Content.First(), XmlTextSyntax)
EditAndContinue\BreakpointSpans.vb (3)
339If query.Clauses.First() IsNot fromClause AndAlso fromClause.Variables.Any() Then 345If query.Clauses.First() Is fromClause AndAlso fromClause.Variables.Count > 1 Then 384If query.Clauses.First() IsNot fromClause OrElse fromClause.Variables.IndexOf(collectionRangeVariable) <> 0 Then
EditAndContinue\DeclarationBody\MethodBody.vb (1)
27Return model.AnalyzeDataFlow(methodBlock.Statements.First, methodBlock.Statements.Last).CapturedInside
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (3)
670Dim firstStatement = ctor.Statements.First 1267Return TryGetDiagnosticSpanImpl(DirectCast(node, QueryExpressionSyntax).Clauses.First(), editKind) 2138Return TextSpan.FromBounds(tryBlock.CatchBlocks.First().SpanStart, tryBlock.EndTryStatement.Span.End)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
296Return node.WithBody(VisitList(ReplaceStatementsIfNeeded(body, colon:=True)).First()).
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
62Return TryCast(methodSyntax.Statements.First(), ThrowStatementSyntax) IsNot Nothing
src\Compilers\VisualBasic\Portable\Syntax\LambdaUtilities.vb (1)
582clause Is DirectCast(clause.Parent, QueryExpressionSyntax).Clauses.First
Structure\Providers\CompilationUnitStructureProvider.vb (1)
24Dim startPos = compilationUnit.Imports.First().SpanStart
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Semantics\ScriptSemanticsTests.vb (1)
172Dim node3 = DirectCast(node1.Members.First(), ExpressionStatementSyntax)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (6)
Parser\ParseExpression.vb (6)
1034Assert.Equal(" a ", el.Content.First.ToString()) 1035Assert.Equal(" a ", el.Content.First.ChildNodesAndTokens().First.ToFullString()) 1044Assert.Equal(" a &lt; b ", el.Content.First.ToString) 1045Assert.Equal(" a ", el.Content.First.ChildNodesAndTokens().First.ToFullString()) 1046Assert.Equal("<", el.Content.First.ChildNodesAndTokens(1).AsToken.ValueText) 1047Assert.Equal(" b ", el.Content.First.ChildNodesAndTokens().Last.ToFullString())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (8)
Formatting\Rules\NodeBasedFormattingRule.vb (1)
273If element.Content.First().GetFirstToken(includeZeroWidth:=True) = baseToken Then
OrganizeImports\VisualBasicOrganizeImportsService.Rewriter.vb (1)
75Return TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.[End])
Simplification\VisualBasicSimplificationService.vb (1)
106position = originalMethod.Statements.First.SpanStart
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\MemberAccessExpressionSyntaxExtensions.vb (1)
60DirectCast(statement.Parent, ConstructorBlockSyntax).Statements.First() Is statement
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
615Return node.WithBody(statements.First())
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)
73indices.Add(Not destination.OverlapsHiddenPosition(TextSpan.FromBounds(0, destination.Members.First.SpanStart), cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (1)
26indices.Add(Not destination.OverlapsHiddenPosition(destination.BlockStatement, destination.Members.First, cancellationToken))
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
Formatting\FormattingTests.vb (1)
3776Dim implementsStatement = DirectCast(root.Members(0), ClassBlockSyntax).Implements.First()
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (2)
233startPosition = attributes.First().LessThanToken.SpanStart 249Return New VirtualTreePoint(attributes.First().SyntaxTree, text, startPosition)