28 references to FirstOrDefault
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
203afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 219beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
171var firstStatement = switchCaseBlock.Statements.FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
152=> members.FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
55return members.FirstOrDefault();
Microsoft.CodeAnalysis.CSharp.Features (5)
CodeRefactorings\SyncNamespace\CSharpSyncNamespaceCodeRefactoringProvider.cs (1)
50var firstMemberDeclarationName = compilationUnit.Members.FirstOrDefault().GetNameToken();
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
98=> _parentStatement.Parent is BlockSyntax parentBlockOpt && parentBlockOpt.Statements.FirstOrDefault() == _parentStatement; 121&& compilationUnit.Members.FirstOrDefault() == globalStatement)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1882return TryGetDiagnosticSpanImpl(queryBody.Clauses.FirstOrDefault() ?? queryBody.Parent!, editKind);
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
171var firstStatement = switchCaseBlock.Statements.FirstOrDefault();
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
152=> members.FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
55return members.FirstOrDefault();
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
745DirectCast(statement.Parent, ConstructorBlockSyntax).Statements.FirstOrDefault() Is statement Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
838Dim firstStatement = method.Statements.FirstOrDefault()
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
40Return members.FirstOrDefault()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (1)
92Return members.FirstOrDefault()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
220If fromClause.Variables.FirstOrDefault() Is collectionRange AndAlso queryExpression.Clauses.FirstOrDefault() Is collectionRange.Parent Then
Microsoft.CodeAnalysis.VisualBasic.Features (3)
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
219Dim firstAccessor = propertyBlock.Accessors.FirstOrDefault()
Debugging\ProximityExpressionsGetter.Worker.vb (2)
107methodBlock.Statements.FirstOrDefault() Is _parentStatement OrElse 122If catchBlock.Statements.FirstOrDefault() Is _parentStatement AndAlso
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
745DirectCast(statement.Parent, ConstructorBlockSyntax).Statements.FirstOrDefault() Is statement Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
838Dim firstStatement = method.Statements.FirstOrDefault()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
40Return members.FirstOrDefault()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (1)
92Return members.FirstOrDefault()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
220If fromClause.Variables.FirstOrDefault() Is collectionRange AndAlso queryExpression.Clauses.FirstOrDefault() Is collectionRange.Parent Then
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
203afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 219beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
439return node.AccessorList.Accessors.FirstOrDefault();