108 references to GetRequiredService
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
163var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (2)
10=> solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyChange(kind); 13=> project.Solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyParseOptionChange(oldOptions, newOptions, project);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
216var copyPasteService = documentBeforePaste.Project.Solution.Services.GetRequiredService<IStringCopyPasteService>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Intents\IntentTestsBase.cs (1)
117var textDiffService = workspace.CurrentSolution.Services.GetRequiredService<IDocumentTextDifferencingService>();
Microsoft.CodeAnalysis.EditorFeatures (8)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
137var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
EditAndContinue\ActiveStatementTrackingService.cs (1)
56=> solution.Services.GetRequiredService<IActiveStatementTrackingService>().GetSpansAsync(solution, documentId, filePath, cancellationToken);
ExternalAccess\IntelliCode\IntentProcessor.cs (1)
118var textDiffService = changedSolution.Services.GetRequiredService<IDocumentTextDifferencingService>();
ExtractMethod\ExtractMethodCommandHandler.cs (1)
120var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Formatting\FormatCommandHandler.cs (1)
72var ruleFactory = document.Project.Solution.Services.GetRequiredService<IHostDependentFormattingRuleFactoryService>();
GoToDefinition\AbstractGoToCommandHandler`2.cs (1)
262var service = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>();
GoToDefinition\GoToDefinitionCommandHandler.cs (2)
107var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 145var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
67return (TestGenerateTypeOptionsService)InvocationDocument.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>();
Workspaces\WorkspaceTestLogger.cs (1)
31=> Assert.IsType<WorkspaceTestLogger>(services.GetRequiredService<IWorkspaceTestLogger>()).OutputHelper = outputHelper;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
CodeFixes\CodeFixServiceTests.cs (1)
406extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
CodeRefactorings\CodeRefactoringServiceTest.cs (1)
108var extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
NavigableSymbols\NavigableSymbolService.NavigableSymbolSource.cs (1)
49var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Peek\PeekableItemSource.cs (1)
109var symbolMappingService = services.GetRequiredService<ISymbolMappingService>();
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
RazorSpanMappingServiceWrapper.cs (1)
36var diffService = newDocument.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
Microsoft.CodeAnalysis.Features (27)
AddImport\AbstractAddImportCodeFixProvider.cs (1)
62var symbolSearchService = _symbolSearchService ?? services.GetRequiredService<ISymbolSearchService>();
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (1)
38var service = _assemblyProject.Solution.Services.GetRequiredService<ISymbolTreeInfoCacheService>();
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (1)
32var service = _project.Solution.Services.GetRequiredService<ISymbolTreeInfoCacheService>();
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (2)
63var symbolSearchService = solution.Services.GetRequiredService<ISymbolSearchService>(); 101var textDiffingService = solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
CodeRefactorings\CodeRefactoringService.cs (1)
213var extensionManager = textDocument.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Completion\CompletionOptions.cs (1)
80var documentSupportsFeatureService = solution.Services.GetRequiredService<IDocumentSupportsFeatureService>();
Completion\CompletionService.cs (3)
159var extensionManager = languageServices.SolutionServices.GetRequiredService<IExtensionManager>(); 215var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 247var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Completion\CompletionService_GetCompletions.cs (2)
155var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 329var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
237document.Project.Solution.Services.GetRequiredService<IDocumentSupportsFeatureService>().SupportsRefactorings(document);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
36CacheService = services.GetRequiredService<IImportCompletionCacheService<TypeImportCompletionCacheEntry, TypeImportCompletionCacheEntry>>();
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
61=> project.Solution.Services.GetRequiredService<IImportCompletionCacheService<ExtensionMethodImportCompletionCacheEntry, object>>();
FindUsages\AbstractFindUsagesService_FindReferences.cs (1)
72var provider = solution.Services.GetRequiredService<IExternalDefinitionItemProvider>();
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (1)
41var pickMembersService = _service._pickMembersService_forTestingPurposes ?? services.GetRequiredService<IPickMembersService>();
GenerateType\AbstractGenerateTypeService.CodeAction.cs (1)
102var generateTypeOptionsService = _document.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>();
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (1)
51var mappingService = services.GetRequiredService<ISymbolMappingService>();
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
88var mappingService = document.Project.Solution.Services.GetRequiredService<ISymbolMappingService>();
NavigateTo\NavigateToSearcher.cs (1)
74var docTrackingService = _solution.Services.GetRequiredService<IDocumentTrackingService>();
QuickInfo\QuickInfoServiceWithProviders.cs (2)
50var extensionManager = _services.SolutionServices.GetRequiredService<IExtensionManager>(); 74var extensionManager = _services.SolutionServices.GetRequiredService<IExtensionManager>();
SignatureHelp\SignatureHelpService.cs (1)
67var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>();
UnusedReferences\UnusedReferencesRemover.cs (1)
268var referenceCleanupService = solution.Services.GetRequiredService<IReferenceCleanupService>();
Workspace\MiscellaneousFileUtilities.cs (1)
84var metadataService = services.GetRequiredService<IMetadataService>();
Microsoft.CodeAnalysis.LanguageServer.Protocol (12)
Extensions\ProtocolConversions.Diagnostics.cs (1)
119var informationService = project.Solution.Services.GetRequiredService<IDiagnosticProjectInformationService>();
Features\CodeCleanup\AbstractCodeCleanupService.cs (1)
188var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>();
Features\CodeFixes\CodeFixService.cs (3)
347var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 410var errorReportingService = services.GetRequiredService<IErrorReportingService>(); 755var extensionManager = textDocument.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (1)
96var options = project.Solution.Services.GetRequiredService<IWorkspaceConfigurationService>().Options;
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (1)
40var compileTimeSolution = services.GetRequiredService<ICompileTimeSolutionProvider>().GetCompileTimeSolution(designTimeSolution);
Handler\CodeLens\CodeLensResolveHandler.cs (1)
67var codeLensReferencesService = document.Project.Solution.Services.GetRequiredService<ICodeLensReferencesService>();
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDiagnosticSourceHelpers.cs (1)
24var documentTrackingService = solution.Services.GetRequiredService<IDocumentTrackingService>();
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (1)
60var codeAnalysisService = solution.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>();
Handler\PullHandlers\VersionedPullCache.cs (1)
95var workspaceStatusService = solution.Services.GetRequiredService<IWorkspaceStatusService>();
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
39var documentTrackingService = solution.Services.GetRequiredService<IDocumentTrackingService>();
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\LegacySolutionEvents\RemoteLegacySolutionEventsAggregationService.cs (2)
34var aggregationService = services.GetRequiredService<ILegacySolutionEventsAggregationService>(); 51var aggregationService = oldSolution.Services.GetRequiredService<ILegacySolutionEventsAggregationService>();
Microsoft.CodeAnalysis.Remote.Workspaces (3)
EditAndContinue\ManagedHotReloadLanguageService.cs (1)
72=> currentDesignTimeSolution.Services.GetRequiredService<ICompileTimeSolutionProvider>().GetCompileTimeSolution(currentDesignTimeSolution);
ServiceHubRemoteHostClient.cs (2)
48_assetStorage = services.GetRequiredService<ISolutionAssetStorageProvider>().AssetStorage; 73var workspaceConfigurationService = services.GetRequiredService<IWorkspaceConfigurationService>();
Microsoft.CodeAnalysis.Workspaces (28)
Classification\AbstractClassificationService.cs (2)
83var workspaceStatusService = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>(); 191var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Classification\Classifier.cs (1)
83var extensionManager = services.GetRequiredService<IExtensionManager>();
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (1)
36_differenceService = document.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
218var serializer = services.GetRequiredService<ISerializerService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
163var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
89var configuration = solution.Services.GetRequiredService<IWorkspaceConfigurationService>().Options;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\AbstractIndentationService.cs (1)
51var formattingRuleFactory = document.SolutionServices.GetRequiredService<IHostDependentFormattingRuleFactoryService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (2)
10=> solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyChange(kind); 13=> project.Solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyParseOptionChange(oldOptions, newOptions, project);
Storage\PersistentStorageExtensions.cs (1)
17var configuration = services.GetRequiredService<IPersistentStorageConfiguration>();
Workspace\CommandLineProject.cs (2)
37var metadataService = languageServices.SolutionServices.GetRequiredService<IMetadataService>(); 45var analyzerLoader = languageServices.SolutionServices.GetRequiredService<IAnalyzerService>().GetLoader();
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
271var workspaceStatusService = _projectSystemProjectFactory.SolutionServices.GetRequiredService<IWorkspaceStatusService>(); 777var assemblyLoaderProvider = solution.Services.GetRequiredService<IAnalyzerAssemblyLoaderProvider>();
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
91WorkspaceListener = this.SolutionServices.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>().GetListener(); 816return solutionServices.GetRequiredService<IMetadataService>().GetReference(fullFilePath, properties);
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (1)
54_temporaryStorageService = workspaceServices.GetRequiredService<ITemporaryStorageServiceInternal>();
Workspace\Solution\ProjectState_Checksum.cs (2)
34=> GetParseOptionsChecksum(LanguageServices.SolutionServices.GetRequiredService<ISerializerService>()); 51var serializer = LanguageServices.SolutionServices.GetRequiredService<ISerializerService>();
Workspace\Solution\Solution_SemanticModelCaching.cs (1)
26var service = this.Services.GetRequiredService<IDocumentTrackingService>();
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (2)
70_validateStates = project.LanguageServices.SolutionServices.GetRequiredService<IWorkspaceConfigurationService>().Options.ValidateCompilationTrackerStates; 607var workspacePreference = compilationState.Services.GetRequiredService<IWorkspaceConfigurationService>().Options.SourceGeneratorExecution;
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
253var temporaryStorageService = services.GetRequiredService<ITemporaryStorageServiceInternal>();
Workspace\Solution\SolutionCompilationState_Checksum.cs (1)
134var serializer = this.SolutionState.Services.GetRequiredService<ISerializerService>();
Workspace\Solution\SolutionState_Checksum.cs (1)
136var serializer = this.Services.GetRequiredService<ISerializerService>();
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
151_storageService = services.GetRequiredService<ITemporaryStorageServiceInternal>();
Workspace\WorkspaceFileTextLoader.cs (1)
27_textFactory = services.GetRequiredService<ITextFactoryService>();
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
191metadataService: _solutionServices.GetRequiredService<IMetadataService>(),
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Remote\InProcRemostHostClient.cs (2)
68_workspaceServices.GetRequiredService<ISolutionAssetStorageProvider>().AssetStorage, 69_workspaceServices.GetRequiredService<IErrorReportingService>(),
Microsoft.VisualStudio.LanguageServices (11)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
120var documentTrackingService = project.Solution.Services.GetRequiredService<IDocumentTrackingService>();
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
63_notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
126var trackingService = solution.Services.GetRequiredService<IDocumentTrackingService>();
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
51var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
FindReferences\Entries\DocumentSpanEntry.cs (1)
183var controlService = document.Project.Solution.Services.GetRequiredService<IContentControlService>();
FindReferences\VisualStudioDefinitionsAndReferencesFactory.cs (1)
34var symbolNavigationService = solution.Services.GetRequiredService<ISymbolNavigationService>();
Progression\GraphQueries\SearchGraphQuery.cs (1)
28var statusService = solution.Services.GetRequiredService<IWorkspaceStatusService>();
Snippets\AbstractSnippetCommandHandler.cs (1)
47=> document.Project.Services.SolutionServices.GetRequiredService<ISnippetExpansionClientFactory>();
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
194var unusedReferenceAnalysisService = solution.Services.GetRequiredService<IUnusedReferenceAnalysisService>();
ValueTracking\ValueTrackingCommandHandler.cs (1)
125var valueTrackingService = solution.Services.GetRequiredService<IValueTrackingService>();
Workspace\VisualStudioSymbolNavigationService.cs (1)
69var navigationService = solution.Services.GetRequiredService<IDocumentNavigationService>();
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
Snippets\SnippetCompletionProvider.vb (1)
102Dim expansionClientFactory = document.Project.Services.SolutionServices.GetRequiredService(Of ISnippetExpansionClientFactory)()