266 references to Add
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
310.Add(LanguageNames.CSharp, csharpAnalyzers) 311.Add(LanguageNames.VisualBasic, basicAnalyzers);
Microsoft.Build.Engine.UnitTests (1)
Graph\GraphTestingUtilities.cs (1)
126.Add(InnerBuildPropertyName, innerBuildPropertyValue)
Microsoft.CodeAnalysis (5)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (2)
17private static readonly ImmutableDictionary<string, string?> s_syntactic = ImmutableDictionary<string, string?>.Empty.Add(Origin, Syntactic); 18private static readonly ImmutableDictionary<string, string?> s_declaration = ImmutableDictionary<string, string?>.Empty.Add(Origin, Declaration);
InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (1)
44return new ImmutableSetWithInsertionOrder<T>(_map.Add(value, _nextElementValue), _nextElementValue + 1u);
ReferenceManager\CommonReferenceManager.Binding.cs (2)
315implicitReferenceResolutions = implicitReferenceResolutions.Add(assemblyIdentity, null); 570implicitReferenceResolutions = implicitReferenceResolutions.Add(referenceIdentity, resolvedReference);
Microsoft.CodeAnalysis.CodeStyle (35)
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
15protected static readonly ImmutableDictionary<string, string?> ModifiersAddedProperties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (2)
39properties = properties.Add(AddRequiredParenthesesConstants.IncludeInFixAll, ""); 42properties = properties.Add(AddRequiredParenthesesConstants.EquivalenceKey, equivalenceKey);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
27ImmutableDictionary<string, string?>.Empty.Add(ForEachCastHelpers.IsFixable, ForEachCastHelpers.IsFixable);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (2)
120.Add(WellKnownDiagnosticTags.Unnecessary, Enumerable.Range(additionalLocations.Length, additionalUnnecessaryLocations.Length)); 191.Add(WellKnownDiagnosticTags.Unnecessary, Enumerable.Range(additionalLocations.Length, additionalUnnecessaryLocations.Length));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
88properties: ImmutableDictionary<string, string?>.Empty.Add(MatchFolderAndNamespaceConstants.TargetNamespace, targetNamespace),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
72.Add(PopulateSwitchStatementHelpers.MissingCases, missingCases.ToString()) 73.Add(PopulateSwitchStatementHelpers.MissingDefaultCase, missingDefaultCase.ToString());
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
109properties = properties.Add(DocCommentIdKey, "~" + docCommentId);
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (11)
29= s_takeCondition.Add(Negate, Negate); 31= s_takeCondition.Add(Or, Or).Add(WhenFalse, WhenFalse); 33= s_negateCondition.Add(And, And).Add(WhenFalse, WhenFalse); 35= s_negateCondition.Add(Or, Or).Add(WhenTrue, WhenTrue); 37= s_takeCondition.Add(And, And).Add(WhenTrue, WhenTrue); 39= s_takeCondition.Add(And, And).Add(WhenFalse, WhenFalse);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
655properties = properties.Add(IsTrivialGetAccessor, IsTrivialGetAccessor); 658properties = properties.Add(IsTrivialSetAccessor, IsTrivialSetAccessor);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
187properties = properties.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
20ImmutableDictionary<string, string?>.Empty.Add(UseCollectionExpressionName, UseCollectionExpressionName);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (2)
165.Add(UseCompoundAssignmentUtilities.Increment, UseCompoundAssignmentUtilities.Increment))); 185.Add(UseCompoundAssignmentUtilities.Decrement, UseCompoundAssignmentUtilities.Decrement)));
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
17ImmutableDictionary<string, string?>.Empty.Add(CanSimplifyName, CanSimplifyName);
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
61var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (3)
107var properties = ImmutableDictionary<string, string?>.Empty.Add( 128properties = properties.Add(UseIsNullConstants.UnconstrainedGeneric, ""); 137properties = properties.Add(UseIsNullConstants.Negated, "");
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
53ImmutableDictionary<string, string?>.Empty.Add(UseNullPropagationConstants.WhenPartIsNullable, "");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (2)
80_forwardMap.Add(key, value), 81_backwardMap.Add(value, key));
Microsoft.CodeAnalysis.CSharp.CodeStyle (15)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (2)
76.Add(Constants.NodeToGenerateKey, ((int)nodeToGenerate).ToString(CultureInfo.InvariantCulture)) 77.Add(Constants.ShouldRemoveNextStatementKey, shouldRemoveNextStatement.ToString(CultureInfo.InvariantCulture))));
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
175var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
22private static readonly ImmutableDictionary<string, string?> s_subsequentSectionProperties = ImmutableDictionary<string, string?>.Empty.Add(IsSubsequentSection, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (1)
22ImmutableDictionary<string, string?>.Empty.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
1213properties = properties.Add(UnwrapArgument, ""); 1216properties = properties.Add(UseSpread, ""); 1219properties = properties.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
105var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(UseExpressionBody), ""); 121properties = properties.Add(FixesError, "");
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
19ImmutableDictionary<string, string?>.Empty.Add(UseIsNullConstants.Kind, UseIsNullConstants.CastAndEqualityKey); 21s_properties.Add(UseIsNullConstants.Negated, "");
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
112ImmutableDictionary<string, string?>.Empty.Add(NameKey, stringValue)));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
28private static readonly ImmutableDictionary<string, string?> s_safeProperties = ImmutableDictionary<string, string?>.Empty.Add(SafeKey, "");
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
144var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(ArrayCreationOperationLocation), operationLocation.ToString());
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Completion\CompletionServiceTests.cs (1)
114var options = new TestOptionSet(ImmutableDictionary<OptionKey, object>.Empty.Add(new OptionKey(ThirdPartyOption.Instance, LanguageNames.CSharp), 1));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (15)
Attributes\AttributeTests_WellKnownAttributes.cs (6)
8807verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Warn)), 8813verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Error)), 8819verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Hidden)), 8825verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("TEST1", ReportDiagnostic.Suppress))); 8828verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS0618", ReportDiagnostic.Error)), 8834verify(TestOptions.DebugDll.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS0618", ReportDiagnostic.Suppress)),
Diagnostics\DiagnosticAnalyzerTests.cs (5)
1508var analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "true")); 1516analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "TRUE")); 1522analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "false")); 1528analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("generated_code", "auto")); 4195.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(AnalyzerWithDisabledRules.Rule.Id, ReportDiagnostic.Warn))
Diagnostics\DiagnosticSuppressorTests.cs (2)
313var specificDiagnosticOptions = compilation.Options.SpecificDiagnosticOptions.Add(suppressionId, ReportDiagnostic.Suppress); 359var specificDiagnosticOptions = originalSpecificDiagnosticOptions.Add(
Diagnostics\GetDiagnosticsTests.cs (2)
558var analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("dotnet_analyzer_diagnostic.severity", "none")); 604var analyzerConfigOptions = new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add(options.Value.key, options.Value.value));
Microsoft.CodeAnalysis.CSharp.Features (15)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (2)
76.Add(Constants.NodeToGenerateKey, ((int)nodeToGenerate).ToString(CultureInfo.InvariantCulture)) 77.Add(Constants.ShouldRemoveNextStatementKey, shouldRemoveNextStatement.ToString(CultureInfo.InvariantCulture))));
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
175var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
22private static readonly ImmutableDictionary<string, string?> s_subsequentSectionProperties = ImmutableDictionary<string, string?>.Empty.Add(IsSubsequentSection, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\AbstractCSharpUseCollectionExpressionDiagnosticAnalyzer.cs (1)
22ImmutableDictionary<string, string?>.Empty.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
1213properties = properties.Add(UnwrapArgument, ""); 1216properties = properties.Add(UseSpread, ""); 1219properties = properties.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
105var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(UseExpressionBody), ""); 121properties = properties.Add(FixesError, "");
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (2)
19ImmutableDictionary<string, string?>.Empty.Add(UseIsNullConstants.Kind, UseIsNullConstants.CastAndEqualityKey); 21s_properties.Add(UseIsNullConstants.Negated, "");
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
112ImmutableDictionary<string, string?>.Empty.Add(NameKey, stringValue)));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
28private static readonly ImmutableDictionary<string, string?> s_safeProperties = ImmutableDictionary<string, string?>.Empty.Add(SafeKey, "");
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
144var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(ArrayCreationOperationLocation), operationLocation.ToString());
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
1064.Add(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, ReportDiagnostic.Suppress));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\InitOnlyMemberTests.cs (2)
3469ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS1685", ReportDiagnostic.Suppress))); 3568ImmutableDictionary<string, ReportDiagnostic>.Empty.Add("CS1685", ReportDiagnostic.Suppress)));
SourceGeneration\GeneratorDriverTests.cs (2)
855var options = new CompilerAnalyzerConfigOptionsProvider(ImmutableDictionary<object, AnalyzerConfigOptions>.Empty, new DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string>.Empty.Add("a", "abc").Add("b", "def")));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\UsedAssembliesTests.cs (1)
295options = options.WithSpecificDiagnosticOptions(options.SpecificDiagnosticOptions.Add("CS1591", ReportDiagnostic.Suppress));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
TestOptions.cs (3)
174return options.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(key, value)); 179return options.WithSpecificDiagnosticOptions(ImmutableDictionary<string, ReportDiagnostic>.Empty.Add(key1, value).Add(key2, value));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Classification\FormattedClassification.cs (4)
17.Add("regex - ", "Regex.") 18.Add("json - ", "Json.") 19.Add("xml doc comment - ", "XmlDoc.") 20.Add("xml literal - ", "VBXml");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (17)
Collections\Immutable\Maps\MapTests.cs (16)
21var map = ImmutableDictionary.Create<string, int>().Add("1", 1); 39.Add("1", 1) 40.Add("2", 2) 41.Add("3", 3) 42.Add("4", 4) 43.Add("5", 5); 54.Add("1", 1) 55.Add("2", 2) 56.Add("3", 3) 57.Add("4", 4) 58.Add("5", 5); 86.Add("1", 1) 87.Add("2", 2) 88.Add("3", 3) 89.Add("4", 4) 90.Add("5", 5);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
341var newSpecificOptions = project.CompilationOptions.SpecificDiagnosticOptions.Add(NamedTypeAnalyzer.DiagnosticId, ReportDiagnostic.Warn);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticProviderTests.vb (1)
283Dim compilerAnalyzersMap = DiagnosticExtensions.GetCompilerDiagnosticAnalyzersMap().Add(
Microsoft.CodeAnalysis.Features (42)
EditAndContinue\DeclarationBodyMap.cs (1)
40=> new(Forward, Reverse, AdditionalReverseMapping.Add(newNode, oldNode));
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionAnalyzer.cs (1)
26ImmutableDictionary<string, string?>.Empty.Add(StrictKey, "");
FindUsages\DefinitionItem.cs (1)
263properties = properties.Add(NonNavigable, "");
FindUsages\DefinitionItemFactory.cs (5)
149.Add(DefinitionItem.MetadataSymbolKey, SymbolKey.CreateString(symbol)) 150.Add(DefinitionItem.MetadataSymbolOriginatingProjectIdGuid, originatingProjectId.Id.ToString()) 260properties = properties.Add(DefinitionItem.Primary, ""); 266properties = properties.Add(DefinitionItem.RQNameKey1, rqName); 276properties = properties.Add(DefinitionItem.RQNameKey2, rqName);
PreferFrameworkType\PreferFrameworkTypeConstants.cs (1)
15ImmutableDictionary<string, string>.Empty.Add(PreferFrameworkType, "");
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
15protected static readonly ImmutableDictionary<string, string?> ModifiersAddedProperties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (2)
39properties = properties.Add(AddRequiredParenthesesConstants.IncludeInFixAll, ""); 42properties = properties.Add(AddRequiredParenthesesConstants.EquivalenceKey, equivalenceKey);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
27ImmutableDictionary<string, string?>.Empty.Add(ForEachCastHelpers.IsFixable, ForEachCastHelpers.IsFixable);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (2)
120.Add(WellKnownDiagnosticTags.Unnecessary, Enumerable.Range(additionalLocations.Length, additionalUnnecessaryLocations.Length)); 191.Add(WellKnownDiagnosticTags.Unnecessary, Enumerable.Range(additionalLocations.Length, additionalUnnecessaryLocations.Length));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
88properties: ImmutableDictionary<string, string?>.Empty.Add(MatchFolderAndNamespaceConstants.TargetNamespace, targetNamespace),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
72.Add(PopulateSwitchStatementHelpers.MissingCases, missingCases.ToString()) 73.Add(PopulateSwitchStatementHelpers.MissingDefaultCase, missingDefaultCase.ToString());
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
109properties = properties.Add(DocCommentIdKey, "~" + docCommentId);
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (11)
29= s_takeCondition.Add(Negate, Negate); 31= s_takeCondition.Add(Or, Or).Add(WhenFalse, WhenFalse); 33= s_negateCondition.Add(And, And).Add(WhenFalse, WhenFalse); 35= s_negateCondition.Add(Or, Or).Add(WhenTrue, WhenTrue); 37= s_takeCondition.Add(And, And).Add(WhenTrue, WhenTrue); 39= s_takeCondition.Add(And, And).Add(WhenFalse, WhenFalse);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (2)
655properties = properties.Add(IsTrivialGetAccessor, IsTrivialGetAccessor); 658properties = properties.Add(IsTrivialSetAccessor, IsTrivialSetAccessor);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
187properties = properties.Add(UseCollectionInitializerHelpers.ChangesSemanticsName, "");
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
20ImmutableDictionary<string, string?>.Empty.Add(UseCollectionExpressionName, UseCollectionExpressionName);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (2)
165.Add(UseCompoundAssignmentUtilities.Increment, UseCompoundAssignmentUtilities.Increment))); 185.Add(UseCompoundAssignmentUtilities.Decrement, UseCompoundAssignmentUtilities.Decrement)));
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
17ImmutableDictionary<string, string?>.Empty.Add(CanSimplifyName, CanSimplifyName);
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (1)
61var properties = ImmutableDictionary<string, string?>.Empty.Add(
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (3)
107var properties = ImmutableDictionary<string, string?>.Empty.Add( 128properties = properties.Add(UseIsNullConstants.UnconstrainedGeneric, ""); 137properties = properties.Add(UseIsNullConstants.Negated, "");
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
53ImmutableDictionary<string, string?>.Empty.Add(UseNullPropagationConstants.WhenPartIsNullable, "");
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\LanguageServerProjectSystem.cs (1)
87: ImmutableDictionary<string, string>.Empty.Add("RazorDesignTimeTargets", razorDesignTimePath);
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (2)
43.Add(LanguageNames.CSharp, "csharp") 44.Add(LanguageNames.VisualBasic, "visual_basic");
Handler\Diagnostics\DiagnosticSources\TaskListDiagnosticSource.cs (3)
23private static readonly ImmutableDictionary<string, string?> s_lowPriorityProperties = ImmutableDictionary<string, string?>.Empty.Add(Priority, Low); 24private static readonly ImmutableDictionary<string, string?> s_mediumPriorityProperties = ImmutableDictionary<string, string?>.Empty.Add(Priority, Medium); 25private static readonly ImmutableDictionary<string, string?> s_highPriorityProperties = ImmutableDictionary<string, string?>.Empty.Add(Priority, High);
Workspaces\LspWorkspaceManager.cs (1)
160_trackedDocuments = _trackedDocuments.Add(uri, (documentText, languageId));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
118=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Diagnostics\NonLocalDiagnosticTests.cs (1)
71=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
67=> new(ImmutableDictionary<string, ImmutableArray<DiagnosticAnalyzer>>.Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(
Microsoft.CodeAnalysis.Scripting.UnitTests (1)
RuntimeMetadataReferenceResolverTests.cs (1)
32packageResolver: new PackageResolver(ImmutableDictionary<string, ImmutableArray<string>>.Empty.Add("nuget:N/1.0", ImmutableArray.Create(assembly1.Path, assembly2.Path))),
Microsoft.CodeAnalysis.VisualBasic (3)
Compilation\VisualBasicCompilation.vb (3)
962ordinalMap = ordinalMap.Add(tree, oldTreeCount + i) 1039ordinalMap = ordinalMap.Add(tree, i) 1123ordinalMap = ordinalMap.Add(newTree, oldOrdinal)
Microsoft.CodeAnalysis.Workspaces (10)
Diagnostics\DiagnosticData.cs (1)
97= ImmutableDictionary<string, string>.Empty.Add(WellKnownDiagnosticPropertyNames.Origin, WellKnownDiagnosticTags.Build);
Diagnostics\HostDiagnosticAnalyzers.cs (2)
293current = current.Add(referenceIdentity, analyzers.Where(seen.Add).ToImmutableArray()); 315box.Value = box.Value.Add(project.Language, info);
Options\GlobalOptionService.cs (1)
172currentValues = currentValues.Add(optionKey, value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (2)
80_forwardMap.Add(key, value), 81_backwardMap.Add(value, key));
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
372ProjectReferenceInfos = projectUpdateState.ProjectReferenceInfos.Add(projectId, projectReference)
Workspace\Solution\ProjectDependencyGraph.cs (2)
273_transitiveReferencesMap = _transitiveReferencesMap.Add(projectId, transitiveReferences); 326_reverseTransitiveReferencesMap = _reverseTransitiveReferencesMap.Add(projectId, reverseTransitiveReferences);
Workspace\Workspace.cs (1)
436newFallbackOptions = newFallbackOptions.Add(language, provider.GetOptions(language));
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\ImmutableSetWithInsertionOrder`1.cs (1)
44return new ImmutableSetWithInsertionOrder<T>(_map.Add(value, _nextElementValue), _nextElementValue + 1u);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Remote\TestSerializerService.cs (5)
35.Add(TestBase.MscorlibRef_v46, nameof(TestBase.MscorlibRef_v46)) 36.Add(TestBase.SystemRef_v46, nameof(TestBase.SystemRef_v46)) 37.Add(TestBase.SystemCoreRef_v46, nameof(TestBase.SystemCoreRef_v46)) 38.Add(TestBase.ValueTupleRef, nameof(TestBase.ValueTupleRef)) 39.Add(TestBase.SystemRuntimeFacadeRef, nameof(TestBase.SystemRuntimeFacadeRef));
Microsoft.CodeAnalysis.Workspaces.UnitTests (39)
Formatter\FormatterTests.cs (4)
86Add(new OptionKey(FormattingOptions.UseTabs, NoCompilationConstants.LanguageName), true). 87Add(new OptionKey(FormattingOptions.TabSize, NoCompilationConstants.LanguageName), 5). 88Add(new OptionKey(FormattingOptions.IndentationSize, NoCompilationConstants.LanguageName), 6). 89Add(new OptionKey(FormattingOptions.NewLine, NoCompilationConstants.LanguageName), "\r")) : null;
Options\DocumentOptionSetTests.cs (5)
26new DictionaryAnalyzerConfigOptions(ImmutableDictionary.Create<string, string>(AnalyzerConfigOptions.KeyComparer).Add( 123.Add(new OptionKey(CSharpFormattingOptions.NewLinesForBracesInTypes), false) 124.Add(new OptionKey(CSharpFormattingOptions.NewLinesForBracesInAccessors), true) 125.Add(new OptionKey(CSharpFormattingOptions.NewLinesForBracesInAnonymousMethods), false)); 128ImmutableDictionary.Create<string, string>(AnalyzerConfigOptions.KeyComparer).Add(
SolutionTests\SolutionTests.cs (4)
2291.Add("optionA", "fallbackA") 2292.Add("optionB", "fallbackB"))))); 2298.Add("optionA", "fallbackX") 2299.Add("optionB", "fallbackY")))));
UtilityTest\ImmutableDictionaryExtensionsTests.cs (26)
19Assert.False(empty.KeysEqual(empty.Add(1, 1))); 20Assert.False(empty.Add(1, 1).KeysEqual(empty)); 22Assert.True(empty.Add(1, 1).KeysEqual(empty.Add(1, 1))); 23Assert.True(empty.Add(1, 2).KeysEqual(empty.Add(1, 1))); 25Assert.True(empty.Add(2, 0).Add(1, 0).KeysEqual(empty.Add(1, 1).Add(2, 1))); 26Assert.False(empty.Add(2, 0).Add(3, 0).KeysEqual(empty.Add(1, 1).Add(2, 1))); 35Assert.True(emptyIgnoreCase.Add("A", 1).KeysEqual(emptyIgnoreCase.Add("a", 1))); 36Assert.False(emptyIgnoreCase.Add("A", 1).KeysEqual(emptyOrdinal.Add("a", 1))); 37Assert.False(emptyOrdinal.Add("A", 1).KeysEqual(emptyIgnoreCase.Add("a", 1))); 38Assert.False(emptyOrdinal.Add("A", 1).KeysEqual(emptyOrdinal.Add("a", 1))); 40Assert.True(emptyIgnoreCase.Add("A", 1).KeysEqual(emptyOrdinal.Add("A", 1))); 41Assert.True(emptyOrdinal.Add("A", 1).KeysEqual(emptyIgnoreCase.Add("A", 1)));
Microsoft.Interop.ComInterfaceGenerator (2)
ComInterfaceGenerator.cs (1)
347ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddMarshalAsAttribute, "Error"),
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
135var selectedOptions = fix.SelectedOptions.Add(Option.AllowUnsafe, new Option.Bool(true));
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\ConvertToLibraryImportFixer.cs (2)
112selectedOptions.Add(SelectedSuffixOption, new Option.String("A"))); 124selectedOptions.Add(SelectedSuffixOption, new Option.String("W")));
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
135var selectedOptions = fix.SelectedOptions.Add(Option.AllowUnsafe, new Option.Bool(true));
Microsoft.Interop.SourceGeneration (5)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (1)
25ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute, GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute);
Marshalling\BlittableMarshallerResolver.cs (1)
19ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute, GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute);
Marshalling\GeneratorDiagnostic.cs (1)
57DiagnosticProperties.Add(WellKnownDiagnosticTags.Unnecessary, $"[{string.Join(",", Enumerable.Range(0, UnnecessaryDataLocations.Length))}]"),
MarshallingAttributeInfo.cs (1)
143new CustomTypeMarshallers(ImmutableDictionary<MarshalMode, CustomTypeMarshallerData>.Empty.Add(
SafeHandleMarshallingInfoProvider.cs (1)
80.Add(
Microsoft.ML.InternalCodeAnalyzer (2)
NameAnalyzer.cs (2)
36.Add(NameProperty, text).Add(DesiredNameProperty, desired.ToString());
Microsoft.VisualStudio.LanguageServices (7)
ProjectSystem\OpenTextBufferProvider.cs (5)
104_monikerToTextBufferMap = _monikerToTextBufferMap.Add(filePath, textBuffer); 158_monikerToTextBufferMap = _monikerToTextBufferMap.Remove(pszMkDocumentOld).Add(pszMkDocumentNew, textBuffer); 165_monikerToTextBufferMap = _monikerToTextBufferMap.Add(pszMkDocumentNew, textBuffer); 186_monikerToTextBufferMap = _monikerToTextBufferMap.Add(moniker, buffer); 215_monikerToTextBufferMap = _monikerToTextBufferMap.Add(moniker, buffer);
ProjectSystem\VisualStudioWorkspaceImpl.cs (2)
236_projectToHierarchyMap = _projectToHierarchyMap.Add(project.Id, hierarchy); 237_projectToGuidMap = _projectToGuidMap.Add(project.Id, guid);
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Client\RemoteLanguageServiceWorkspaceHost.cs (2)
128_loadedProjects = _loadedProjects.Add(projectName, projectId); 129_loadedProjectInfo = _loadedProjectInfo.Add(projectName, projectInfo);
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (2)
49ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer))) 95ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)))
Mvc.Api.Analyzers.Test (1)
ApiConventionAnalyzerIntegrationTest.cs (1)
311var specificDiagnosticOptions = compilationOptions.SpecificDiagnosticOptions.Add(
Roslyn.Compilers.Extension (1)
SetGlobalGlobalPropertiesForCPS.cs (1)
33? Task.FromResult<IImmutableDictionary<string, string>>(Empty.PropertiesMap.Add("RoslynHive", CompilerPackage.RoslynHive))
Roslyn.VisualStudio.Next.UnitTests (9)
Remote\SnapshotSerializationTests.cs (3)
427var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 448var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 701return new AnalyzerFileReference(original, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(original, shadow.Path)));
Services\SolutionServiceTests.cs (6)
172.Add("cs_optionA", $"csA{version}") 173.Add("cs_optionB", $"csB{version}")))) 175.Add("vb_optionA", $"vbA{version}") 176.Add("vb_optionB", $"vbB{version}")))) 178.Add("fs_optionA", $"fsA{version}") 179.Add("fs_optionB", $"fsB{version}")))));
System.Collections.Immutable (1)
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
506return this.Add(key, value);