733 references to First
ILLink.CodeFixProvider (1)
BaseAttributeCodeFixProvider.cs (1)
36 var diagnostic = context.Diagnostics.First ();
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
Microsoft.CodeAnalysis (5)
CodeGen\PermissionSetAttribute.cs (1)
74var fileArg = namedArgs.First();
Emit\EditAndContinue\DefinitionMap.cs (3)
298method.Locations.First(), 383method.Locations.First(), 424method.Locations.First(),
Operations\ControlFlowGraph.cs (1)
43Debug.Assert(blocks.First().Kind == BasicBlockKind.Entry);
Microsoft.CodeAnalysis.CodeStyle (7)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
132if (statements.First() is not IVariableDeclarationGroupOperation varDeclStatement ||
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
169return DiagnosticHelper.Create(Descriptor, symbol.Locations.First(), NotificationOption2.ForSeverity(applicableRule.EnforcementLevel), options, additionalLocations: null, builder.ToImmutable(), failureReason);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
933var ifDirective = condDirectives.First();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
164var span = TextSpan.FromBounds(nodes.First().Span.Start, nodes.Last().Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
32visitor.WriteLocation(symbol.Locations.First());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
274x.Locations.First().Equals(y.Locations.First());
Microsoft.CodeAnalysis.CodeStyle.Fixes (21)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
28var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
70var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
64var diagnostic = context.Diagnostics.First(); 310var aMethod = codeFixData.First().Method; // We need to term the MethodGroup and need an arbitrary IMethodSymbol to do so.
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
75context.Diagnostics.First());
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
32if (context.Diagnostics.First().Properties.ContainsKey(ForEachCastHelpers.IsFixable))
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
39var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
36var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
47var targetNamespace = diagnostics.First().Properties[MatchFolderAndNamespaceConstants.TargetNamespace];
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
48var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
57var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
36var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
46var (title, key) = context.Diagnostics.First().Properties.ContainsKey(UseConditionalExpressionHelpers.CanSimplifyName)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
39var (title, key) = context.Diagnostics.First().Properties.ContainsKey(UseConditionalExpressionHelpers.CanSimplifyName)
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
37var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
64var firstDiagnostic = context.Diagnostics.First();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (1)
80return types.First();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
82var originalParameter = methodSymbol.Parameters.First();
Microsoft.CodeAnalysis.CSharp (15)
Binder\Binder_Invocation.cs (1)
1215ParameterSymbol receiverParameter = method.Parameters.First();
Binder\Binder_Lookup.cs (1)
229TypeSymbol candidateType = errorType.CandidateSymbols.First() as TypeSymbol;
Binder\Binder_Symbols.cs (1)
2358return symbol.ContainingAssembly ?? ((NamespaceSymbol)symbol).ConstituentNamespaces.First().ContainingAssembly;
Emitter\Model\PEModuleBuilder.cs (1)
1368bool mustBeTranslated = @params.Any() && MustBeWrapped(@params.First());
Lowering\LocalRewriter\LocalRewriter.cs (1)
885initializer = (BoundStatement)block.Statements.First();
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
48NamedTypeSymbol firstContainer = node.ApplicableMethods.First().ContainingType;
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
302symbol = symbol.ReduceExtensionMethod(symbol.Parameters.First().Type) ?? symbol;
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
244var location = symbol.Locations.First();
Symbols\Attributes\AttributeData.cs (1)
368TypedConstant firstArg = ctorArgs.First();
Symbols\NamedTypeSymbol.cs (1)
356var thisParam = method.Parameters.First();
Symbols\Source\SourceMemberContainerSymbol.cs (3)
3012Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3017Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0); 3022Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
Symbols\Source\SourceNamedTypeSymbol.cs (1)
1711string defaultMemberName = this.Indexers.First().MetadataName; // UNDONE: IndexerNameAttribute
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
110return GetSimpleProgramNamedTypeSymbol(compilation)?.GetSimpleProgramEntryPoints().First();
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
68var firstDirective = (DirectiveTriviaSyntax)leadingDirectives.First().GetStructure()!; 72if (conditionalDirectives.First().SpanStart <= block.OpenBraceToken.SpanStart ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (26)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
38var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
34var diagnostic = context.Diagnostics.First(); 55var diagnostic = diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
39var switchLocation = context.Diagnostics.First().AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 50&& param.Equals(methodSymbol.Parameters.First())) 505var parameter = methodSymbol.Parameters.First();
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
40var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
67var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
33var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
33var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
36var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
47var node = context.Diagnostics.First().Location.FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
37var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
35var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
85var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
97var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
41var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
39var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
60var diagnostic = context.Diagnostics.First();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
239var innerType = symbol.TypeArguments.First();
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (12)
CommandLineTests.cs (12)
823Assert.Equal((int)ErrorCode.ERR_CantHaveWin32ResAndIcon, parsedArgs.Errors.First().Code); 827Assert.Equal((int)ErrorCode.ERR_CantHaveWin32ResAndManifest, parsedArgs.Errors.First().Code); 831Assert.Equal((int)ErrorCode.ERR_NoFileSpec, parsedArgs.Errors.First().Code); 832Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); 836Assert.Equal((int)ErrorCode.ERR_NoFileSpec, parsedArgs.Errors.First().Code); 837Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); 841Assert.Equal((int)ErrorCode.ERR_NoFileSpec, parsedArgs.Errors.First().Code); 842Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); 1921Assert.Equal((int)ErrorCode.WRN_DefineIdentifierRequired, parsedArgs.Errors.First().Code); 1922Assert.Equal("4X", parsedArgs.Errors.First().Arguments[0]); 16000symbolContext.ReportDiagnostic(Diagnostic.Create(Warning01, symbolContext.Symbol.Locations.First())); 16017symbolContext.ReportDiagnostic(Diagnostic.Create(Warning02, symbolContext.Symbol.Locations.First()));
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
StringCopyPaste\StringCopyPasteHelpers.cs (2)
551if (spans.First().Length > 0 && text[spans.First().Start] == '"')
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
CodeActions\PullMemberUp\CSharpPullMemberUpTests.cs (1)
49Assert.Equal(actions.First().Title, FeaturesResources.Pull_members_up_to_base_type);
Intents\IntentTestsBase.cs (1)
64var result = results.First();
SymbolKey\SymbolKeyCompilationsTests.cs (5)
132var definition = type.GetMembers("M").First() as IMethodSymbol; 159var definition = type.GetMembers("M").First() as IMethodSymbol; 187var definition = type.GetMembers("Prop").First() as IPropertySymbol; 552ResolveAndVerifySymbol(newSymbols.First(), originalSymbols.First(), comp1, SymbolKeyComparison.None);
TaskList\NoCompilationTaskListTests.cs (1)
64descriptors.First().Priority,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (136)
CodeGen\CodeGenAwaitForeachTests.cs (9)
3032var tree = comp.SyntaxTrees.First(); 3117var tree = comp.SyntaxTrees.First(); 3235var tree = comp.SyntaxTrees.First(); 3713var tree = comp.SyntaxTrees.First(); 9105var tree = comp.SyntaxTrees.First(); 9181var tree = comp.SyntaxTrees.First(); 9259var tree = comp.SyntaxTrees.First(); 9320var tree = comp.SyntaxTrees.First(); 9391var tree = comp.SyntaxTrees.First();
CodeGen\CodeGenDeconstructTests.cs (77)
93var tree = compilation.SyntaxTrees.First(); 309var tree = comp.SyntaxTrees.First(); 1364var tree = compilation.SyntaxTrees.First(); 1421var tree = compilation.SyntaxTrees.First(); 1465var tree = comp.SyntaxTrees.First(); 1506var tree = comp.SyntaxTrees.First(); 1559var tree = comp.SyntaxTrees.First(); 1666var tree = compilation.SyntaxTrees.First(); 2685var tree = compilation.SyntaxTrees.First(); 3127var tree = compilation.SyntaxTrees.First(); 3175var tree = compilation.SyntaxTrees.First(); 3239var tree = compilation.SyntaxTrees.First(); 3277var tree = compilation.SyntaxTrees.First(); 3327var tree = compilation.SyntaxTrees.First(); 3365var tree = compilation.SyntaxTrees.First(); 3440var tree = compilation.SyntaxTrees.First(); 3476var tree = compilation.SyntaxTrees.First(); 3541var tree = compilation.SyntaxTrees.First(); 3687var tree = compilation.SyntaxTrees.First(); 3732var tree = compilation.SyntaxTrees.First(); 3789var tree = compilation.SyntaxTrees.First(); 3839var tree = compilation.SyntaxTrees.First(); 3885var tree = compilation.SyntaxTrees.First(); 3929var tree = compilation.SyntaxTrees.First(); 3975var tree = compilation.SyntaxTrees.First(); 4024var tree = compilation.SyntaxTrees.First(); 4130var tree = compilation.SyntaxTrees.First(); 4215var tree = compilation.SyntaxTrees.First(); 4326var tree = compilation.SyntaxTrees.First(); 4402var tree = compilation.SyntaxTrees.First(); 4435var tree = compilation.SyntaxTrees.First(); 4589var tree = compilation.SyntaxTrees.First(); 5018var tree = compilation.SyntaxTrees.First(); 5170var tree = compilation.SyntaxTrees.First(); 5307var tree = compilation.SyntaxTrees.First(); 5343var tree = compilation.SyntaxTrees.First(); 5398var tree = comp.SyntaxTrees.First(); 5431var tree = comp.SyntaxTrees.First(); 5469var tree = comp.SyntaxTrees.First(); 5501var tree = comp.SyntaxTrees.First(); 5532var tree = comp.SyntaxTrees.First(); 5561var tree = comp.SyntaxTrees.First(); 5601var tree = comp.SyntaxTrees.First(); 5640var tree = comp.SyntaxTrees.First(); 5684var tree = comp.SyntaxTrees.First(); 5723var tree = comp.SyntaxTrees.First(); 5765var tree = comp.SyntaxTrees.First(); 5801var tree = comp.SyntaxTrees.First(); 5851var tree = comp.SyntaxTrees.First(); 5905var tree = comp.SyntaxTrees.First(); 5996var tree = comp.SyntaxTrees.First(); 6028var tree = comp.SyntaxTrees.First(); 6081var tree = comp.SyntaxTrees.First(); 6130var tree = comp.SyntaxTrees.First(); 6179var tree = comp.SyntaxTrees.First(); 6209var tree = comp.SyntaxTrees.First(); 6251var tree = comp.SyntaxTrees.First(); 6302var tree = comp.SyntaxTrees.First(); 6334var tree = comp.SyntaxTrees.First(); 6364var tree = comp.SyntaxTrees.First(); 6391var tree = comp.SyntaxTrees.First(); 6436var tree = compilation.SyntaxTrees.First(); 6559var tree = comp.SyntaxTrees.First(); 6857var tree = compilation.SyntaxTrees.First(); 6929var tree = compilation.SyntaxTrees.First(); 6972var tree = comp.SyntaxTrees.First(); 7120var tree = compilation.SyntaxTrees.First(); 7173var tree = compilation.SyntaxTrees.First(); 7228var tree = compilation.SyntaxTrees.First(); 7266var tree = compilation.SyntaxTrees.First(); 7303var tree = compilation.SyntaxTrees.First(); 7351var tree = compilation.SyntaxTrees.First(); 7390var tree = compilation.SyntaxTrees.First(); 7426var tree = compilation.SyntaxTrees.First(); 7503var tree = compilation.SyntaxTrees.First(); 7560var tree = compilation.SyntaxTrees.First(); 9008var tree = comp.SyntaxTrees.First();
CodeGen\CodeGenTupleEqualityTests.cs (12)
767var tree = comp.SyntaxTrees.First(); 2570var tree = comp.SyntaxTrees.First(); 2638var tree = comp.SyntaxTrees.First(); 3275var tree = comp.SyntaxTrees.First(); 3681var tree = comp.SyntaxTrees.First(); 3805var tree = comp.SyntaxTrees.First(); 3908var tree = comp.SyntaxTrees.First(); 4033var tree = comp.SyntaxTrees.First(); 4080var tree = comp.SyntaxTrees.First(); 4274var tree = comp.SyntaxTrees.First(); 5119var tree = comp.SyntaxTrees.First(); 5155var tree = comp.SyntaxTrees.First();
CodeGen\CodeGenTupleTest.cs (37)
3216var tree = compilation.SyntaxTrees.First(); 3249var tree = compilation.SyntaxTrees.First(); 3462var tree = compilation.SyntaxTrees.First(); 3633var tree = compilation.SyntaxTrees.First(); 3684var tree = compilation.SyntaxTrees.First(); 3930var tree = compilation.SyntaxTrees.First(); 3987var tree = compilation.SyntaxTrees.First(); 4020var tree = compilation.SyntaxTrees.First(); 4152var tree = compilation.SyntaxTrees.First(); 9852var tree = comp.SyntaxTrees.First(); 9903var tree = comp.SyntaxTrees.First(); 9945var tree = comp.SyntaxTrees.First(); 9991var tree = comp.SyntaxTrees.First(); 10057var tree = comp.SyntaxTrees.First(); 10096var tree = comp.SyntaxTrees.First(); 10130var tree = comp.SyntaxTrees.First(); 19227var tree = comp.SyntaxTrees.First(); 19289var tree = comp.SyntaxTrees.First(); 19392var tree = comp.SyntaxTrees.First(); 19423var tree = comp.SyntaxTrees.First(); 19477var tree = comp.SyntaxTrees.First(); 19535var tree = comp.SyntaxTrees.First(); 19658var tree = comp.SyntaxTrees.First(); 19702var tree = comp.SyntaxTrees.First(); 19733var tree = comp.SyntaxTrees.First(); 20355var tree = comp.SyntaxTrees.First(); 21348var tree = comp.SyntaxTrees.First(); 22853var tree = compilation.SyntaxTrees.First(); 23448var m = (MethodSymbol)(((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 23504var m = (IMethodSymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 23850var m = (MethodSymbol)(comp.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 23903var m = (PropertySymbol)(((CSharpCompilation)comp.Compilation).GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); 24178var tree = compilation.SyntaxTrees.First(); 26293var tree = comp.SyntaxTrees.First(); 26326var tree = comp.SyntaxTrees.First(); 26359var tree = comp.SyntaxTrees.First(); 26392var tree = comp.SyntaxTrees.First();
CodeGen\IndexAndRangeTests.cs (1)
3856var tree = comp.SyntaxTrees.First();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
CodeGen\IndexAndRangeTests.cs (8)
2676var tree = comp.SyntaxTrees.First(); 2839var tree = comp.SyntaxTrees.First(); 3302var tree = comp.SyntaxTrees.First(); 3453var tree = comp.SyntaxTrees.First(); 3639var tree = comp.SyntaxTrees.First(); 3729var tree = comp.SyntaxTrees.First(); 3815var tree = comp.SyntaxTrees.First(); 3888var tree = comp.SyntaxTrees.First();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (123)
Attributes\AttributeTests.cs (1)
4899var ca = goo.GetAttributes().First().CommonConstructorArguments.First();
Diagnostics\GetDiagnosticsTests.cs (3)
670var tree = compilation.SyntaxTrees.First(); 723var tree = compilation.SyntaxTrees.First(); 741var tree = compilation.SyntaxTrees.First();
FlowAnalysis\RegionAnalysisTests.cs (2)
3333var intsym = analysis.VariablesDeclared.First() as ILocalSymbol; 4425var tree = compilation.SyntaxTrees.First();
Semantics\CollectionExpressionTests.cs (32)
4769var tree = comp.SyntaxTrees.First(); 14232var tree = comp.SyntaxTrees.First(); 14308var tree = comp.SyntaxTrees.First(); 14381var tree = comp.SyntaxTrees.First(); 14443var tree = comp.SyntaxTrees.First(); 14567var tree = comp.SyntaxTrees.First(); 14650var tree = comp.SyntaxTrees.First(); 14739var tree = comp.SyntaxTrees.First(); 28618var tree = comp.SyntaxTrees.First(); 28662var tree = comp.SyntaxTrees.First(); 28708var tree = comp.SyntaxTrees.First(); 28752var tree = comp.SyntaxTrees.First(); 28795var tree = comp.SyntaxTrees.First(); 28838var tree = comp.SyntaxTrees.First(); 28877var tree = comp.SyntaxTrees.First(); 28910var tree = comp.SyntaxTrees.First(); 28944var tree = comp.SyntaxTrees.First(); 28997var tree = comp.SyntaxTrees.First(); 29063var tree = comp.SyntaxTrees.First(); 29124var tree = comp.SyntaxTrees.First(); 29200var tree = comp.SyntaxTrees.First(); 29243var tree = comp.SyntaxTrees.First(); 29290var tree = comp.SyntaxTrees.First(); 32297var tree = comp.SyntaxTrees.First(); 32333var tree = comp.SyntaxTrees.First(); 32365var tree = comp.SyntaxTrees.First(); 32393var tree = comp.SyntaxTrees.First(); 32435var tree = comp.SyntaxTrees.First(); 32480var tree = comp.SyntaxTrees.First(); 32544var tree = comp.SyntaxTrees.First(); 32640var tree = comp.SyntaxTrees.First(); 33035var tree = comp.SyntaxTrees.First();
Semantics\InlineArrayTests.cs (16)
2356var tree = comp.SyntaxTrees.First(); 2391var tree = comp.SyntaxTrees.First(); 2425var tree = comp.SyntaxTrees.First(); 2505var tree = comp.SyntaxTrees.First(); 6030var tree = comp.SyntaxTrees.First(); 6196var tree = comp.SyntaxTrees.First(); 8115var tree = comp.SyntaxTrees.First(); 8832var tree = comp.SyntaxTrees.First(); 9200var tree = comp.SyntaxTrees.First(); 10544var tree = comp.SyntaxTrees.First(); 11288var tree = comp.SyntaxTrees.First(); 15205var tree = comp.SyntaxTrees.First(); 16492var tree = comp.SyntaxTrees.First(); 18580var tree = comp.SyntaxTrees.First(); 18906var tree = comp.SyntaxTrees.First(); 19243var tree = comp.SyntaxTrees.First();
Semantics\OutVarTests.cs (10)
35176var tree = compilation.SyntaxTrees.First(); 35215var tree = compilation.SyntaxTrees.First(); 35259var tree = compilation.SyntaxTrees.First(); 35290var tree = compilation.SyntaxTrees.First(); 35329var tree = compilation.SyntaxTrees.First(); 35361var tree = compilation.SyntaxTrees.First(); 35397var tree = compilation.SyntaxTrees.First(); 35436var tree = compilation.SyntaxTrees.First(); 35466var tree = compilation.SyntaxTrees.First(); 35503var tree = compilation.SyntaxTrees.First();
Semantics\PatternMatchingTests_ListPatterns.cs (7)
3317var tree = compilation.SyntaxTrees.First(); 3718var tree = compilation.SyntaxTrees.First(); 4083var tree = compilation.SyntaxTrees.First(); 4170var tree = compilation.SyntaxTrees.First(); 4247var tree = compilation.SyntaxTrees.First(); 4361var tree = compilation.SyntaxTrees.First(); 4554var tree = compilation.SyntaxTrees.First();
Semantics\PatternMatchingTests_Scope.cs (1)
13820var tree = comp.SyntaxTrees.First();
Semantics\PatternMatchingTests4.cs (10)
4158var tree = comp.SyntaxTrees.First(); 4230var tree = comp.SyntaxTrees.First(); 4274var tree = comp.SyntaxTrees.First(); 4321var tree = comp.SyntaxTrees.First(); 4403var tree = comp.SyntaxTrees.First(); 4485var tree = comp.SyntaxTrees.First(); 4567var tree = comp.SyntaxTrees.First(); 4649var tree = comp.SyntaxTrees.First(); 4733var tree = comp.SyntaxTrees.First(); 4826var tree = comp.SyntaxTrees.First();
Semantics\PrimaryConstructorTests.cs (19)
1069var tree = comp.SyntaxTrees.First(); 1291var tree = comp.SyntaxTrees.First(); 1362var tree = comp.SyntaxTrees.First(); 1408var tree = comp.SyntaxTrees.First(); 1464var tree = comp.SyntaxTrees.First(); 1523var tree = comp.SyntaxTrees.First(); 1612var tree = comp.SyntaxTrees.First(); 1811var tree = comp.SyntaxTrees.First(); 1851var tree = comp.SyntaxTrees.First(); 1894var tree = comp.SyntaxTrees.First(); 1964var tree = comp.SyntaxTrees.First(); 2111var tree = comp.SyntaxTrees.First(); 2293var tree = comp.SyntaxTrees.First(); 2422var tree = comp.SyntaxTrees.First(); 2470var tree = comp.SyntaxTrees.First(); 2638var tree = comp.SyntaxTrees.First(); 2676var tree = comp.SyntaxTrees.First(); 2713var tree = comp.SyntaxTrees.First(); 2749var tree = comp.SyntaxTrees.First();
Semantics\RecordTests.cs (22)
280var tree = comp.SyntaxTrees.First(); 8087var tree = comp.SyntaxTrees.First(); 21186var tree = comp.SyntaxTrees.First(); 21410var tree = comp.SyntaxTrees.First(); 21481var tree = comp.SyntaxTrees.First(); 21527var tree = comp.SyntaxTrees.First(); 21583var tree = comp.SyntaxTrees.First(); 21642var tree = comp.SyntaxTrees.First(); 21731var tree = comp.SyntaxTrees.First(); 21930var tree = comp.SyntaxTrees.First(); 21967var tree = comp.SyntaxTrees.First(); 22007var tree = comp.SyntaxTrees.First(); 22042var tree = comp.SyntaxTrees.First(); 22121var tree = comp.SyntaxTrees.First(); 22268var tree = comp.SyntaxTrees.First(); 22450var tree = comp.SyntaxTrees.First(); 22959var tree = comp.SyntaxTrees.First(); 23413var tree = comp.SyntaxTrees.First(); 24685var tree = comp.SyntaxTrees.First(); 24720var tree = comp.SyntaxTrees.First(); 24754var tree = comp.SyntaxTrees.First(); 24789var tree = comp.SyntaxTrees.First();
Microsoft.CodeAnalysis.CSharp.Features (29)
AddImport\CSharpAddImportFeatureService.cs (1)
584externAliasString = aliases.First();
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
72var symbols = ImmutableArray.Create<ISymbol>(conversion.ContainingType, conversion.Parameters.First().Type, conversion.ReturnType);
Debugging\CSharpProximityExpressionsService.cs (1)
74var statement = info.Symbol.Locations.First().FindToken(cancellationToken).GetAncestor<StatementSyntax>();
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
38var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
34var diagnostic = context.Diagnostics.First(); 55var diagnostic = diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
39var switchLocation = context.Diagnostics.First().AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
37methodSymbol.Parameters.First().Type.SpecialType == SpecialType.System_Object && 50&& param.Equals(methodSymbol.Parameters.First())) 505var parameter = methodSymbol.Parameters.First();
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
40var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
67var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
33var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
33var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
36var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
47var node = context.Diagnostics.First().Location.FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
37var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
35var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
85var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
97var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
41var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
39var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
60var diagnostic = context.Diagnostics.First();
Structure\Providers\FileScopedNamespaceDeclarationStructureProvider.cs (1)
33CSharpStructureHelpers.CollectCommentBlockSpans(externsAndUsings.First(), spans, options);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (119)
Semantics\BindingAsyncTasklikeTests.cs (1)
190Assert.True(diagnostics.First().Code == (int)ErrorCode.ERR_AmbigCall);
Semantics\ConstantTests.cs (4)
2951var symbol = compilation.GlobalNamespace.GetTypeMembers("c1").First().GetMembers("Z1").First(); 2954symbol = compilation.GlobalNamespace.GetTypeMembers("c1").First().GetMembers("Z2").First();
Semantics\DeconstructionTests.cs (19)
3763var tree = compilation.SyntaxTrees.First(); 3941var tree = comp.SyntaxTrees.First(); 4167var tree = comp.SyntaxTrees.First(); 4235var tree = comp.SyntaxTrees.First(); 4370var tree = comp.SyntaxTrees.First(); 4504var tree = comp.SyntaxTrees.First(); 4662var tree = comp.SyntaxTrees.First(); 4756var tree = comp.SyntaxTrees.First(); 4834var tree = comp.SyntaxTrees.First(); 4939var tree = comp.SyntaxTrees.First(); 4985var tree = comp.SyntaxTrees.First(); 5043var tree = comp.SyntaxTrees.First(); 5129var tree = comp1.SyntaxTrees.First(); 5184var tree = comp.SyntaxTrees.First(); 5328var tree = comp.SyntaxTrees.First(); 5475var tree = comp.SyntaxTrees.First(); 5652var tree = comp.SyntaxTrees.First(); 5762var tree = comp.SyntaxTrees.First(); 5875var tree = comp.SyntaxTrees.First();
Semantics\FieldInitializerBindingTests.cs (1)
246var syntaxTree = compilation.SyntaxTrees.First();
Semantics\ImplicitObjectCreationTests.cs (21)
54var tree = comp.SyntaxTrees.First(); 129var tree = comp.SyntaxTrees.First(); 176var tree = comp.SyntaxTrees.First(); 226var tree = comp.SyntaxTrees.First(); 840var tree = comp.SyntaxTrees.First(); 881var tree = comp.SyntaxTrees.First(); 1704var tree = comp.SyntaxTrees.First(); 1864var tree = comp.SyntaxTrees.First(); 1894var tree = comp.SyntaxTrees.First(); 1924var tree = comp.SyntaxTrees.First(); 1976var tree = comp.SyntaxTrees.First(); 2034var tree = comp.SyntaxTrees.First(); 2069var tree = comp.SyntaxTrees.First(); 2123var tree = comp.SyntaxTrees.First(); 2215var tree = comp.SyntaxTrees.First(); 2512var tree = comp.SyntaxTrees.First(); 2563var tree = comp.SyntaxTrees.First(); 2920var tree = comp.SyntaxTrees.First(); 3213var tree = comp.SyntaxTrees.First(); 4155var tree = comp.SyntaxTrees.First(); 4182var tree = comp.SyntaxTrees.First();
Semantics\LocalFunctionTests.cs (4)
7637var tree = comp.SyntaxTrees.First(); 8682var tree = comp.SyntaxTrees.First(); 9550var tree = comp.SyntaxTrees.First(); 10170var tree = comp.SyntaxTrees.First();
Semantics\NonTrailingNamedArgumentsTests.cs (11)
365var tree = comp.SyntaxTrees.First(); 421var tree = comp.SyntaxTrees.First(); 453var tree = comp.SyntaxTrees.First(); 482var tree = comp.SyntaxTrees.First(); 532var tree = comp.SyntaxTrees.First(); 567var tree = comp.SyntaxTrees.First(); 596var tree = comp.SyntaxTrees.First(); 650var tree = comp.SyntaxTrees.First(); 677var tree = comp.SyntaxTrees.First(); 708var tree = comp.SyntaxTrees.First(); 981var tree = comp.SyntaxTrees.First();
Semantics\NullableConversionTests.cs (1)
803var syntaxTree = compilation.SyntaxTrees.First();
Semantics\NullableReferenceTypesTests.cs (7)
34981var tree = compilation.SyntaxTrees.First(); 34998var tree = compilation.SyntaxTrees.First(); 97754var tree = comp.SyntaxTrees.First(); 99083var tree = comp.SyntaxTrees.First(); 111767var tree = comp.SyntaxTrees.First(); 111821var tree = comp.SyntaxTrees.First(); 113190var tree = comp.SyntaxTrees.First();
Semantics\QueryTests.cs (2)
3132var tree = compilation.SyntaxTrees.First(); 3160var tree = compilation.SyntaxTrees.First();
Semantics\RecordStructTests.cs (11)
532var tree = comp.SyntaxTrees.First(); 552var tree = comp.SyntaxTrees.First(); 572var tree = comp.SyntaxTrees.First(); 594var tree = comp.SyntaxTrees.First(); 2591var tree = comp.SyntaxTrees.First(); 2626var tree = comp.SyntaxTrees.First(); 2660var tree = comp.SyntaxTrees.First(); 2695var tree = comp.SyntaxTrees.First(); 6923var tree = comp.SyntaxTrees.First(); 7604var tree = comp.SyntaxTrees.First(); 10768var tree = comp.SyntaxTrees.First();
Semantics\SemanticErrorTests.cs (1)
3256Assert.Equal(122, errs.First().Code);
Semantics\TargetTypedDefaultTests.cs (31)
40var tree = comp.SyntaxTrees.First(); 140var tree = comp.SyntaxTrees.First(); 192var tree = comp.SyntaxTrees.First(); 240var tree = comp.SyntaxTrees.First(); 277var tree = comp.SyntaxTrees.First(); 322var tree = comp.SyntaxTrees.First(); 516var tree = comp.SyntaxTrees.First(); 562var tree = comp.SyntaxTrees.First(); 605var tree = comp.SyntaxTrees.First(); 663var tree = comp.SyntaxTrees.First(); 744var tree = comp.SyntaxTrees.First(); 833var tree = comp.SyntaxTrees.First(); 862var tree = comp.SyntaxTrees.First(); 1138var tree = comp.SyntaxTrees.First(); 1253var tree = comp.SyntaxTrees.First(); 1627var tree = comp.SyntaxTrees.First(); 1732var tree = comp.SyntaxTrees.First(); 1798var tree = comp.SyntaxTrees.First(); 1869var tree = comp.SyntaxTrees.First(); 1907var tree = comp.SyntaxTrees.First(); 2086var tree = comp.SyntaxTrees.First(); 2329var tree = comp.SyntaxTrees.First(); 2410var tree = comp.SyntaxTrees.First(); 2453var tree = comp.SyntaxTrees.First(); 2479var tree = comp.SyntaxTrees.First(); 3053var tree = comp.SyntaxTrees.First(); 3379var tree = comp.SyntaxTrees.First(); 3510var tree = comp.SyntaxTrees.First(); 3572var tree = comp.SyntaxTrees.First(); 3669var tree = comp.SyntaxTrees.First(); 3709var tree = comp.SyntaxTrees.First();
Semantics\TopLevelStatementsTests.cs (1)
6365var syntaxTree1 = comp.SyntaxTrees.First();
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (4)
192Assert.True(step.Outputs.First().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }); 224Assert.True(step.Outputs.First().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }); 290Assert.True(step.Outputs.First().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }); 321step => Assert.True(step.Outputs.First().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (48)
Compilation\SemanticModelAPITests.cs (3)
618var at = a.TypeParameters.First(); 620var bt = b.TypeParameters.First(); 623Assert.Equal(bt, at2.TypeArguments.First());
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (5)
2788var typeB = n1.GetTypeMembers("B").First() as INamedTypeSymbol; 2980var sym2 = sym1.GetMembers("IGoo").First() as INamedTypeSymbol; 2985var sym3 = sym1.GetMembers("SGoo").First() as INamedTypeSymbol; 3077var typeA = ns1.GetTypeMembers("A").First() as INamedTypeSymbol; 3142var typeA = globalNS.GetTypeMembers("ErrorProp").First() as INamedTypeSymbol;
Compilation\SemanticModelGetSemanticInfoTests.cs (7)
12194Assert.Equal("Stat", semanticInfo.CandidateSymbols.First().Name); 12264Assert.Equal("X", semanticInfo.CandidateSymbols.First().Name); 12330Assert.Equal("T", semanticInfo.CandidateSymbols.First().Name); 14388Assert.Equal("InterfaceType", semanticInfo.CandidateSymbols.First().Name); 14483var tree = compilation.SyntaxTrees.First(); 14549Assert.Equal("System.IFormattable", semanticInfo.CandidateSymbols.First().ToTestDisplayString()); 15052var tree = compilation.SyntaxTrees.First();
DeclarationTests.cs (4)
292var type = compilation.Assembly.GlobalNamespace.GetTypeMembers().First(); 304var method = (MethodSymbol)type.GetMembers().First(); 339var type = compilation.Assembly.GlobalNamespace.GetTypeMembers().First(); 348var method = (MethodSymbol)type.GetMembers().First();
SymbolDisplay\SymbolDisplayTests.cs (3)
3589var tree = comp.SyntaxTrees.First(); 6060var tree = comp.SyntaxTrees.First(); 9022var tree = comp.SyntaxTrees.First();
Symbols\CustomModifiersTests.cs (3)
78var i = (INamedTypeSymbol)type.TypeArguments.First(); 142Assert.Equal("System.Runtime.CompilerServices.IsConst", modifiers.First().Modifier.ToTestDisplayString()); 154var i = type.TypeArguments.First();
Symbols\Metadata\MetadataTypeTests.cs (1)
362var oldTree = comp.SyntaxTrees.First();
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (6)
141NoPiaMissingCanonicalTypeSymbol missing = (NoPiaMissingCanonicalTypeSymbol)param.First().Type; 203Assert.Same(canonicalTypeInter, param.First().Type); 204Assert.IsAssignableFrom<PENamedTypeSymbol>(param.First().Type); 372NoPiaAmbiguousCanonicalTypeSymbol ambiguous = (NoPiaAmbiguousCanonicalTypeSymbol)param.First().Type; 374Assert.Equal(SymbolKind.ErrorType, param.First().Type.Kind); 375Assert.IsType<NoPiaAmbiguousCanonicalTypeSymbol>(param.First().Type);
Symbols\MethodEqualityTests.cs (2)
84var baseClassMethod1 = (MethodSymbol)baseClass.GetMembers("Method").First(); 144var baseClassMethod1 = (MethodSymbol)baseClass.GetMembers("Method").First();
Symbols\Source\EventTests.cs (2)
432var tree = compilation.SyntaxTrees.First(); 478var tree = compilation.SyntaxTrees.First();
Symbols\Source\MethodTests.cs (1)
214Assert.Equal(1, m.First().Locations.Length);
Symbols\Source\SourcePlusMetadataTests.cs (3)
192var metaSym = comp2.GlobalNamespace.GetTypeMembers("BaseTypeSpecifierClass").First(); 208var metaSym = comp2.GlobalNamespace.GetTypeMembers("FooAttribute").First(); 237var metaSym = metaType.GetMembers("I1.Method").First();
Symbols\SymbolEqualityTests.cs (2)
846var method1ParamType = method1.Parameters.First().Type; // A<T!> 847var method2ParamType = method2.Parameters.First().Type; // A<T!>
Symbols\TypeTests.cs (6)
905var classTest = globalNS.GetTypeMembers("Test").First(); 906var varA = classTest.GetMembers("a").First() as FieldSymbol; 927var typeSym = comp.Assembly.GlobalNamespace.GetTypeMembers().First(); 929var memSym = typeSym.GetMembers("Main").First(); 967var typeSym = comp.Assembly.GlobalNamespace.GetTypeMembers("MyClass").First(); 1017var typeSym = comp.Assembly.GlobalNamespace.GetTypeMembers("SubGenericClass").First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
IncrementalParsing\IncrementalParsingTests.cs (1)
2898var oldTree = comp.SyntaxTrees.First();
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (2)
68var firstDirective = (DirectiveTriviaSyntax)leadingDirectives.First().GetStructure()!; 72if (conditionalDirectives.First().SpanStart <= block.OpenBraceToken.SpanStart ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
239var innerType = symbol.TypeArguments.First();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (15)
CodeGeneration\SymbolEditorTests.cs (4)
393var location = symbol.Locations.First(); 530var member = symbol.GetMembers("m").First(); 712var symbolX = symbol.GetMembers("X").First(); 713var symbolY = symbol.GetMembers("Y").First();
CodeGeneration\SyntaxGeneratorTests.cs (11)
234return typeC.GetAttributes().First(); 3783var symbolX = (IFieldSymbol)symbolC.GetMembers("X").First(); 3784var symbolY = (IFieldSymbol)symbolC.GetMembers("Y").First(); 3785var symbolZ = (IFieldSymbol)symbolC.GetMembers("Z").First(); 4130var declC = symbolC.DeclaringSyntaxReferences.First().GetSyntax(); 4307var declC = symbolC.DeclaringSyntaxReferences.First().GetSyntax(); 4399var declC = symbolC.DeclaringSyntaxReferences.First().GetSyntax(); 4691var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("M").First(); 4709var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("X").First(); 4726var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("MyEvent").First(); 4751var symbol = comp.GlobalNamespace.GetMembers("C2").First().GetMembers("MyEvent").First();
Microsoft.CodeAnalysis.EditorFeatures (3)
CommentSelection\AbstractToggleBlockCommentBase.cs (1)
153var trackingSpan = TextSpan.FromBounds(intersectingBlockComments.First().Start, intersectingBlockComments.Last().End);
CommentSelection\ToggleLineCommentCommandHandler.cs (1)
142var indentation = DetermineSmallestIndent(selectedSpan, linesInSelection.First(), linesInSelection.Last());
EditAndContinue\ActiveStatementTrackingService.cs (1)
330if (snapshot != null && snapshot.TextBuffer == documentSpans.First().Span.TextBuffer)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
AbstractCommandHandlerTestState.cs (1)
87var firstSpan = selectionSpanList.First();
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
89textSpan = textSpans.First();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Snippets\RoslynLSPSnippetConvertTests.cs (1)
491var stringSpan = placeholderDictionary[""].First();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
InlineHints\InlineHintsTag.cs (2)
211var first = taggedTexts.First(); 221var first = taggedTexts.First();
Microsoft.CodeAnalysis.Features (39)
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (1)
188onItemFound((diagnostics.First(), currentAction));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
133var originalNamespaceName = semanticModel.GetRequiredDeclaredSymbol(originalNamespaceDeclarations.First(), cancellationToken).ToDisplayString();
Completion\Utilities.cs (1)
31var totalOldSpan = TextSpan.FromBounds(changes.First().Span.Start, changes.Last().Span.End);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
140.WithLeadingTrivia(pieces.First().GetLeadingTrivia());
DocumentHighlighting\AbstractDocumentHighlightsService.cs (2)
220if (symbol.Locations.First().IsInSource) 223await AddLocationSpanAsync(symbol.Locations.First(), solution, spanSet, tagMap, HighlightSpanKind.Definition, cancellationToken).ConfigureAwait(false);
EditAndContinue\EditSession.cs (1)
270var documentId = newDocumentIds.First();
EncapsulateField\AbstractEncapsulateFieldService.cs (2)
176var fieldDeclaration = field.DeclaringSyntaxReferences.First(); 324var fieldDeclaration = field.DeclaringSyntaxReferences.First();
ExtractMethod\MethodExtractor.VariableSymbol.cs (2)
332var locationLeft = _symbol.Locations.First(); 333var locationRight = other._symbol.Locations.First();
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
723.Where(s => !s.Equals(symbolGroup.First().OriginalDefinition))
MoveStaticMembers\MoveStaticMembersOptions.cs (1)
41var sourceLocation = destination.DeclaringSyntaxReferences.First();
NavigationBar\AbstractNavigationBarItemService.cs (2)
80Location.Create(allReferences.First().SyntaxTree, allReferences.First().Span);
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
212var firstSymbol = symbols.First();
QuickInfo\QuickInfoUtilities.cs (1)
41var symbol = symbols.First();
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
41var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
132if (statements.First() is not IVariableDeclarationGroupOperation varDeclStatement ||
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (1)
169return DiagnosticHelper.Create(Descriptor, symbol.Locations.First(), NotificationOption2.ForSeverity(applicableRule.EnforcementLevel), options, additionalLocations: null, builder.ToImmutable(), failureReason);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
28var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
70var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
64var diagnostic = context.Diagnostics.First(); 310var aMethod = codeFixData.First().Method; // We need to term the MethodGroup and need an arbitrary IMethodSymbol to do so.
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
75context.Diagnostics.First());
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
32if (context.Diagnostics.First().Properties.ContainsKey(ForEachCastHelpers.IsFixable))
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
39var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
36var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
47var targetNamespace = diagnostics.First().Properties[MatchFolderAndNamespaceConstants.TargetNamespace];
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
48var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
57var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
36var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
46var (title, key) = context.Diagnostics.First().Properties.ContainsKey(UseConditionalExpressionHelpers.CanSimplifyName)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
39var (title, key) = context.Diagnostics.First().Properties.ContainsKey(UseConditionalExpressionHelpers.CanSimplifyName)
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
37var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
64var firstDiagnostic = context.Diagnostics.First();
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Extensions\Extensions.cs (2)
158var solution = documents.First().Project.Solution; 160var documentIdInCurrentContext = solution.Workspace.GetDocumentIdInCurrentContext(documents.First().Id);
Handler\InlayHint\InlayHintHandler.cs (2)
119var first = taggedTexts.First(); 129var first = taggedTexts.First();
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (1)
61var openDocumentId = documentIds.First();
Workspaces\LspWorkspaceManager.cs (1)
509var firstDocument = documentsForUri.First();
Microsoft.CodeAnalysis.Test.Utilities (4)
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (4)
69context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 100context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 154context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.OwningSymbol.Locations.First(), messageArgs: context.OwningSymbol.Name + ":end")); 173context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.OwningSymbol.Locations.First(), messageArgs: context.OwningSymbol.Name + ":end"));
Microsoft.CodeAnalysis.UnitTests (2)
CommonCommandLineParserTests.cs (2)
452Assert.Equal(ReportDiagnostic.Default, ruleSet.Includes.First().Action); 453Assert.Equal("goo.ruleset", ruleSet.Includes.First().IncludePath);
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\GetImportScopesTests.vb (1)
410Assert.True(TypeOf scopes.Single().XmlNamespaces.First().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax)
Microsoft.CodeAnalysis.Workspaces (12)
ReassignedVariable\AbstractReassignedVariableService.cs (1)
226var methodOrPropertyDeclaration = methodOrProperty.DeclaringSyntaxReferences.First().GetSyntax(cancellationToken);
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
23? [definition.Locations.First()]
Shared\Extensions\ISymbolExtensions.cs (2)
193var argumentValue = attribute.ConstructorArguments.First().Value; 466return memberSymbol.ExplicitInterfaceImplementations().First();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
933var ifDirective = condDirectives.First();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
164var span = TextSpan.FromBounds(nodes.First().Span.Start, nodes.Last().Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
32visitor.WriteLocation(symbol.Locations.First());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
274x.Locations.First().Equals(y.Locations.First());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (1)
80return types.First();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
82var originalParameter = methodSymbol.Parameters.First();
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
702var projectIdToReference = ids.First();
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
FindReferencesTests.cs (6)
104var symbol = (await project.GetCompilationAsync()).GetTypeByMetadataName("C").GetMembers("X").First(); 129var symbol = (IFieldSymbol)(await project.GetCompilationAsync()).GetTypeByMetadataName("C").GetMembers("X").First(); 328var boo = typeB.GetMembers("Boo").First(); 339boo = typeC.GetMembers("Boo").First(); 350boo = typeA.GetMembers("Boo").First(); 391var interfaceMethod = (IMethodSymbol)(await netStandardProject.GetCompilationAsync()).GetTypeByMetadataName("N.I").GetMembers("Get").First();
UtilityTest\DocumentationCommentIdTests.cs (1)
337var method = outerType.GetMembers("M").First() as IMethodSymbol;
Microsoft.Extensions.Options.SourceGeneration (4)
Parser.cs (4)
259return implementingInterface.TypeArguments.First(); 305Diag(DiagDescriptors.MemberIsInaccessible, member.Locations.First(), member.Name); 754result.Add(implementingInterface.TypeArguments.First()); 767var t = implementingInterface.TypeArguments.First();
Microsoft.Interop.SourceGeneration (1)
TypeSymbolExtensions.cs (1)
250currentType = currentType.GetTypeMembers(originalNestedType.Name, originalNestedType.Arity).First();
Microsoft.ML.Tests (2)
ImagesTests.cs (2)
1028using (var image = (MLImage)rowView.First().Values.Last().Value) 1189var resizedImage = (MLImage)rowView.First().Values.Last().Value;
Microsoft.VisualStudio.LanguageServices (1)
Workspace\VisualStudioDocumentNavigationService.cs (1)
230var documentIdToNavigate = documentIdsForFilePath.Contains(documentId) ? documentId : documentIdsForFilePath.First();
Mvc.Analyzers.Test (22)
CodeAnalysisExtensionsTest.cs (13)
27var method = (IMethodSymbol)testClass.GetMembers("Method").First(); 55var method = (IMethodSymbol)testClass.GetMembers("Method").First(); 92var method = (IMethodSymbol)testClass.GetMembers("Method").First(); 129var method = (IMethodSymbol)testClass.GetMembers("Method").First(); 166var method = (IMethodSymbol)testClass.GetMembers("Method").First(); 211var method = (IMethodSymbol)testClass.GetMembers("VirtualMethod").First(); 254var method = (IMethodSymbol)testClass.GetMembers("NotVirtualMethod").First(); 475var testMethod = (IMethodSymbol)testClass.GetMembers("SomeMethod").First(); 476var testProperty = (IPropertySymbol)testClass.GetMembers("SomeProperty").First(); 592var method = (IMethodSymbol)testClass.GetMembers("SomeMethod").First(); 626var method = (IMethodSymbol)testClass.GetMembers("SomeMethod").First(); 657var property = (IPropertySymbol)testClass.GetMembers("SomeProperty").First(); 691var property = (IPropertySymbol)testClass.GetMembers("SomeProperty").First();
TopLevelParameterNameAnalyzerTest.cs (9)
321var method = (IMethodSymbol)modelType.GetMembers("ActionMethod").First(); 411var method = (IMethodSymbol)modelType.GetMembers("ActionMethod").First(); 436var method = (IMethodSymbol)type.GetMembers("Action").First(); 461var method = (IMethodSymbol)type.GetMembers("Action").First(); 485var method = (IMethodSymbol)type.GetMembers("Action").First(); 509var method = (IMethodSymbol)type.GetMembers("Action").First(); 533var method = (IMethodSymbol)type.GetMembers("Action").First(); 556var method = (IMethodSymbol)type.GetMembers("Action").First(); 579var method = (IMethodSymbol)type.GetMembers("Action").First();
Mvc.Api.Analyzers.Test (40)
ActualApiResponseMetadataFactoryTest.cs (3)
76var method = (IMethodSymbol)returnType.GetMembers().First(); 370var method = (IMethodSymbol)type.GetMembers(methodName).First(); 412var method = (IMethodSymbol)returnType.GetMembers().First();
ApiControllerFactsTest.cs (6)
37var method = (IMethodSymbol)compilation.GetTypeByMetadataName("TestNamespace.TestController").GetMembers("Get").First(); 53var method = (IMethodSymbol)type.GetMembers(nameof(ApiConventionAnalyzerTest_IndexModel.OnGet)).First(); 69var method = (IMethodSymbol)type.GetMembers(nameof(ApiConventionAnalyzerTest_NotApiController.Index)).First(); 85var method = (IMethodSymbol)type.GetMembers(nameof(ApiConventionAnalyzerTest_NotAction.Index)).First(); 101var method = (IMethodSymbol)type.GetMembers(nameof(ApiConventionAnalyzerTest_Valid.Index)).First(); 117var method = (IMethodSymbol)type.GetMembers(nameof(IsApiControllerAction_ReturnsTrue_IfAttributeIsDeclaredOnAssemblyController.Action)).First();
MvcFactsTest.cs (3)
153var method = (IMethodSymbol)typeSymbol.GetMembers(methodName).First(); 200var method = (IMethodSymbol)typeSymbol.GetMembers(methodName).First(); 212return (IMethodSymbol)type.GetMembers(nameof(IDisposable.Dispose)).First();
SymbolApiConventionMatcherTest.cs (8)
432var method = (IMethodSymbol)testController.GetMembers(methodName).First(); 433var conventionMethod = (IMethodSymbol)testConvention.GetMembers(conventionMethodName).First(); 451var method = testConvention.GetMembers(nameof(TestConvention.MethodWithoutMatchBehavior)).First(); 469var method = testConvention.GetMembers(nameof(TestConvention.MethodWithRandomAttributes)).First(); 487var method = testConvention.GetMembers(nameof(TestConvention.Get)).First(); 505var method = (IMethodSymbol)testConvention.GetMembers(nameof(TestConvention.Get)).First(); 524var method = (IMethodSymbol)testConvention.GetMembers(nameof(TestConvention.MethodParameterWithRandomAttributes)).First(); 543var method = (IMethodSymbol)testConvention.GetMembers(nameof(TestConvention.MethodWithAnyTypeMatchBehaviorParameter)).First();
SymbolApiResponseMetadataProviderTest.cs (20)
19var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerWithoutConvention.GetPerson)).First(); 37var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerWithoutConvention.PostPerson)).First(); 55var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithProducesAttribute)).First(); 73var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithProducesResponseType_StatusCodeInConstructor)).First(); 96var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithProducesResponseType_StatusCodeAndTypeInConstructor)).First(); 119var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithProducesResponseType_StatusCodeInConstructorAndProperty)).First(); 142var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithProducesResponseType_StatusCodeAndTypeInConstructorAndProperty)).First(); 165var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithCustomProducesResponseTypeAttributeWithArguments)).First(); 187var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.GetResponseMetadata_ReturnsValuesFromApiConventionMethodAttribute)).First(); 218var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.GetResponseMetadata_WithProducesResponseTypeAndApiConventionMethod)).First(); 240var method = (IMethodSymbol)controller.GetMembers(nameof(GetResponseMetadata_ControllerActionWithAttributes.ActionWithCustomApiResponseMetadataProvider)).First(); 273var method = (IMethodSymbol)controller.GetMembers(methodName).First(); 296var method = (IMethodSymbol)controller.GetMembers().First(); 318var method = (IMethodSymbol)controller.GetMembers().First(); 392var method = (IMethodSymbol)controller.GetMembers(actionName).First(); 393var attribute = method.GetAttributes().First(); 408var method = (IMethodSymbol)type.GetMembers("Action").First(); 426var method = (IMethodSymbol)type.GetMembers("Action").First(); 444var method = (IMethodSymbol)type.GetMembers("Action").First(); 462var method = (IMethodSymbol)type.GetMembers("Action").First();
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
38Diagnostic diagnostic = context.Diagnostics.First();