2296 references to Item
Aspire.Hosting (3)
Aspire.Hosting.Azure (1)
BuildActionTelemetryTable (1)
BuildValidator (1)
IdeBenchmarks (1)
illink (4)
ILLink.RoslynAnalyzer (26)
Microsoft.Analyzers.Extra (7)
Microsoft.AspNetCore.Analyzers (8)
Microsoft.AspNetCore.App.Analyzers (28)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
Microsoft.AspNetCore.Mvc.Analyzers (5)
Microsoft.AspNetCore.Mvc.Api.Analyzers (10)
Microsoft.Build (1)
Microsoft.Cci.Extensions (1)
Microsoft.CodeAnalysis (316)
Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg));
359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
438builder[i] = map(self[i], other[i]);
456builder.Add(map(self[i], other[i], i, arg));
489var a = array[i];
523builder.Add(array[j]);
551var a = array[i];
567var a = array[i];
583var a = array[i];
599var a = array[i];
615var a = array[i];
1048if (predicate(items[i]))
1070sum += selector(items[i], i);
1215if (!predicate(array1[i], array2[i], arg))
1233if (comparer.Compare(array[i - 1], array[i]) > 0)
Generated\Operations.Generated.cs (32)
4015=> Operations[index],
4070=> Declarations[index],
4134=> Cases[index],
4228=> NextVariables[index],
4310=> Before[index],
4316=> AtLoopBottom[index],
4420=> NextVariables[index],
4742=> Catches[index],
5027=> Arguments[index],
5178=> Arguments[index],
5245=> Indices[index],
5476=> Arguments[index],
5936=> Arguments[index],
6055=> DimensionSizes[index],
6593=> Parts[index],
6649=> Initializers[index],
6705=> Initializers[index],
6879=> Elements[index],
7722=> ElementValues[index],
7782=> IgnoredArguments[index],
7851=> IgnoredDimensions[index],
7853=> Declarators[index],
8071=> Clauses[index],
8073=> Body[index],
9118=> Clauses[index],
9178=> DimensionSizes[index],
9248=> DeconstructionSubpatterns[index],
9250=> PropertySubpatterns[index],
9337=> Arms[index],
10308=> Arguments[index],
10375=> Patterns[index],
10686=> Elements[index],
SourceGeneration\GeneratorDriver.cs (10)
105states.Add(_state.GeneratorStates[existingIndex]);
123if (generators.Contains(newGenerators[i]))
230var generator = state.IncrementalGenerators[i];
231var generatorState = state.GeneratorStates[i];
232var sourceGenerator = state.Generators[i];
315if (shouldSkipGenerator(state.Generators[i]) || generatorState.OutputNodes.Length == 0)
320using var generatorTimer = CodeAnalysisEventSource.Log.CreateSingleGeneratorRunTimer(state.Generators[i], (t) => t.Add(syntaxStoreBuilder.GetRuntimeAdjustment(stateBuilder[i].InputNodes)));
328stateBuilder[i] = generatorState.WithResults(ParseAdditionalSources(state.Generators[i], sources, cancellationToken), generatorDiagnostics, generatorRunStateTable.ExecutedSteps, generatorRunStateTable.OutputSteps, hostOutputs, generatorTimer.Elapsed);
330catch (UserFunctionException ufe) when (handleGeneratorException(compilation, MessageProvider, state.Generators[i], ufe.InnerException, isInit: false))
332stateBuilder[i] = SetGeneratorException(compilation, MessageProvider, generatorState, state.Generators[i], ufe.InnerException, diagnosticsBag, cancellationToken, runTime: generatorTimer.Elapsed);
Microsoft.CodeAnalysis.CodeStyle (88)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg));
359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
438builder[i] = map(self[i], other[i]);
456builder.Add(map(self[i], other[i], i, arg));
489var a = array[i];
523builder.Add(array[j]);
551var a = array[i];
567var a = array[i];
583var a = array[i];
599var a = array[i];
615var a = array[i];
1048if (predicate(items[i]))
1070sum += selector(items[i], i);
1215if (!predicate(array1[i], array2[i], arg))
1233if (comparer.Compare(array[i - 1], array[i]) > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
38result.Add(array[i]);
Microsoft.CodeAnalysis.CodeStyle.Fixes (34)
Microsoft.CodeAnalysis.CSharp (826)
Binder\Binder_Conversions.cs (10)
384new BoundValuePlaceholder(source.Syntax, sourceTypes[i].Type),
385elementConversions[i],
389destTypes[i].Type,
392elementConversions[i].AssertUnderlyingConversionsChecked();
1979? CreateConversion(oldValue.Syntax, oldValue, underlyingConversions[i], isCast: false, conversionGroupOpt: null, destination, diagnostics)
2319var lambdaParameter = lambdaSymbol.Parameters[p];
2320var delegateParameter = delegateParameters[p];
2486var destType = targetElementTypes[i];
2848var delegateParameter = delegateOrFuncPtrParameters[i];
2849var methodParameter = methodParameters[isExtensionMethod ? i + 1 : i];
Binder\Binder_Deconstruct.cs (7)
305hasErrors |= !MakeDeconstructionConversion(tupleOrDeconstructedTypes[i], elementSyntax, rightSyntax, diagnostics,
323nestedConversion = this.Conversions.ClassifyConversionFromType(tupleOrDeconstructedTypes[i], single.Type, isChecked: CheckOverflowAtRuntime, ref useSiteInfo);
329GenerateImplicitConversionError(diagnostics, Compilation, single.Syntax, nestedConversion, tupleOrDeconstructedTypes[i], single.Type);
334var operandPlaceholder = new BoundValuePlaceholder(syntax, tupleOrDeconstructedTypes[i]).MakeCompilerGenerated();
362variables[i] = new DeconstructionVariable(SetInferredType(pending, foundTypes[i], diagnostics), variable.Syntax);
480BoundExpression element = rhsLiteral.Arguments[i];
687if (parameters[i].RefKind != RefKind.Out)
Binder\Binder_Expressions.cs (19)
2860var argument = tupleArguments[i];
2861var targetElementType = targetElementTypesWithAnnotations[i].Type;
3484arguments[arg] = coerceArgument(in methodResult, receiver, parameters, argumentsForInterpolationConversion: arguments, argument, arg, parameters[paramNum].TypeWithAnnotations, diagnostics);
3606if (parameters[paramsIndex].Type.IsSZArray())
3626BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs, diagnostics);
3680return parameters[paramNum];
3765int handlerParameter = handlerParameterIndexes[handlerParameterIndex];
3798int argumentIndex = handlerArgumentIndexes[i];
3814var originalParameterIndex = handlerParameterIndexes[i];
3815var parameter = parameters[originalParameterIndex];
3834var originalParameterIndex = handlerParameterIndexes[i];
3835var parameter = parameters[originalParameterIndex];
4231BoundExpression boundExpression = boundInitExpr[boundInitExprIndex];
4256init = boundInitExpr[boundInitExprIndex];
4391var size = sizes[i];
6559MethodSymbol constructor = constructors[i];
7561var typeArgument = typeArgumentsWithAnnotations[i];
10872parameterTypes[i],
10873parameterRefKinds.IsDefault ? RefKind.None : parameterRefKinds[i],
Binder\Binder_Query.cs (4)
470arguments = arguments.SetItem(arguments.Length - 1, MakeQueryClause(join.Into, arguments[arguments.Length - 1], g));
539arguments = arguments.SetItem(arguments.Length - 1, MakeQueryClause(join.Into, arguments[arguments.Length - 1], g));
633arguments.SetItem(arguments.Length - 2, MakeQueryClause(from, arguments[arguments.Length - 2], x2, invocation, castInvocation)));
680var c1 = invocation.Arguments[index] as BoundConversion;
Binder\Binder_Symbols.cs (13)
1997return originalSymbols[best.Index];
2008return originalSymbols[best.Index];
2019return originalSymbols[best.Index];
2032Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(),
2035Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything),
2190Debug.Assert(originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name ||
2191!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything),
2201originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name && // Use alias names, if available.
Binder\Semantics\Conversions\ConversionsBase.cs (17)
1517delegateParameterRefKind: delegateParameters[p].RefKind,
1519!delegateParameters[p].Type.Equals(anonymousFunction.ParameterType(p), TypeCompareKind.AllIgnoreOptions))
1529if (delegateParameters[p].RefKind != RefKind.None)
1560if (delegateParameters[p].TypeWithAnnotations.IsStatic)
1571if (delegateParameters[p].RefKind == RefKind.Out)
1740UserDefinedConversionAnalysis analysis = result.Results[result.Best];
2346var argument = arguments[i];
2347var result = classifyConversion(this, argument, targetElementTypes[i], isChecked: isChecked, ref useSiteInfo, forCast: forCast);
2420var conversion = classifyConversion(this, sourceTypes[i], destTypes[i], isChecked: isChecked, ref useSiteInfo, forCast);
3398var sourceParam = sourceSig.Parameters[i];
3399var destinationParam = destinationSig.Parameters[i];
3406if (!hasConversion(sourceParam.RefKind, destinationSig.Parameters[i].TypeWithAnnotations, sourceSig.Parameters[i].TypeWithAnnotations, ref useSiteInfo))
3688var sourceArg = sourceTypeArguments[i].Type;
3689var destinationArg = destinationTypeArguments[i].Type;
3691switch (original.TypeParameters[i].Variance)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (31)
358sb.Append(_formalParameterTypes[i]);
399sb.AppendFormat("Method type parameter {0}: ", _methodTypeParameters[i].Name);
426return _formalParameterRefKinds.IsDefault ? RefKind.None : _formalParameterRefKinds[index];
467_fixedResults[i] = (TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(_constructedContainingTypeOfMethod, _methodTypeParameters[i].Name, 0, null, false)), false);
493TypeSymbol.Equals(typeParameter, _methodTypeParameters[ordinal], TypeCompareKind.ConsiderEverything2) &&
585BoundExpression argument = _arguments[arg];
586TypeWithAnnotations target = _formalParameterTypes[arg];
724var sourceArgument = sourceArguments[i];
725var destType = destTypes[i];
843var formalType = _formalParameterTypes[arg];
844var argument = _arguments[arg];
917var sourceArgument = sourceArguments[i];
918var destType = destTypes[i];
1024if (DoesInputTypeContain(pSource, pDest, _methodTypeParameters[iParam]))
1084if (DoesOutputTypeContain(argument, formalParameterType, _methodTypeParameters[iParam]))
1118var formalParameterType = _formalParameterTypes[iArg].Type;
1119var argument = _arguments[iArg];
1120if (DoesInputTypeContain(argument, formalParameterType, _methodTypeParameters[jParam]) &&
1121DoesOutputTypeContain(argument, formalParameterType, _methodTypeParameters[iParam]))
1568ExactInference(anonymousFunction.ParameterTypeWithAnnotations(i), delegateParameters[i].TypeWithAnnotations, ref useSiteInfo);
1822LowerBoundInference(sourceTypes[i], targetTypes[i], ref useSiteInfo);
1876ExactInference(sourceSignature.ParameterTypesWithAnnotations[i], targetSignature.ParameterTypesWithAnnotations[i], ref useSiteInfo);
2418var sourceParam = sourceSignature.Parameters[i];
2419var targetParam = targetSignature.Parameters[i];
2768var sourceParam = sourceSignature.Parameters[i];
2769var targetParam = targetSignature.Parameters[i];
2801var typeParameter = _methodTypeParameters[iParam];
3099if (!anonymousFunction.ParameterType(p).Equals(fixedDelegateParameters[p].Type, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes))
3250TypeParameterSymbol pParam = _methodTypeParameters[iParam];
FlowAnalysis\NullableWalker.cs (41)
2809var parameter = methodParameters[i];
2812var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations;
4503var argument = arguments[i];
4533var currentDeclaration = node.Declarations[currentDeclarationIndex];
4742BoundExpression placeholder = placeholders[i];
6526var comparand = compareExchangeInfo.Arguments[comparandIndex];
6527var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State;
6534var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State;
6857var argumentNoConversion = argumentsNoConversions[i];
6858var argument = i < arguments.Length ? arguments[i] : argumentNoConversion;
6892conversions.IsDefault || i >= conversions.Length ? Conversion.Identity : conversions[i],
6897results[i],
6903if (results[i].RValueType.IsNotNull || isExpandedParamsArgument)
6940arguments[i],
6945results[i],
6956var argument = arguments[i];
6957var result = results[i];
6958var argumentNoConversion = argumentsNoConversions[i];
7005BoundExpression argument = arguments[a];
7242resultsBuilder.Add(VisitArgumentEvaluate(arguments[i], GetRefKind(refKindsOpt, i), parameterAnnotationsOpt.IsDefault ? default : parameterAnnotationsOpt[i]));
7748var argument = arguments[i];
7937var visitArgumentResult = argumentResults[i];
7938builder.Add(getArgumentForMethodTypeInference(arguments[i], visitArgumentResult));
7966if (collection.Elements[i] is BoundExpression elementExpression)
7973elementsBuilder.Add(collection.Elements[i]);
8482trackState(values[argOrdinal], tupleElements[i], types[argOrdinal]);
8489trackState(values[argOrdinal], restField, types[argOrdinal]);
8548trackConvertedValue(targetElements[i], conversions[i], valueElements[i]);
10184placeholderArgs.Add(new BoundExpressionWithNullability(variables[i].Expression.Syntax, variables[i].Expression, NullableAnnotation.Oblivious, conversion.DeconstructionInfo.OutputPlaceholders[i].Type));
10210var parameter = parameters[i + offset];
10211var (placeholder, placeholderConversion) = conversion.DeconstructConversionInfo[i];
10216var nestedRight = CreatePlaceholderIfNecessary(invocation.Arguments[i + offset], parameter.TypeWithAnnotations);
10230var parameter = parameters[i + offset];
10252var (placeholder, placeholderConversion) = deconstructConversionInfo[i];
10254var rightPart = rightParts[i];
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
597var arg = args[i];
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (13)
67var element = tuple.Arguments[i];
68var elementConversion = underlyingConversions[i];
69var elementType = resultTypes[i].Type;
119var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(savedTuple, syntax, srcElementFields[i]);
121syntax, fieldAccess, elementConversions[i], boundConversion.Checked, boundConversion.ExplicitCastInCode, null, null, destElementTypes[i].Type, boundConversion.HasErrors);
155var argument = tuple.Arguments[i];
156var newArgument = ReplaceTerminalElementsWithTemps(argument, multiple.Operators[i], initEffects, temps);
452argumentBuilder.Add(MakeBoundConversion(GetTuplePart(operand, i), underlyingConversions[i], types[i], conv));
495BoundExpression nextLogicalOperand = RewriteTupleOperator(nestedOperators[i], leftElement, rightElement, type, temps, operatorKind);
521return tupleExpression.Arguments[i];
530return MakeTupleFieldAccessAndReportUseSiteDiagnostics(tuple, tuple.Syntax, tuple.Type.TupleElements[i]);
Symbols\Source\SourceMemberContainerSymbol.cs (25)
398var decl = declaration.Declarations[i];
410mods, allowedModifiers, declaration.Declarations[i].NameLocation, diagnostics,
453: ErrorCode.ERR_DuplicateNameInNS, declaration.Declarations[i].NameLocation, this.Name, this.ContainingSymbol);
462diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, declaration.Declarations[i].NameLocation, this.ContainingSymbol, this.Name);
472var singleDeclaration = declaration.Declarations[i];
1185found = group[initializerIndex];
1212length += getInitializerLength(initializers[i]);
1258if (precedingInitializerIndex >= 0 && initializers[precedingInitializerIndex].Syntax.Span.Contains(position))
2154var refKind1 = method1.Parameters[i].RefKind;
2155var refKind2 = method2.Parameters[i].RefKind;
2559if (!op1.ParameterTypesWithAnnotations[p].Equals(op2.ParameterTypesWithAnnotations[p], TypeCompareKind.AllIgnoreOptions))
2998Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
3003Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0);
3006if (initializers[i].Length != 1)
3008Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
3068if (LexicalSortKey.Compare(sortKey, new LexicalSortKey(declaredMembers.InstanceInitializers[insertAt][0].Syntax, compilation)) < 0)
3077declaredMembers.DeclarationWithParameters.SyntaxTree == declaredMembers.InstanceInitializers[insertAt][0].Syntax.SyntaxTree &&
3078declaredMembers.DeclarationWithParameters.Span.Contains(declaredMembers.InstanceInitializers[insertAt][0].Syntax.Span.Start))
3081var declaredInitializers = declaredMembers.InstanceInitializers[insertAt];
3945var methodParam = methodParams[i];
3951var propertyParamType = (((i == numParams - 1) && !getNotSet) ? propertySymbol.TypeWithAnnotations : propertyParams[i].TypeWithAnnotations).Type;
Symbols\Source\SourceNamedTypeSymbol.cs (14)
268return (constraintTypes.Length > 0) ? constraintTypes[ordinal] : ImmutableArray<TypeWithAnnotations>.Empty;
297return (constraintKinds.Length > 0) ? constraintKinds[ordinal] : TypeParameterConstraintKind.None;
505var constraint = constraintClauses[i];
516if (!mergeConstraints(originalConstraintTypes, ref originalConstraintTypesMap, ref mergedConstraintTypes, otherPartialConstraints[i]))
525diagnostics.Add(ErrorCode.ERR_PartialWrongConstraints, GetFirstLocation(), this, typeParameters[i]);
535Debug.Assert(originalConstraintTypes[j].Equals(mergedConstraintTypes[j], TypeCompareKind.ObliviousNullableModifierMatchesAny));
582TypeWithAnnotations constraintType1 = mergedConstraintTypes?[index1] ?? originalConstraintTypes[index1];
592TypeWithAnnotations constraintType2 = clause.ConstraintTypes[index2];
632result[constraintTypes[i]] = i; // Use the first type among the duplicates as the source of the nullable information
658var constraint = constraintClauses[i];
665mergeConstraints(ref mergedKind, originalConstraintTypes, otherPartialConstraints[i]);
1582diagnostics.Add(ErrorCode.ERR_ComImportWithoutUuidAttribute, allAttributeSyntaxNodes[index].Name.Location);
1630diagnostics.Add(ErrorCode.WRN_CoClassWithoutComImport, allAttributeSyntaxNodes[index].Location, this.Name);
1639diagnostics.Add(ErrorCode.ERR_DefaultMemberOnIndexedType, allAttributeSyntaxNodes[index].Name.Location);
Utilities\ValueSetFactory.NumericValueSet.cs (20)
42Debug.Assert(tc.Related(LessThanOrEqual, intervals[i].first, intervals[i].last));
46Debug.Assert(tc.Related(LessThan, tc.Next(intervals[i - 1].last), intervals[i].first));
68return _tc.ToConstantValue(this._intervals[this._intervals.Length - 1].last);
81return _intervals.Length > 0 && _tc.Related(relation, _intervals[_intervals.Length - 1].last, value);
96return _tc.Related(GreaterThanOrEqual, value, _intervals[lastIntervalIndex].first) && _tc.Related(LessThanOrEqual, value, _intervals[lastIntervalIndex].last);
99if (_tc.Related(LessThanOrEqual, value, _intervals[midIndex].last))
118return _tc.Related(relation, _intervals[_intervals.Length - 1].last, value);
148builder.Add((_tc.Next(_intervals[i].last), _tc.Prev(_intervals[i + 1].first)));
152if (_tc.Related(LessThan, _intervals[lastIndex].last, _tc.MaxValue))
154builder.Add((_tc.Next(_intervals[lastIndex].last), _tc.MaxValue));
174var leftInterval = left[l];
175var rightInterval = right[r];
251var leftInterval = left[l];
252var rightInterval = right[r];
273var leftInterval = left[l];
280var rightInterval = right[r];
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (9)
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
44var match = matches[i];
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\CSharpUseObjectInitializerCodeFixProvider.cs (1)
65var match = matches[i];
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Features (23)
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
44var match = matches[i];
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\CSharpUseObjectInitializerCodeFixProvider.cs (1)
65var match = matches[i];
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (117)
SourceGeneration\GeneratorDriverTests.cs (57)
1699source => Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason));
1711source => Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason));
1750Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
1751Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
1766Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1767Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
1788Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
1789Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1804Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1805Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1819Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value);
1820Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
1841Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value);
1842Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
1857Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1858Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1872Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value);
1873Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1893Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value);
1894Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1909Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1910Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1924Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value);
1925Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
2010Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
2011Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
2015Assert.Equal(texts[0], ((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value)[0]);
2016Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
2039Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
2040Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
2044Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value);
2045Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
2065var value = ((Compilation, ImmutableArray<AdditionalText>))source.Source.Outputs[source.OutputIndex].Value;
2068Assert.Equal(IncrementalStepRunReason.Unchanged, source.Source.Outputs[source.OutputIndex].Reason);
2091Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value);
2092Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
2096Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value);
2097Assert.Equal(IncrementalStepRunReason.Unchanged, source.Source.Outputs[source.OutputIndex].Reason);
2224AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString());
2367AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString());
2720var consumedInput = input.Source.Outputs[input.OutputIndex];
2736var consumedInput = input.Source.Outputs[input.OutputIndex];
2752var consumedInput = input.Source.Outputs[input.OutputIndex];
2773var consumedInput = input.Source.Outputs[input.OutputIndex];
2789var consumedInput = input.Source.Outputs[input.OutputIndex];
2805var consumedInput = input.Source.Outputs[input.OutputIndex];
2829var consumedInput = input.Source.Outputs[input.OutputIndex];
2845var consumedInput = input.Source.Outputs[input.OutputIndex];
2861var consumedInput = input.Source.Outputs[input.OutputIndex];
2910var consumedInput = input.Source.Outputs[input.OutputIndex];
2927var consumedInput = input.Source.Outputs[input.OutputIndex];
2948var consumedInput = input.Source.Outputs[input.OutputIndex];
2965var consumedInput = input.Source.Outputs[input.OutputIndex];
2990var consumedInput = input.Source.Outputs[input.OutputIndex];
3007var consumedInput = input.Source.Outputs[input.OutputIndex];
3032var consumedInput = input.Source.Outputs[input.OutputIndex];
3049var consumedInput = input.Source.Outputs[input.OutputIndex];
SourceGeneration\StateTableTests.cs (40)
387Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value);
388Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
393Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value);
394Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
399Assert.Equal(3, source.Source.Outputs[source.OutputIndex].Value);
400Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
450Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value);
451Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
456Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value);
457Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
462Assert.Equal(3, source.Source.Outputs[source.OutputIndex].Value);
463Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
497Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value);
498Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
503Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value);
504Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
509Assert.Equal(3, source.Source.Outputs[source.OutputIndex].Value);
510Assert.Equal(IncrementalStepRunReason.Removed, source.Source.Outputs[source.OutputIndex].Reason);
564Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value);
565Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
570Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value);
571Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
576Assert.Equal(4, source.Source.Outputs[source.OutputIndex].Value);
577Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
646Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value);
647Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
681Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value);
682Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
719Assert.Equal(value, source.Source.Outputs[source.OutputIndex].Value);
720Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
758Assert.Equal(value, source.Source.Outputs[source.OutputIndex].Value);
759Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
881Assert.Equal(IncrementalStepRunReason.Cached, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason);
887Assert.Equal(IncrementalStepRunReason.Removed, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason);
893Assert.Equal(IncrementalStepRunReason.Removed, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason);
899Assert.Equal(IncrementalStepRunReason.New, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason);
905Assert.Equal(IncrementalStepRunReason.New, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason);
911Assert.Equal(IncrementalStepRunReason.New, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason);
988Assert.Equal(IncrementalStepRunReason.Modified, input.Source.Outputs[input.OutputIndex].Reason);
1017Assert.Equal(IncrementalStepRunReason.Modified, input.Source.Outputs[input.OutputIndex].Reason);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (19)
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Microsoft.CodeAnalysis.Debugging.Package (9)
Microsoft.CodeAnalysis.EditorFeatures (6)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (5)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (4)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
Microsoft.CodeAnalysis.Features (153)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (10)
804var oldStatementSpan = oldActiveStatements[i].UnmappedSpan;
831if (TryGetTrackedStatement(newActiveStatementSpans, oldActiveStatements[i].Statement.Id, newText, newBody, out var trackedStatement, out var trackedStatementPart))
861var ancestors = GetExceptionHandlingAncestors(newStatement, newBody.EncompassingAncestor, oldActiveStatements[i].Statement.IsNonLeaf);
870newActiveStatements[i] = GetActiveStatementWithSpan(oldActiveStatements[i], newBody.SyntaxTree, newStatementSpan, diagnostics, cancellationToken);
881newActiveStatements[i] = oldActiveStatements[i].Statement.WithSpan(default);
4604var newAttribute = newAttributes[i];
6017index.Add(array[i].Key, i);
6172var oldCapture = oldCaptures[oldCaptureIndex];
6191var newCapture = newCaptures[newCaptureIndex];
6223var oldCapture = oldCaptures[oldCaptureIndex];
Microsoft.CodeAnalysis.Features.Test.Utilities (9)
Microsoft.CodeAnalysis.InteractiveHost (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (19)
Microsoft.CodeAnalysis.PooledObjects.Package (1)
Microsoft.CodeAnalysis.Scripting (5)
Microsoft.CodeAnalysis.Test.Utilities (47)
Compilation\ControlFlowGraphVerifier.cs (22)
94Assert.Equal(graph.Blocks[i].IsReachable, reachabilityVector[i]);
124var block = blocks[i];
192var predecessorBranch = predecessors[predecessorIndex];
197Assert.Same(blocks[predecessor.Ordinal], predecessor);
211if (predecessorIndex < predecessors.Length - 1 && predecessors[predecessorIndex + 1].Source == predecessor)
216predecessorBranch = predecessors[predecessorIndex];
251Assert.Same(blocks[conditionalBranch.Destination.Ordinal], conditionalBranch.Destination);
290Assert.Same(blocks[nextBranch.Destination.Ordinal], nextBranch.Destination);
389BasicBlock block = blocks[i];
412var operation = block.Operations[j];
436if (blocks[i + 1].Predecessors.IsEmpty)
438adjustAndGetEntryState(entryStates, blocks[i + 1], currentState);
488lastOperation = blocks[i].BranchValue ?? blocks[i].Operations.LastOrDefault();
739adjustAndGetEntryState(entryStates, blocks[region.EnclosingRegion.NestedRegions[1].FirstBlockOrdinal], state);
748adjustAndGetEntryState(entryStates, blocks[@finally.FirstBlockOrdinal], state);
1308for (var j = blocks[i].Operations.Length - 1; j >= 0; j--)
1310if (blocks[i].Operations[j] is IFlowCaptureOperation capture)
1323BasicBlock block = blocks[i];
1518var method = region.LocalFunctions[i];
1607ControlFlowRegion r = branch.EnteringRegions[j];
Microsoft.CodeAnalysis.UnitTests (5)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (24)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (24)
1849Assert.True(syntax.SpanStart = tpSymbol1.Locations.Item(0).SourceSpan.Start OrElse
1850syntax.SpanStart = tpSymbol1.Locations.Item(1).SourceSpan.Start,
1858Assert.True(syntax.SpanStart = tpSymbol2.Locations.Item(0).SourceSpan.Start OrElse
1859syntax.SpanStart = tpSymbol2.Locations.Item(1).SourceSpan.Start,
1867Assert.True(syntax.SpanStart = tpSymbol3.Locations.Item(0).SourceSpan.Start OrElse
1868syntax.SpanStart = tpSymbol3.Locations.Item(1).SourceSpan.Start,
1876Assert.True(syntax.SpanStart = tpSymbol4.Locations.Item(0).SourceSpan.Start OrElse
1877syntax.SpanStart = tpSymbol4.Locations.Item(1).SourceSpan.Start,
2022Assert.True(syntax.SpanStart = varSymbol1.Locations.Item(0).SourceSpan.Start OrElse
2023syntax.SpanStart = varSymbol1.Locations.Item(1).SourceSpan.Start,
2032Assert.True(syntax.SpanStart = varSymbol2.Locations.Item(0).SourceSpan.Start OrElse
2033syntax.SpanStart = varSymbol2.Locations.Item(1).SourceSpan.Start,
2042Assert.True(syntax.SpanStart = varSymbol3.Locations.Item(0).SourceSpan.Start OrElse
2043syntax.SpanStart = varSymbol3.Locations.Item(1).SourceSpan.Start,
2052Assert.True(syntax.SpanStart = varSymbol4.Locations.Item(0).SourceSpan.Start OrElse
2053syntax.SpanStart = varSymbol4.Locations.Item(1).SourceSpan.Start,
2062Assert.True(syntax.SpanStart = varSymbol5.Locations.Item(0).SourceSpan.Start OrElse
2063syntax.SpanStart = varSymbol5.Locations.Item(1).SourceSpan.Start,
2072Assert.True(syntax.SpanStart = varSymbol6.Locations.Item(0).SourceSpan.Start OrElse
2073syntax.SpanStart = varSymbol6.Locations.Item(1).SourceSpan.Start,
2083Assert.True(syntax.SpanStart = varSymbol7.Locations.Item(0).SourceSpan.Start OrElse
2084syntax.SpanStart = varSymbol7.Locations.Item(1).SourceSpan.Start,
2093Assert.True(syntax.SpanStart = varSymbol8.Locations.Item(0).SourceSpan.Start OrElse
2094syntax.SpanStart = varSymbol8.Locations.Item(1).SourceSpan.Start,
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces (142)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg));
359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
438builder[i] = map(self[i], other[i]);
456builder.Add(map(self[i], other[i], i, arg));
489var a = array[i];
523builder.Add(array[j]);
551var a = array[i];
567var a = array[i];
583var a = array[i];
599var a = array[i];
615var a = array[i];
1048if (predicate(items[i]))
1070sum += selector(items[i], i);
1215if (!predicate(array1[i], array2[i], arg))
1233if (comparer.Compare(array[i - 1], array[i]) > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
38result.Add(array[i]);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (25)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg));
359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
438builder[i] = map(self[i], other[i]);
456builder.Add(map(self[i], other[i], i, arg));
489var a = array[i];
523builder.Add(array[j]);
551var a = array[i];
567var a = array[i];
583var a = array[i];
599var a = array[i];
615var a = array[i];
1048if (predicate(items[i]))
1070sum += selector(items[i], i);
1215if (!predicate(array1[i], array2[i], arg))
1233if (comparer.Compare(array[i - 1], array[i]) > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
38result.Add(array[i]);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.DotNet.SignTool (3)
Microsoft.Extensions.Options.SourceGeneration (7)
Microsoft.Gen.Logging (1)
Microsoft.Interop.ComInterfaceGenerator (11)
Microsoft.Interop.LibraryImportGenerator (6)
Microsoft.Interop.SourceGeneration (13)
Microsoft.ML.Data (34)
Microsoft.ML.DataView (4)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.ML.OnnxConverter (1)
Microsoft.ML.Samples (2)
Microsoft.ML.Tests (9)
Microsoft.ML.Transforms (41)
Microsoft.ML.Vision (1)
Microsoft.VisualStudio.LanguageServices (11)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Roslyn.Test.PdbUtilities (4)
Roslyn.VisualStudio.Next.UnitTests (4)
SemanticSearch.BuildTask (3)
System.Collections.Immutable (17)
System.Formats.Nrbf (1)
System.Reflection.Metadata (36)
System.Reflection.MetadataLoadContext (18)
System.Text.Json.SourceGeneration (1)
System.Text.RegularExpressions.Generator (5)