2313 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));
430builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
448builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
509builder[i] = map(self[i], other[i]);
527builder.Add(map(self[i], other[i], i, arg));
560var a = array[i];
594builder.Add(array[j]);
622var a = array[i];
638var a = array[i];
654var a = array[i];
670var a = array[i];
686var a = array[i];
1119if (predicate(items[i]))
1141sum += selector(items[i], i);
1286if (!predicate(array1[i], array2[i], arg))
1304if (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 (90)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg));
430builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
448builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
509builder[i] = map(self[i], other[i]);
527builder.Add(map(self[i], other[i], i, arg));
560var a = array[i];
594builder.Add(array[j]);
622var a = array[i];
638var a = array[i];
654var a = array[i];
670var a = array[i];
686var a = array[i];
1119if (predicate(items[i]))
1141sum += selector(items[i], i);
1286if (!predicate(array1[i], array2[i], arg))
1304if (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 (37)
Microsoft.CodeAnalysis.CSharp (824)
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)
2890var argument = tupleArguments[i];
2891var targetElementType = targetElementTypesWithAnnotations[i].Type;
3516arguments[arg] = coerceArgument(in methodResult, receiver, parameters, argumentsForInterpolationConversion: arguments, argument, arg, parameters[paramNum].TypeWithAnnotations, diagnostics);
3638if (parameters[paramsIndex].Type.IsSZArray())
3658BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs, diagnostics);
3712return parameters[paramNum];
3797int handlerParameter = handlerParameterIndexes[handlerParameterIndex];
3830int argumentIndex = handlerArgumentIndexes[i];
3846var originalParameterIndex = handlerParameterIndexes[i];
3847var parameter = parameters[originalParameterIndex];
3866var originalParameterIndex = handlerParameterIndexes[i];
3867var parameter = parameters[originalParameterIndex];
4263BoundExpression boundExpression = boundInitExpr[boundInitExprIndex];
4288init = boundInitExpr[boundInitExprIndex];
4423var size = sizes[i];
6591MethodSymbol constructor = constructors[i];
7591var typeArgument = typeArgumentsWithAnnotations[i];
10902parameterTypes[i],
10903parameterRefKinds.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 (16)
1514delegateParameterRefKind: delegateParameters[p].RefKind,
1525if (!delegateParameters[p].Type.Equals(anonymousFunction.ParameterType(p), TypeCompareKind.AllIgnoreOptions))
1558if (delegateParameters[p].TypeWithAnnotations.IsStatic)
1569if (delegateParameters[p].RefKind == RefKind.Out)
1738UserDefinedConversionAnalysis analysis = result.Results[result.Best];
2344var argument = arguments[i];
2345var result = classifyConversion(this, argument, targetElementTypes[i], isChecked: isChecked, ref useSiteInfo, forCast: forCast);
2418var conversion = classifyConversion(this, sourceTypes[i], destTypes[i], isChecked: isChecked, ref useSiteInfo, forCast);
3396var sourceParam = sourceSig.Parameters[i];
3397var destinationParam = destinationSig.Parameters[i];
3404if (!hasConversion(sourceParam.RefKind, destinationSig.Parameters[i].TypeWithAnnotations, sourceSig.Parameters[i].TypeWithAnnotations, ref useSiteInfo))
3686var sourceArg = sourceTypeArguments[i].Type;
3687var destinationArg = destinationTypeArguments[i].Type;
3689switch (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)
2870var parameter = methodParameters[i];
2873var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations;
4564var argument = arguments[i];
4594var currentDeclaration = node.Declarations[currentDeclarationIndex];
4803BoundExpression placeholder = placeholders[i];
6587var comparand = compareExchangeInfo.Arguments[comparandIndex];
6588var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State;
6595var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State;
6918var argumentNoConversion = argumentsNoConversions[i];
6919var argument = i < arguments.Length ? arguments[i] : argumentNoConversion;
6953conversions.IsDefault || i >= conversions.Length ? Conversion.Identity : conversions[i],
6958results[i],
6964if (results[i].RValueType.IsNotNull || isExpandedParamsArgument)
7001arguments[i],
7006results[i],
7017var argument = arguments[i];
7018var result = results[i];
7019var argumentNoConversion = argumentsNoConversions[i];
7066BoundExpression argument = arguments[a];
7303resultsBuilder.Add(VisitArgumentEvaluate(arguments[i], GetRefKind(refKindsOpt, i), parameterAnnotationsOpt.IsDefault ? default : parameterAnnotationsOpt[i]));
7809var argument = arguments[i];
7998var visitArgumentResult = argumentResults[i];
7999builder.Add(getArgumentForMethodTypeInference(arguments[i], visitArgumentResult));
8027if (collection.Elements[i] is BoundExpression elementExpression)
8034elementsBuilder.Add(collection.Elements[i]);
8543trackState(values[argOrdinal], tupleElements[i], types[argOrdinal]);
8550trackState(values[argOrdinal], restField, types[argOrdinal]);
8609trackConvertedValue(targetElements[i], conversions[i], valueElements[i]);
10245placeholderArgs.Add(new BoundExpressionWithNullability(variables[i].Expression.Syntax, variables[i].Expression, NullableAnnotation.Oblivious, conversion.DeconstructionInfo.OutputPlaceholders[i].Type));
10271var parameter = parameters[i + offset];
10272var (placeholder, placeholderConversion) = conversion.DeconstructConversionInfo[i];
10277var nestedRight = CreatePlaceholderIfNecessary(invocation.Arguments[i + offset], parameter.TypeWithAnnotations);
10291var parameter = parameters[i + offset];
10313var (placeholder, placeholderConversion) = deconstructConversionInfo[i];
10315var 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))
2165var refKind1 = method1.Parameters[i].RefKind;
2166var refKind2 = method2.Parameters[i].RefKind;
2579if (!op1.ParameterTypesWithAnnotations[p].Equals(op2.ParameterTypesWithAnnotations[p], TypeCompareKind.AllIgnoreOptions))
3023Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
3028Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0);
3031if (initializers[i].Length != 1)
3033Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
3103if (LexicalSortKey.Compare(sortKey, new LexicalSortKey(declaredMembers.InstanceInitializers[insertAt][0].Syntax, compilation)) < 0)
3112declaredMembers.DeclarationWithParameters.SyntaxTree == declaredMembers.InstanceInitializers[insertAt][0].Syntax.SyntaxTree &&
3113declaredMembers.DeclarationWithParameters.Span.Contains(declaredMembers.InstanceInitializers[insertAt][0].Syntax.Span.Start))
3116var declaredInitializers = declaredMembers.InstanceInitializers[insertAt];
4034var methodParam = methodParams[i];
4040var propertyParamType = (((i == numParams - 1) && !getNotSet) ? propertySymbol.TypeWithAnnotations : propertyParams[i].TypeWithAnnotations).Type;
Symbols\Source\SourceNamedTypeSymbol.cs (14)
269return (constraintTypes.Length > 0) ? constraintTypes[ordinal] : ImmutableArray<TypeWithAnnotations>.Empty;
298return (constraintKinds.Length > 0) ? constraintKinds[ordinal] : TypeParameterConstraintKind.None;
506var constraint = constraintClauses[i];
517if (!mergeConstraints(originalConstraintTypes, ref originalConstraintTypesMap, ref mergedConstraintTypes, otherPartialConstraints[i]))
526diagnostics.Add(ErrorCode.ERR_PartialWrongConstraints, GetFirstLocation(), this, typeParameters[i]);
536Debug.Assert(originalConstraintTypes[j].Equals(mergedConstraintTypes[j], TypeCompareKind.ObliviousNullableModifierMatchesAny));
583TypeWithAnnotations constraintType1 = mergedConstraintTypes?[index1] ?? originalConstraintTypes[index1];
593TypeWithAnnotations constraintType2 = clause.ConstraintTypes[index2];
633result[constraintTypes[i]] = i; // Use the first type among the duplicates as the source of the nullable information
659var constraint = constraintClauses[i];
666mergeConstraints(ref mergedKind, originalConstraintTypes, otherPartialConstraints[i]);
1598diagnostics.Add(ErrorCode.ERR_ComImportWithoutUuidAttribute, allAttributeSyntaxNodes[index].Name.Location);
1646diagnostics.Add(ErrorCode.WRN_CoClassWithoutComImport, allAttributeSyntaxNodes[index].Location, this.Name);
1655diagnostics.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 (13)
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
44var match = matches[i];
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\CSharpUseObjectInitializerCodeFixProvider.cs (1)
82var match = matches[i];
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (25)
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
44var match = matches[i];
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\CSharpUseObjectInitializerCodeFixProvider.cs (1)
82var match = matches[i];
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (117)
SourceGeneration\GeneratorDriverTests.cs (57)
1747source => Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason));
1759source => Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason));
1798Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
1799Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
1814Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1815Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
1836Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
1837Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1852Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1853Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1867Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value);
1868Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
1889Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value);
1890Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
1905Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1906Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1920Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value);
1921Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1941Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value);
1942Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1957Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value);
1958Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
1972Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value);
1973Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
2058Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
2059Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
2063Assert.Equal(texts[0], ((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value)[0]);
2064Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason);
2087Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value);
2088Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason);
2092Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value);
2093Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
2113var value = ((Compilation, ImmutableArray<AdditionalText>))source.Source.Outputs[source.OutputIndex].Value;
2116Assert.Equal(IncrementalStepRunReason.Unchanged, source.Source.Outputs[source.OutputIndex].Reason);
2139Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value);
2140Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason);
2144Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value);
2145Assert.Equal(IncrementalStepRunReason.Unchanged, source.Source.Outputs[source.OutputIndex].Reason);
2272AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString());
2415AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString());
2850var consumedInput = input.Source.Outputs[input.OutputIndex];
2866var consumedInput = input.Source.Outputs[input.OutputIndex];
2882var consumedInput = input.Source.Outputs[input.OutputIndex];
2903var consumedInput = input.Source.Outputs[input.OutputIndex];
2919var consumedInput = input.Source.Outputs[input.OutputIndex];
2935var consumedInput = input.Source.Outputs[input.OutputIndex];
2959var consumedInput = input.Source.Outputs[input.OutputIndex];
2975var consumedInput = input.Source.Outputs[input.OutputIndex];
2991var consumedInput = input.Source.Outputs[input.OutputIndex];
3040var consumedInput = input.Source.Outputs[input.OutputIndex];
3057var consumedInput = input.Source.Outputs[input.OutputIndex];
3078var consumedInput = input.Source.Outputs[input.OutputIndex];
3095var consumedInput = input.Source.Outputs[input.OutputIndex];
3120var consumedInput = input.Source.Outputs[input.OutputIndex];
3137var consumedInput = input.Source.Outputs[input.OutputIndex];
3162var consumedInput = input.Source.Outputs[input.OutputIndex];
3179var 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 (12)
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 (149)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (10)
797var oldStatementSpan = oldActiveStatements[i].UnmappedSpan;
824if (TryGetTrackedStatement(newActiveStatementSpans, oldActiveStatements[i].Statement.Id, newText, newBody, out var trackedStatement, out var trackedStatementPart))
854var ancestors = GetExceptionHandlingAncestors(newStatement, newBody.EncompassingAncestor, oldActiveStatements[i].Statement.IsNonLeaf);
863newActiveStatements[i] = GetActiveStatementWithSpan(oldActiveStatements[i], newBody.SyntaxTree, newStatementSpan, diagnostics, cancellationToken);
874newActiveStatements[i] = oldActiveStatements[i].Statement.WithSpan(default);
4597var newAttribute = newAttributes[i];
6010index.Add(array[i].Key, i);
6165var oldCapture = oldCaptures[oldCaptureIndex];
6184var newCapture = newCaptures[newCaptureIndex];
6216var oldCapture = oldCaptures[oldCaptureIndex];
Microsoft.CodeAnalysis.Features.Test.Utilities (9)
Microsoft.CodeAnalysis.InteractiveHost (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (18)
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 (149)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg));
430builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
448builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
509builder[i] = map(self[i], other[i]);
527builder.Add(map(self[i], other[i], i, arg));
560var a = array[i];
594builder.Add(array[j]);
622var a = array[i];
638var a = array[i];
654var a = array[i];
670var a = array[i];
686var a = array[i];
1119if (predicate(items[i]))
1141sum += selector(items[i], i);
1286if (!predicate(array1[i], array2[i], arg))
1304if (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));
430builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false);
448builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false);
509builder[i] = map(self[i], other[i]);
527builder.Add(map(self[i], other[i], i, arg));
560var a = array[i];
594builder.Add(array[j]);
622var a = array[i];
638var a = array[i];
654var a = array[i];
670var a = array[i];
686var a = array[i];
1119if (predicate(items[i]))
1141sum += selector(items[i], i);
1286if (!predicate(array1[i], array2[i], arg))
1304if (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.Private.Windows.Core (3)
System.Reflection.Metadata (36)
System.Reflection.MetadataLoadContext (18)
System.Text.Json.SourceGeneration (1)
System.Text.RegularExpressions.Generator (5)