Implemented interface members:
458 references to TryGetValue
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
180if (!analyzers.TryGetValue(project.Language, out var languageAnalyzers)) 334if (!analyzers.TryGetValue(project.Language, out var languageAnalyzers) || languageAnalyzers.IsEmpty)
BuildActionTelemetryTable (4)
Program.cs (1)
528if (!CodeActionDescriptionMap.TryGetValue(actionTypeName, out var description))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
ILLink.RoslynAnalyzer (1)
DataFlow\LocalDataFlowVisitor.cs (1)
57 => !lValueFlowCaptures.TryGetValue (captureId, out var captureKind) || captureKind != FlowCaptureKind.LValueCapture;
Microsoft.AspNetCore.Analyzers (2)
StartupAnalysis.cs (2)
25if (_analysesByType.TryGetValue(type, out var list)) 42if (_analysesByType.TryGetValue(type, out var list))
Microsoft.AspNetCore.App.Analyzers (4)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
68if (!item.Properties.TryGetValue(DescriptionKey, out var description)) 85item.Properties.TryGetValue(NewPositionKey, out var newPositionString);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (2)
62if (!item.Properties.TryGetValue(DescriptionKey, out var description)) 79item.Properties.TryGetValue(NewPositionKey, out var newPositionString);
Microsoft.AspNetCore.App.CodeFixes (3)
Http\HeaderDictionaryIndexerFixer.cs (2)
27if (diagnostic.Properties.TryGetValue("HeaderName", out var headerName) && 28diagnostic.Properties.TryGetValue("ResolvedPropertyName", out var resolvedPropertyName))
RouteParameterUnusedParameterFixer.cs (1)
47if (diagnostic.Properties.TryGetValue("RouteParameterName", out var routeParameterName))
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
87if (result.TrackedSteps.TryGetValue(stepName, out var staticEndpointSteps))
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
87if (result.TrackedSteps.TryGetValue(stepName, out var staticEndpointSteps))
Microsoft.Build (7)
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (1)
52internal bool IsRoot => GlobalSection.Properties.TryGetValue("root", out string? val) && val?.ToLower() == "true";
Collections\CopyOnWritePropertyDictionary.cs (5)
100_backing.TryGetValue(name, out T projectProperty); 120if (_backing.TryGetValue(name, out T value)) 181if (!thatBacking.TryGetValue(thisProp.Key, out T thatProp) || 263bool IDictionary<string, T>.TryGetValue(string key, out T value) => _backing.TryGetValue(key, out value); 282if (_backing.TryGetValue(item.Key, out T value))
CopyOnWriteDictionary.cs (1)
249return _backing.TryGetValue(key, out value);
Microsoft.Build.BuildCheck.UnitTests (1)
EditorConfig_Tests.cs (1)
888Assert.True(properties.TryGetValue("my_PrOp", out var val));
Microsoft.Build.Tasks.Core (1)
CopyOnWriteDictionary.cs (1)
249return _backing.TryGetValue(key, out value);
Microsoft.Build.Utilities.Core (1)
CopyOnWriteDictionary.cs (1)
249return _backing.TryGetValue(key, out value);
Microsoft.CodeAnalysis (21)
CommandLine\AnalyzerConfig.cs (2)
114internal bool IsRoot => GlobalSection.Properties.TryGetValue("root", out string? val) && val == "true"; 142if (GlobalSection.Properties.TryGetValue(GlobalLevelKey, out string? val) && int.TryParse(val, out int level))
Compilation\SyntaxTreeOptionsProvider.cs (4)
75=> _options.TryGetValue(tree, out var value) ? value.IsGenerated : GeneratedKind.Unknown; 79if (_options.TryGetValue(tree, out var value)) 81return value.DiagnosticOptions.TryGetValue(diagnosticId, out severity); 91return _globalOptions.TreeOptions.TryGetValue(diagnosticId, out severity);
Diagnostic\SuppressionDescriptor.cs (1)
109return compilationOptions.SpecificDiagnosticOptions.TryGetValue(Id, out var reportDiagnostic) &&
DiagnosticAnalyzer\AnalysisResultBuilder.cs (1)
310if (_pathToAdditionalTextMap.TryGetValue(externalFileLocation.GetLineSpan().Path, out var additionalTexts))
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
912if (AnalyzerExecutionTimes.TryGetValue(analyzer, out var analyzerExecutionTimeSpan)) 953if (compilation.Options.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var severity) || 1069if (programmaticSuppressionsByDiagnostic.TryGetValue(diagnostic, out var programmaticSuppressionInfo))
DiagnosticAnalyzer\AnalyzerManager.cs (1)
389if ((diagnosticOptions.TryGetValue(diag.Id, out var severity) && severity != ReportDiagnostic.Default) ||
DiagnosticAnalyzer\CompilerAnalyzerConfigOptionsProvider.cs (2)
29=> _treeDict.TryGetValue(tree, out var options) ? options : DictionaryAnalyzerConfigOptions.Empty; 32=> _treeDict.TryGetValue(textFile, out var options) ? options : DictionaryAnalyzerConfigOptions.Empty;
DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
25=> Options.TryGetValue(key, out value);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
222return suppressions.TryGetValue(id, out info);
Operations\ControlFlowGraph.cs (2)
246if (!_localFunctionsMap.TryGetValue(localFunction, out (ControlFlowRegion enclosing, ILocalFunctionOperation operation, int ordinal) info)) 295if (!_anonymousFunctionsMap.TryGetValue(anonymousFunction, out (ControlFlowRegion enclosing, int ordinal) info))
ReferenceManager\CommonReferenceManager.Binding.cs (1)
541if (!implicitReferenceResolutions.TryGetValue(referenceIdentity, out resolvedReference))
SourceGeneration\GeneratedCodeUtilities.cs (1)
152if (options.TryGetValue("generated_code", out string? optionValue) &&
Syntax\AbstractWarningStateMap.cs (1)
43if (entry.SpecificWarningOption.TryGetValue(id, out state))
Microsoft.CodeAnalysis.CodeStyle (16)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
105compilationWithAnalyzers.Compilation.Options.SpecificDiagnosticOptions.TryGetValue(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, out severity)) 466if (analysisResult.SyntaxDiagnostics.TryGetValue(semanticModel.SyntaxTree, out var diagnostics)) 473if (analysisResult.SemanticDiagnostics.TryGetValue(semanticModel.SyntaxTree, out diagnostics))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
297diagnostic.Properties.TryGetValue(UnusedValuePreferenceKey, out var preferenceString))
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
25=> Options.TryGetValue(key, out value);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
152if (options.TryGetValue("generated_code", out string? optionValue) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
461=> !LValueFlowCapturesInGraph.TryGetValue(captureId, out var captureKind) || captureKind != FlowCaptureKind.LValueCapture;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
45symbolMap.TryGetValue(targetSymbol, out aliasSymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
42=> _forwardMap.TryGetValue(key, out value); 45=> _backwardMap.TryGetValue(value, out key); 55if (!_forwardMap.TryGetValue(key, out var value)) 67if (!_backwardMap.TryGetValue(value, out var key))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
161if (dictionary.TryGetValue(key, out var collection))
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
153if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
131if (!_serviceMap.TryGetValue(serviceType, out var service))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (3)
140if (!_serviceMap.TryGetValue(serviceType, out var service)) 179if (!currentServicesMap.TryGetValue(languageName, out var languageServices)) 212=> _languageServicesMap.TryGetValue(languageName, out languageServices);
Microsoft.CodeAnalysis.CSharp (171)
Binder\Binder_Lookup.cs (2)
376if (usingAliases.TryGetValue(name, out node)) 412if (usingAliases.TryGetValue(name, out alias))
Binder\DecisionDagBuilder.cs (6)
846if (existingState.RemainingValues.TryGetValue(dagTemp, out var existingValuesForTemp)) 930case BoundDagAssignmentEvaluation e when state.RemainingValues.TryGetValue(e.Input, out IValueSet? currentValues): 935if (state.RemainingValues.TryGetValue(e.Target, out IValueSet? targetValues)) 1102whenTrueValues.TryGetValue(test.Input, out IValueSet? whenTrueValuesOpt); 1103whenFalseValues.TryGetValue(test.Input, out IValueSet? whenFalseValuesOpt); 1164if (values.TryGetValue(input, out IValueSet? tempValuesBeforeTest))
BoundTree\NullabilityRewriter.cs (2)
94bool foundInfo = _updatedNullabilities.TryGetValue(currentBinary, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType); 216if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
BoundTree\UnboundLambda.cs (3)
601if (!_bindingCache!.TryGetValue((delegateType, inExpressionTree), out BoundLambda? result)) 799_returnInferenceCache!.TryGetValue(cacheKey, out BoundLambda? returnInferenceLambda) && 1011if (!_returnInferenceCache!.TryGetValue(cacheKey, out result))
Compilation\CSharpCompilation.cs (1)
3008if (syntaxAndDeclarations.GetLazyState().LoadDirectiveMap.TryGetValue(syntaxTree, out loadDirectives))
Compilation\MemberSemanticModel.cs (2)
725if (_lazyRemappedSymbols.TryGetValue(originalSymbol, out Symbol? remappedSymbol)) 2351if (_lazyRemappedSymbols.TryGetValue(symbol, out var remappedSymbol))
Compilation\SyntaxAndDeclarationManager.cs (6)
393if (includeLoadedTrees && loadDirectiveMap.TryGetValue(oldTree, out oldLoadDirectives)) 416if (loadDirectiveMap.TryGetValue(tree, out loadDirectives)) 446if (loadDirectiveMap.TryGetValue(loadedTree, out nestedLoadDirectives)) 671return loadedSyntaxTreeMap.TryGetValue(tree.FilePath, out loadedTree) && (tree == loadedTree); 685if (loadDirectiveMap.TryGetValue(tree, out loadDirectives)) 730if (loadedSyntaxTreeMap.TryGetValue(directive.ResolvedPath, out loadedTree))
Errors\ErrorFacts.cs (1)
173if (s_categoriesMap.Value.TryGetValue(code, out category))
FlowAnalysis\NullableWalker.SnapshotManager.cs (2)
74if (_updatedSymbolsMap.TryGetValue((null, lambda), out var updatedDelegate)) 84return _updatedSymbolsMap.TryGetValue((node, symbol), out updatedSymbol);
FlowAnalysis\NullableWalker.Variables.cs (1)
61return VariableTypes.TryGetValue(symbol, out type);
Generated\BoundNodes.xml.Generated.cs (143)
12255if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12270if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12287if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12301if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12313if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12325if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12337if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12349if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12361if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12373if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12385if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12397if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12409if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12421if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12436if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12454if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12472if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12486if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12498if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12516if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12540if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12557if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12574if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12592if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12609if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12627if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12645if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12663if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12680if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12697if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12715if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12734if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12752if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12775if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12793if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12811if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12831if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12849if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12868if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12888if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12906if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12923if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12940if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12967if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 12985if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13002if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13020if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13038if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13052if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13064if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13076if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13088if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13100if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13112if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13124if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13136if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13152if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13170if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13184if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13199if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13217if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13237if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13254if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13272if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13290if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13304if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13319if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13340if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13475if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13487if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13499if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13511if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13523if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13535if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13550if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13567if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13585if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13602if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13616if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13642if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13662if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13737if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13756if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13775if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13792if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13811if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13829if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13849if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13863if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13879if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13899if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13917if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13937if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13956if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13975if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 13992if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14012if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14029if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14052if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14066if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14081if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14099if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14118if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14135if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14153if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14172if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14189if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14207if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14226if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14245if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14259if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14276if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14293if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14310if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14328if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14346if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14363if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14382if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14401if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14419if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14436if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14454if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14472if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14492if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14510if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14529if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14548if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14565if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14586if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14603if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14620if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14637if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14651if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14663if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14680if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14699if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14833if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14848if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14866if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14884if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14901if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14927if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType)) 14946if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
Symbols\Compilation_UsedAssemblies.cs (1)
42mergedAssemblyReferencesMap.TryGetValue(reference, out ImmutableArray<MetadataReference> merged))
Symbols\TypeSymbol.cs (1)
2317if (info.synthesizedMethodImplMap.TryGetValue(interfaceMethod, out MethodSymbol? result))
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Diagnostics\DiagnosticAnalyzerTests.cs (3)
3711var diagnostics = diagnosticsMap.TryGetValue(tree1, out var value) ? value : ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 4023if (analysisResult.AdditionalFileDiagnostics.TryGetValue(additionalFile, out var diagnosticsMap) && 4024diagnosticsMap.TryGetValue(analyzer, out var diagnostics))
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
73if (diagnostic.Properties.TryGetValue(DiagnosticPropertyConstants.RequiredLanguageVersion, out var requiredVersion) &&
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Rename\CSharpRenameRewriterLanguageService.cs (1)
688!_stringAndCommentTextSpans.TryGetValue(oldToken.Span, out subSpansToReplace)))
Microsoft.CodeAnalysis.EditorFeatures (6)
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (5)
60var oldTagTree = oldTagTrees.TryGetValue(snapshot.TextBuffer, out var tagTree) 117if (oldTagTrees.TryGetValue(buffer, out var treeForBuffer)) 520oldTagTrees.TryGetValue(textBuffer, out var oldTagTree); 737!tagTrees.TryGetValue(buffer, out _)) 750tagTrees.TryGetValue(buffer, out var tags);
Tagging\TaggerContext.cs (1)
102_existingTags.TryGetValue(point.Snapshot.TextBuffer, out var tree) &&
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
PDB\MethodDebugInfo.Native.cs (4)
670dynamicLocalConstantMap?.TryGetValue(name, out dynamicFlags); 677tupleLocalConstantMap.TryGetValue(new LocalNameAndScope(name, scopeStart, scopeEnd), out tupleElementNames); 717dynamicLocalMap?.TryGetValue(i, out dynamicFlags); 720tupleLocalConstantMap?.TryGetValue(i, out tupleElementNames);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (2)
SpecialTypeExtensions.cs (1)
16s_typeSignatures.TryGetValue(type, out signature);
VisualBasic\Scanner.cs (1)
102KeywordKinds.TryGetValue(text, out keywordKind);
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (1)
RazorPredefinedProviderNameTests.cs (1)
35if (!razorProviderNames.TryGetValue(roslynKvp.Key, out var razorValue))
Microsoft.CodeAnalysis.Features (16)
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
70if (properties.TryGetValue(DiagnosticPropertyConstants.UnreferencedAssemblyIdentity, out var displayName) &&
Completion\CompletionItem.cs (1)
114return _lazyPropertiesAsImmutableDictionary.TryGetValue(name, out value);
Completion\CompletionService.ProviderManager.cs (1)
156if (_nameToProvider.Value.TryGetValue(item.ProviderName, out var provider))
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
168if (propertyMap.TryGetValue(symbol, out var newName))
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (3)
43if (Properties.TryGetValue(MetadataSymbolKey, out var symbolKey)) 63if (!Properties.TryGetValue(MetadataSymbolOriginatingProjectIdGuid, out var projectIdGuid) || 64!Properties.TryGetValue(MetadataSymbolOriginatingProjectIdDebugName, out var projectDebugName))
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (1)
281var name = renameTable.TryGetValue(parameterSymbol, out var newName) ? newName : parameterSymbol.Name;
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
202if (pdbCompilationOptions.TryGetValue(Cci.CompilationOptionNames.DefaultEncoding, out var encodingString)) 206else if (pdbCompilationOptions.TryGetValue(Cci.CompilationOptionNames.FallbackEncoding, out var fallbackEncodingString)) 298if (!pdbCompilationOptions.TryGetValue(Cci.CompilationOptionNames.Language, out var languageName) || languageName is null)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
105compilationWithAnalyzers.Compilation.Options.SpecificDiagnosticOptions.TryGetValue(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, out severity))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
297diagnostic.Properties.TryGetValue(UnusedValuePreferenceKey, out var preferenceString))
Structure\Syntax\BlockSpanCollector.cs (2)
65if (_nodeProviderMap.TryGetValue(node.GetType(), out var providers)) 87if (_triviaProviderMap.TryGetValue(trivia.RawKind, out var providers))
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
178return _diagnosticsByProject.TryGetValue(project, out var diagnostics)
Microsoft.CodeAnalysis.LanguageServer (2)
Services\ExtensionAssemblyManager.cs (2)
171if (_directoryLoadContexts.TryGetValue(directory, out var loadContext)) 186if (_assemblyFullNameToLoadContext.TryGetValue(assemblyFullName, out var loadContext))
Microsoft.CodeAnalysis.LanguageServer.Protocol (22)
Features\CodeFixes\CodeFixService.cs (6)
364if (!_lazyWorkspaceFixersMap.TryGetValue(document.Project.Language, out var lazyFixerMap)) 390return _lazyFixerPriorityMap.TryGetValue(document.Project.Language, out fixersPriorityMap); 706if (!_configurationProvidersMap.TryGetValue(document.Project.Language, out var lazyConfigurationProviders) || 803if (!_configurationProvidersMap.TryGetValue(language, out var lazyConfigurationProviders) || 1012if (_priorityMap.TryGetValue(x, out var xOrder) && 1013_priorityMap.TryGetValue(y, out var yOrder))
Features\Diagnostics\DocumentAnalysisExecutor.cs (2)
261return _lazySyntaxDiagnostics.TryGetValue(analyzer, out var diagnosticAnalysisResult) 297return _lazySemanticDiagnostics.TryGetValue(analyzer, out var diagnosticAnalysisResult)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (1)
110=> Result.TryGetValue(analyzer, out result);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (1)
74if (map.TryGetValue(analyzer, out var result))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (3)
67return _projectAnalyzerStateMap.TryGetValue(projectId, out var entry) 100if (projectStateSets.StateSetMap.TryGetValue(analyzer, out var stateSet)) 106if (hostStateSetMap.TryGetValue(analyzer, out stateSet))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (4)
60if (_projectAnalyzerStateMap.TryGetValue(project.Id, out var entry) && 130if (!_projectAnalyzerStateMap.TryGetValue(project.Id, out var entry)) 172if (!mapPerReference.TryGetValue(reference.Id, out var analyzers)) 180if (!map.TryGetValue(analyzer, out var set))
Handler\Completion\CompletionResultFactory.cs (2)
177if (ProtocolConversions.RoslynTagToCompletionItemKinds.TryGetValue(tag, out var completionItemKinds)) 205if (ProtocolConversions.RoslynTagToCompletionItemTags.TryGetValue(tag, out var completionItemTags))
Handler\Diagnostics\DiagnosticSourceProviders\DiagnosticSourceManager.cs (1)
71if (nameToProviderMap.TryGetValue(providerName, out var provider))
Workspaces\LspWorkspaceManager.cs (2)
315if (_trackedDocuments.TryGetValue(uri, out var trackedDocument)) 539if (_trackedDocuments.TryGetValue(uri, out var trackedDocument))
Microsoft.CodeAnalysis.Remote.Workspaces (3)
ServiceDescriptors.cs (1)
139if (!_descriptors.TryGetValue(serviceType, out var descriptor))
VisualStudioMefHostServices.cs (2)
47if (!_exportsMap.TryGetValue(key, out var exports)) 64if (!_exportsMap.TryGetValue(key, out var exports))
Microsoft.CodeAnalysis.Scripting (1)
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (1)
199=> TrustedPlatformAssemblies.TryGetValue(name, out var path) && File.Exists(path) ? CreateFromFile(path, properties) : null;
Microsoft.CodeAnalysis.Test.Utilities (5)
Compilation\CompilationTestDataExtensions.cs (2)
50if (map.TryGetValue(qualifiedMethodName, out methodData)) 56if (map.TryGetValue(qualifiedMethodName + "()", out methodData))
MarkedSource\SourceWithMarkedNodes.cs (2)
140if (map1.TryGetValue(node1, out var mark)) 142if (map0.TryGetValue(mark, out var result))
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
30pdbOptions.TryGetValue(pdbName, out var actualValueString);
Microsoft.CodeAnalysis.UnitTests (1)
Analyzers\AnalyzerConfigTests.cs (1)
1270Assert.True(treeOptions.TryGetValue(item.diagId, out var severity));
Microsoft.CodeAnalysis.VisualBasic (3)
Binding\DescendantBinderFactory.vb (2)
43If NodeToBinderMap.TryGetValue(node, binder) Then 52If StmtListToBinderMap.TryGetValue(statementList, binder) Then
Preprocessor\ExpressionEvaluator.vb (1)
282If Not _symbols.TryGetValue(ident.IdentifierText, value) Then
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Rewriters\CapturedVariableRewriter.vb (1)
163_displayClassVariables.TryGetValue(name, variable)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Rename\VisualBasicRenameRewriterLanguageService.vb (1)
629(Me._isProcessingStructuredTrivia = 0 AndAlso Not Me._stringAndCommentTextSpans.TryGetValue(oldToken.Span, subSpansToReplace)) Then
Microsoft.CodeAnalysis.Workspaces (67)
CodeFixes\FixAllOccurrences\FixAllState.FixMultipleDiagnosticProvider.cs (4)
44if (DocumentDiagnosticsMap.TryGetValue(document, out diagnostics)) 51if (ProjectDiagnosticsMap.TryGetValue(project, out diagnostics)) 61if (DocumentDiagnosticsMap.TryGetValue(document, out var diagnostics)) 71if (ProjectDiagnosticsMap.TryGetValue(project, out var diagnostics))
Diagnostics\DiagnosticAnalysisResult.cs (1)
251if (map.TryGetValue(documentId, out var diagnostics))
Diagnostics\Extensions.cs (4)
154if (analysisResult.MergedSyntaxDiagnostics.TryGetValue(treeToAnalyze, out diagnosticsByAnalyzerMap)) 160else if (analysisResult.MergedAdditionalFileDiagnostics.TryGetValue(additionalFileToAnalyze!, out diagnosticsByAnalyzerMap)) 169if (analysisResult.MergedSemanticDiagnostics.TryGetValue(treeToAnalyze!, out diagnosticsByAnalyzerMap)) 248if (diagnosticsByAnalyzer.TryGetValue(analyzer, out var diagnostics))
Diagnostics\HostDiagnosticAnalyzers.cs (4)
100if (!map.TryGetValue(id, out var reference) || reference == null) 148if (_compilerDiagnosticAnalyzerMap.TryGetValue(language, out var compilerAnalyzer)) 303if (box.Value != null && box.Value.TryGetValue(project.Language, out var info)) 312if (!box.Value.TryGetValue(project.Language, out info))
Editing\SymbolEditor.cs (1)
137if (!_assemblyNameToProjectIdMap.TryGetValue(assembly.Name, out var projectIds))
Options\DocumentOptionSet.cs (1)
48if (_values.TryGetValue(optionKey, out var value))
Options\GlobalOptionService.cs (1)
165if (currentValues.TryGetValue(optionKey, out var value))
Options\SolutionOptionSet.cs (1)
49if (_values.TryGetValue(optionKey, out var value))
Rename\ConflictResolution.cs (6)
99=> _documentToComplexifiedSpansMap.TryGetValue(documentId, out var complexifiedSpans) 106if (_documentToModifiedSpansMap.TryGetValue(documentId, out var modifiedSpans)) 112if (_documentToComplexifiedSpansMap.TryGetValue(documentId, out var complexifiedSpans)) 125=> _documentToRelatedLocationsMap.TryGetValue(documentId, out var result) 131if (_documentToModifiedSpansMap.TryGetValue(documentId, out var modifiedSpans)) 138if (_documentToComplexifiedSpansMap.TryGetValue(documentId, out var complexifiedSpans))
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
25=> Options.TryGetValue(key, out value);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
152if (options.TryGetValue("generated_code", out string? optionValue) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (3)
45(!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) || 48if (treeOptions.TryGetValue(descriptor.Id, out reportDiagnostic) && reportDiagnostic != ReportDiagnostic.Default || 70if (!compilationOptions.SpecificDiagnosticOptions.TryGetValue(descriptor.Id, out var reportDiagnostic) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
461=> !LValueFlowCapturesInGraph.TryGetValue(captureId, out var captureKind) || captureKind != FlowCaptureKind.LValueCapture;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (1)
45symbolMap.TryGetValue(targetSymbol, out aliasSymbol);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (4)
42=> _forwardMap.TryGetValue(key, out value); 45=> _backwardMap.TryGetValue(value, out key); 55if (!_forwardMap.TryGetValue(key, out var value)) 67if (!_backwardMap.TryGetValue(value, out var key))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (1)
161if (dictionary.TryGetValue(key, out var collection))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
153if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
131if (!_serviceMap.TryGetValue(serviceType, out var service))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (3)
140if (!_serviceMap.TryGetValue(serviceType, out var service)) 179if (!currentServicesMap.TryGetValue(languageName, out var languageServices)) 212=> _languageServicesMap.TryGetValue(languageName, out languageServices);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (6)
194_projectToDependencyNodeTargetIdentifier.TryGetValue(projectId, out var identifier); 201_projectToMaxSupportedLangVersionMap.TryGetValue(projectId, out var identifier); 362if (projectUpdateState.ProjectReferenceInfos.TryGetValue(projectId, out var referenceInfo)) 393if (projectUpdateState.ProjectReferenceInfos.TryGetValue(projectId, out var projectReferenceInfo)) 700if (projectUpdateState.ProjectsByOutputPath.TryGetValue(path, out var ids) && ids.Distinct().Count() == 1) 789if (projectUpdateState.ProjectsByOutputPath.TryGetValue(outputPath, out var remainingProjectsForOutputPath))
Workspace\ProjectSystem\ProjectSystemProjectFactory.ProjectUpdateState.cs (2)
81if (!map.TryGetValue(path, out var projects)) 101if (map.TryGetValue(path, out var projects))
Workspace\Solution\Project.cs (2)
315if (_idToSourceGeneratedDocumentMap.TryGetValue(documentId, out var sourceGeneratedDocument)) 350if (_idToSourceGeneratedDocumentMap.TryGetValue(documentId, out var document))
Workspace\Solution\ProjectDependencyGraph.cs (6)
236_transitiveReferencesMap.TryGetValue(projectId, out var projects); 252if (currentMap.TryGetValue(projectId, out var transitiveReferences)) 267if (!_transitiveReferencesMap.TryGetValue(projectId, out var transitiveReferences)) 304if (currentMap.TryGetValue(projectId, out var reverseTransitiveReferences)) 319if (!_reverseTransitiveReferencesMap.TryGetValue(projectId, out var reverseTransitiveReferences)) 387if (_referencesMap.TryGetValue(projectId, out var projectReferenceIds))
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (5)
63if (existingReferencesMap.TryGetValue(projectId, out var existingReferences)) 112if (existingTransitiveReferencesMap.TryGetValue(referencedProjectId, out var additionalTransitiveReferences)) 128existingTransitiveReferencesMap.TryGetValue(projectIdToUpdate, out var existingTransitiveReferences); 164existingReverseTransitiveReferencesMap.TryGetValue(projectId, out var newReverseTranstiveReferences); 176existingReverseTransitiveReferencesMap.TryGetValue(projectIdToUpdate, out var existingReverseTransitiveReferences);
Workspace\Solution\ProjectDependencyGraph_RemoveAllProjectReferences.cs (1)
17if (!_referencesMap.TryGetValue(projectId, out var referencedProjectIds))
Workspace\Solution\ProjectDependencyGraph_RemoveProject.cs (2)
62if (existingReverseReferencesMap.TryGetValue(removedProjectId, out var referencingProjects)) 101if (!existingForwardReferencesMap.TryGetValue(removedProjectId, out var forwardReferences))
Workspace\Solution\SolutionState.cs (3)
311=> ProjectStates.TryGetValue(projectId, out var state) ? state : null; 485if (!projectCountByLanguage.TryGetValue(language, out var currentCount)) 1255if (fileMap != null && fileMap.TryGetValue(filePath, out var relatedDocumentIds))
Microsoft.CodeAnalysis.Workspaces.Desktop (2)
Workspace\Host\Mef\MefV1HostServices.cs (2)
84if (!_exportsMap.TryGetValue(key, out var exports)) 101if (!_exportsMap.TryGetValue(key, out var exports))
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
122if (filePath != null && _pathToIndicesMap.TryGetValue(filePath, out var indices))
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (1)
172if (debugType != null && s_debugTypeValues.TryGetValue(debugType, out var value))
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Fakes\TestOptionSet.cs (1)
25=> _values.TryGetValue(optionKey, out var value) ? value : optionKey.Option.DefaultValue;
Microsoft.DotNet.Build.Tasks.Feed (3)
src\model\SetupTargetFeedConfigV3.cs (3)
65AzureDevOpsFeedsKey = FeedKeys.TryGetValue("https://pkgs.dev.azure.com/dnceng", out string key) ? key : null; 149FeedOverrides.TryGetValue("transport-packages", out string newFeed)) 155FeedOverrides.TryGetValue("shipping-packages", out newFeed))
Microsoft.DotNet.SignTool (1)
src\ZipData.cs (1)
46if (NestedParts.TryGetValue(relativeName, out ZipPart part))
Microsoft.Interop.ComInterfaceGenerator (17)
Analyzers\AddGeneratedComClassFixer.cs (1)
50bool allowUnsafe = selectedOptions.TryGetValue(Option.AllowUnsafe, out var allowUnsafeOption) && allowUnsafeOption is Option.Bool(true);
Analyzers\AddMarshalAsToElementFixer.cs (1)
34if (!diagnostic.Properties.TryGetValue(GeneratorDiagnosticProperties.AddMarshalAsAttribute, out string? addMarshalAsAttribute))
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (7)
30return selectedOptions.TryGetValue(Option.AllowUnsafe, out Option allowUnsafeOption) && allowUnsafeOption is Option.Bool(true) 37bool mayRequireAdditionalWork = selectedOptions.TryGetValue(Option.MayRequireAdditionalWork, out Option mayRequireAdditionalWorkOption) && mayRequireAdditionalWorkOption is Option.Bool(true); 38bool addStringMarshalling = selectedOptions.TryGetValue(AddStringMarshallingOption, out Option addStringMarshallingOption) && addStringMarshallingOption is Option.Bool(true); 47if (diagnostic.Properties.TryGetValue(AnalyzerDiagnostics.Metadata.MayRequireAdditionalWork, out string? mayRequireAdditionalWork) && bool.Parse(mayRequireAdditionalWork)) 51if (diagnostic.Properties.TryGetValue(AnalyzerDiagnostics.Metadata.AddStringMarshalling, out string? addStringMarshalling) && bool.Parse(addStringMarshalling)) 61if (fixAllOptions.TryGetValue(AddStringMarshallingOption, out Option fixAllAddStringMarshallingOption) 63&& (!diagnosticOptions.TryGetValue(AddStringMarshallingOption, out Option addStringMarshallingOption)
GeneratedComInterfaceAttributeData.cs (1)
66if (args.TryGetValue(nameof(Options), out var options))
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
174bool addUnsafe = options.TryGetValue(Option.AllowUnsafe, out Option allowUnsafeOption) && allowUnsafeOption is Option.Bool(true); 176bool includeFixesWithAdditionalWork = options.TryGetValue(Option.MayRequireAdditionalWork, out Option includeFixesWithAdditionalWorkOption) && includeFixesWithAdditionalWorkOption is Option.Bool(true); 188bool mayRequireAdditionalWork = diagnostic.Properties.TryGetValue(Option.MayRequireAdditionalWork, out string mayRequireAdditionalWorkString)
VtableIndexStubGenerator.cs (4)
150if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.Direction), out TypedConstant directionValue)) 160if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.ImplicitThisParameter), out TypedConstant implicitThisValue)) 168if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.ExceptionMarshalling), out TypedConstant exceptionMarshallingValue)) 179if (namedArguments.TryGetValue(nameof(VirtualMethodIndexCompilationData.ExceptionMarshallingCustomType), out TypedConstant exceptionMarshallingCustomTypeValue))
Microsoft.Interop.LibraryImportGenerator (12)
Analyzers\ConvertToLibraryImportFixer.cs (7)
39bool allowUnsafe = selectedOptions.TryGetValue(Option.AllowUnsafe, out Option? allowUnsafeOption) && allowUnsafeOption is Option.Bool(true); 42if (selectedOptions.TryGetValue(SelectedSuffixOption, out Option? suffixOption) && suffixOption is Option.String(string suffixValue)) 60if (diagnostic.Properties.TryGetValue(ConvertToLibraryImportAnalyzer.MayRequireAdditionalWork, out string? mayRequireAdditionalWork) && bool.Parse(mayRequireAdditionalWork)) 78bool warnForAdditionalWork = options.TryGetValue(Option.MayRequireAdditionalWork, out Option mayRequireAdditionalWork) && mayRequireAdditionalWork is Option.Bool(true); 80CharSet? charSet = options.TryGetValue(CharSetOption, out Option charSetOption) && charSetOption is Option.String(string charSetString) && Enum.TryParse<CharSet>(charSetString, out CharSet result) ? result : null; 131bool warnForAdditionalWork = selectedOptions.TryGetValue(Option.MayRequireAdditionalWork, out Option mayRequireAdditionalWork) && mayRequireAdditionalWork is Option.Bool(true); 132char? suffix = selectedOptions.TryGetValue(SelectedSuffixOption, out Option selectedSuffixOption) && selectedSuffixOption is Option.String(string selectedSuffix) ? selectedSuffix[0] : null;
Analyzers\CustomMarshallerAttributeFixer.cs (1)
139if (diagnostic.Properties.TryGetValue(MissingMemberNames.Key, out string missingMembers))
LibraryImportGenerator.cs (1)
203if (namedArguments.TryGetValue(nameof(LibraryImportCompilationData.EntryPoint), out TypedConstant entryPointValue))
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (3)
174bool addUnsafe = options.TryGetValue(Option.AllowUnsafe, out Option allowUnsafeOption) && allowUnsafeOption is Option.Bool(true); 176bool includeFixesWithAdditionalWork = options.TryGetValue(Option.MayRequireAdditionalWork, out Option includeFixesWithAdditionalWorkOption) && includeFixesWithAdditionalWorkOption is Option.Bool(true); 188bool mayRequireAdditionalWork = diagnostic.Properties.TryGetValue(Option.MayRequireAdditionalWork, out string mayRequireAdditionalWorkString)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
145if (namedArguments.TryGetValue(nameof(LibraryImportCompilationData.EntryPoint), out TypedConstant entryPointValue))
Microsoft.Interop.SourceGeneration (13)
InteropAttributeData.cs (3)
62if (namedArguments.TryGetValue(nameof(InteropAttributeCompilationData.SetLastError), out TypedConstant setLastErrorValue)) 71if (namedArguments.TryGetValue(nameof(InteropAttributeCompilationData.StringMarshalling), out TypedConstant stringMarshallingValue)) 82if (namedArguments.TryGetValue(nameof(InteropAttributeCompilationData.StringMarshallingCustomType), out TypedConstant stringMarshallingCustomTypeValue))
ManualTypeMarshallingHelper.cs (4)
48if (Modes.TryGetValue(mode, out data)) 51if (Modes.TryGetValue(MarshalMode.Default, out data)) 60if (Modes.TryGetValue(mode, out data)) 63return Modes.TryGetValue(MarshalMode.Default, out data);
MarshalAsParser.cs (2)
137if (namedArguments.TryGetValue(nameof(MarshalAsAttribute.SizeConst), out TypedConstant sizeConstArg)) 141if (namedArguments.TryGetValue(nameof(MarshalAsAttribute.SizeParamIndex), out TypedConstant sizeParamIndexArg))
Marshalling\NoMarshallingInfoErrorResolver.cs (1)
18if (info.MarshallingAttributeInfo is NoMarshallingInfo && CustomTypeToErrorMessageMap.TryGetValue(info.ManagedType, out string errorMessage))
MarshalUsingAttributeParser.cs (1)
68int elementIndirectionDepth = namedArgs.TryGetValue(ManualTypeMarshallingHelper.MarshalUsingProperties.ElementIndirectionDepth, out TypedConstant value) ? (int)value.Value! : 0;
UseSiteAttributeProvider.cs (1)
82return _useSiteAttributesByIndirectionDepth.TryGetValue(indirectionDepth, out useSiteInfo);
ValueEqualityImmutableDictionary.cs (1)
57public bool TryGetValue(T key, out U value) => Map.TryGetValue(key, out value);
Microsoft.VisualStudio.LanguageServices (14)
ColorSchemes\ColorSchemeApplier.ClassificationVerifier.cs (4)
99!_colorSchemes.TryGetValue(schemeName, out var colorScheme) || 100!colorScheme.TryGetValue(themeId, out var colorSchemeTheme)) 181if (coreThemeColors.TryGetValue(classification, out var coreColor)) 186if (schemeThemeColors.TryGetValue(classification, out var schemeColor))
Options\VisualStudioSettingsOptionPersister.cs (1)
54if (_storageKeysToMonitorForChanges.TryGetValue(args.PropertyName, out var entry) &&
Packaging\PackageInstallerService.ProjectState.cs (1)
35=> InstalledPackageToVersion.TryGetValue(packageName, out version);
Packaging\PackageInstallerServiceFactory.cs (2)
334var installedVersion = installedPackagesMap.TryGetValue(packageName, out var result) ? result : null; 389if (!installedPackagesMap.TryGetValue(packageName, out var installedVersion))
ProjectSystem\OpenTextBufferProvider.cs (2)
156if (_monikerToTextBufferMap.TryGetValue(pszMkDocumentOld, out var textBuffer)) 241return _monikerToTextBufferMap.TryGetValue(filePath, out textBuffer);
ProjectSystem\VisualStudioWorkspaceImpl.cs (2)
261if (_projectToHierarchyMap.TryGetValue(project.Id, out var projectHierarchy)) 279if (_projectToRuleSetFilePath.TryGetValue(projectId, out var ruleSetPathFunc))
Snippets\SnippetExpansionClient.cs (1)
900newArguments.TryGetValue(parameter.Name, out var value);
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
257if (!filePathMap.TryGetValue(filePath, out document))
Microsoft.VisualStudio.LanguageServices.LiveShare (3)
Client\RemoteLanguageServiceWorkspace.cs (1)
367if (_openedDocs.TryGetValue(moniker, out var id))
Client\RemoteLanguageServiceWorkspaceHost.cs (2)
120if (!_loadedProjects.TryGetValue(projectName, out var projectId)) 135if (_loadedProjectInfo.TryGetValue(projectName, out var projInfo))
MSBuild (1)
CopyOnWriteDictionary.cs (1)
249return _backing.TryGetValue(key, out value);
Roslyn.Test.PdbUtilities (2)
Reader\MockSymUnmanagedReader.cs (2)
38if (!_methodDebugInfoMap.TryGetValue(methodToken, out info)) 64if (!_methodDebugInfoMap.TryGetValue(methodToken, out info))
RunTests (1)
AssemblyScheduler.cs (1)
150if (testHistory.TryGetValue(methodInfo.FullyQualifiedName, out var executionTime))
System.Collections.Immutable (1)
System\Collections\Immutable\ImmutableDictionary_2.cs (1)
249if (!this.TryGetValue(key, out value!))
System.Windows.Forms.Analyzers.CSharp.Tests (3)
CompilerAnalyzerConfigOptions.cs (1)
26public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value) => _backing.TryGetValue(key, out value);
CompilerAnalyzerConfigOptionsProvider.cs (2)
34=> _treeDict.TryGetValue(tree, out var options) ? options : CompilerAnalyzerConfigOptions.Empty; 37=> _treeDict.TryGetValue(textFile, out var options) ? options : CompilerAnalyzerConfigOptions.Empty;