153 references to GetRequiredService
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
148var factory = document.Project.Solution.Workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (7)
CodeActions\MoveStaticMembers\CSharpMoveStaticMembersTests.cs (1)
3470var testOptionsService = (TestMoveStaticMembersService)workspace.Services.GetRequiredService<IMoveStaticMembersOptionsService>();
CodeActions\PreviewExceptionTests.cs (3)
31var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>(); 44var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>(); 57var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>();
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (1)
400var settingsProviderFactory = workspace.Services.GetRequiredService<IWorkspaceSettingsProviderFactory<NamingStyleSetting>>();
ExtractMethod\ExtractMethodMiscellaneousTests.cs (1)
143var callBackService = (INotificationServiceCallback)workspace.Services.GetRequiredService<INotificationService>();
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
600var trackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>();
Microsoft.CodeAnalysis.EditorFeatures (27)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
99var notificationService = workspace.Services.GetRequiredService<INotificationService>();
CodeActions\CodeActionEditHandlerService.cs (5)
137using (workspace.Services.GetRequiredService<ISourceTextUndoService>().RegisterUndoTransaction(text, title)) 299var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 308var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 330var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 354var navigationService = editorWorkspace.Services.GetRequiredService<IDocumentNavigationService>();
CodeDefinitionWindow\DefinitionContextTracker.cs (2)
149var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 173var symbolNavigationService = workspace.Services.GetRequiredService<ISymbolNavigationService>();
EditAndContinue\ActiveStatementTrackingService.cs (1)
122_compileTimeSolutionProvider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>();
Editor\EditorLayerExtensionManager.cs (2)
38var errorReportingService = workspaceServices.GetRequiredService<IErrorReportingService>(); 39var errorLoggerService = workspaceServices.GetRequiredService<IErrorLoggerService>();
Editor\TextEditApplication.cs (1)
36var undoService = workspace.Services.GetRequiredService<ISourceTextUndoService>();
EditorConfigSettings\Updater\SettingsUpdaterBase.cs (1)
29_listener = workspace.Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>().GetListener();
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
69var indicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 92var notificationService = workspace.Services.GetRequiredService<INotificationService>();
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (2)
58var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 66var notificationService = workspace.Services.GetRequiredService<INotificationService>();
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
60var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>();
InlineRename\CommandHandlers\AbstractRenameCommandHandler_RenameHandler.cs (1)
91var backgroundWorkIndicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
InlineRename\InlineRenameService.cs (1)
129var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>();
IntelliSense\QuickInfo\QuickInfoHyperLink.cs (1)
44var navigateToLinkService = _workspace.Services.GetRequiredService<INavigateToLinkService>();
Interactive\InteractiveSession.cs (2)
200var metadataService = _workspace.Services.GetRequiredService<IMetadataService>(); 296var metadataService = _workspace.Services.GetRequiredService<IMetadataService>();
Navigation\AbstractDefinitionLocationService.cs (1)
34var service = workspace.Services.GetRequiredService<IDocumentNavigationService>();
Organizing\OrganizeDocumentCommandHandler.cs (1)
130var indicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Remote\SolutionChecksumUpdater.cs (1)
66_documentTrackingService = workspace.Services.GetRequiredService<IDocumentTrackingService>();
Shared\Extensions\ITextBufferExtensions.cs (1)
20var workspaceContextService = workspace.Services.GetRequiredService<IWorkspaceContextService>();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
565_codeAnalysisService = testWorkspace.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (19)
CodeFixes\CodeFixServiceTests.cs (4)
51var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>())); 287var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>(); 314var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>(); 772var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>()));
CodeRefactorings\CodeRefactoringServiceTest.cs (1)
98var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>();
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
51var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 647var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>();
RenameTracking\RenameTrackingTestState.cs (1)
94var notificationService = (INotificationServiceCallback)Workspace.Services.GetRequiredService<INotificationService>();
StackTraceExplorer\StackTraceExplorerTests.cs (3)
40var service = workspace.Services.GetRequiredService<IStackTraceExplorerService>(); 824var service = workspace.Services.GetRequiredService<IStackTraceExplorerService>(); 856var service = workspace.Services.GetRequiredService<IStackTraceExplorerService>();
ValueTracking\AbstractBaseValueTrackingTests.cs (2)
31var service = testWorkspace.Services.GetRequiredService<IValueTrackingService>(); 38var service = testWorkspace.Services.GetRequiredService<IValueTrackingService>();
Workspaces\TextFactoryTests.cs (6)
27var textFactoryService = Assert.IsType<EditorTextFactoryService>(workspace.Services.GetRequiredService<ITextFactoryService>()); 40var textFactoryService = Assert.IsType<EditorTextFactoryService>(workspace.Services.GetRequiredService<ITextFactoryService>()); 53var textFactoryService = Assert.IsType<EditorTextFactoryService>(workspace.Services.GetRequiredService<ITextFactoryService>()); 66var textFactoryService = Assert.IsType<EditorTextFactoryService>(workspace.Services.GetRequiredService<ITextFactoryService>()); 83var temporaryStorageService = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 103var temporaryStorageService = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>());
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
74var navigateService = workspace.Services.GetRequiredService<INavigateToLinkService>();
Peek\PeekableItemSource.cs (1)
128var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>();
Suggestions\FixAll\FixAllGetFixesService.cs (1)
20var previewService = workspace.Services.GetRequiredService<IPreviewDialogService>();
Suggestions\SuggestedActionsSource_Async.cs (1)
212var supportsFeatureService = workspace.Services.GetRequiredService<ITextBufferSupportsFeatureService>();
Microsoft.CodeAnalysis.ExternalAccess.Debugger (1)
GlassTestsHotReloadService.cs (1)
27_encService = services.GetRequiredService<IEditAndContinueWorkspaceService>().Service;
Microsoft.CodeAnalysis.ExternalAccess.FSharp (3)
Internal\Editor\FSharpNavigationBarItemService.cs (2)
70var navigationService = workspace.Services.GetRequiredService<IFSharpDocumentNavigationService>(); 80var notificationService = workspace.Services.GetRequiredService<INotificationService>();
LanguageServices\FSharpVisualStudioWorkspaceExtensions.cs (1)
17var metadataReferenceProvider = workspace.Services.GetRequiredService<VisualStudioMetadataReferenceManager>();
Microsoft.CodeAnalysis.Features (9)
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (2)
96var service = workspace.Services.GetRequiredService<IMetadataService>(); 106var assemblyResolverService = workspace.Services.GetRequiredService<IFrameworkAssemblyPathResolver>();
ChangeSignature\ChangeSignatureCodeActionOperation.cs (1)
40var notificationService = workspace.Services.GetRequiredService<INotificationService>();
DocumentSpanExtensions.cs (1)
18var service = workspace.Services.GetRequiredService<IDocumentNavigationService>();
ExternalAccess\UnitTesting\UnitTestingStackTraceServiceAccessorFactory.cs (1)
28var stackTraceExplorerService = workspaceServices.GetRequiredService<IStackTraceExplorerService>();
ExternalAccess\VSTypeScript\Api\VSTypeScriptDocumentNavigationServiceWrapper.cs (2)
21=> new(workspace.Services.GetRequiredService<IDocumentNavigationService>(), 22workspace.Services.GetRequiredService<IWorkspaceThreadingServiceProvider>());
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
50var navigationService = workspace.Services.GetRequiredService<ISymbolNavigationService>();
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
147var documentationProvider = sourceWorkspace.Services.GetRequiredService<IDocumentationProviderService>();
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
60var provider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>(); 125var provider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>();
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
70mockEncService = (MockEditAndContinueService)remoteWorkspace.Services.GetRequiredService<IEditAndContinueWorkspaceService>().Service;
Microsoft.CodeAnalysis.LanguageServer (2)
HostWorkspace\LanguageServerWorkspaceFactory.cs (1)
60var loaderProvider = Workspace.Services.GetRequiredService<IAnalyzerAssemblyLoaderProvider>();
HostWorkspace\MetadataService.cs (1)
22return new MetadataService(workspaceServices.GetRequiredService<IDocumentationProviderService>());
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
391var telemetryService = _hostWorkspaceServices.GetRequiredService<IWorkspaceTelemetryService>();
Services\EditAndContinue\RemoteEditAndContinueService.cs (1)
75=> GetWorkspace().Services.GetRequiredService<IEditAndContinueWorkspaceService>().Service;
Microsoft.CodeAnalysis.Workspaces (12)
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
32=> new SQLitePersistentStorageService(workspaceServices.GetRequiredService<IPersistentStorageConfiguration>(), _asyncListener);
TemporaryStorage\TemporaryStorageService.Factory.cs (1)
29var textFactory = workspaceServices.GetRequiredService<ITextFactoryService>();
Workspace\Host\HostWorkspaceServices.cs (3)
104get { return this.GetRequiredService<IPersistentStorageService>(); } 114get { return this.GetRequiredService<ITemporaryStorageService>(); } 122get { return this.GetRequiredService<ITextFactoryService>(); }
Workspace\Host\SolutionServices.cs (2)
39/// <inheritdoc cref="HostWorkspaceServices.GetRequiredService"/> 41=> _services.GetRequiredService<TWorkspaceService>();
Workspace\Workspace.cs (4)
77_legacyOptions = Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions; 81_taskSchedulerProvider = Services.GetRequiredService<ITaskSchedulerProvider>(); 83var listenerProvider = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>(); 445var provider = Services.GetRequiredService<IFallbackAnalyzerConfigOptionsProvider>();
Workspace\Workspace_SourceGeneration.cs (1)
36var configuration = this.Services.GetRequiredService<IWorkspaceConfigurationService>().Options;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Workspaces\TestWorkspace`1.cs (2)
74var partialSolutionsTestHook = Services.GetRequiredService<IWorkspacePartialSolutionsTestHook>(); 770var metadataService = Services.GetRequiredService<IMetadataService>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (11)
FindAllDeclarationsTests.TestSolutionsAndProject.cs (1)
84var remoteHostProvider = (InProcRemoteHostClientProvider)workspace.Services.GetRequiredService<IRemoteHostClientProvider>();
SolutionTests\SolutionTests.cs (1)
5387var optionService = workspace.Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions;
WorkspaceServiceTests\TemporaryStorageServiceTests.cs (9)
35var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 55var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 92var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 110var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 152var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 182var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 207var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 242var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 277var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>());
Microsoft.VisualStudio.LanguageServices (29)
CodeLens\CodeLensCallbackListener.cs (4)
61var service = _workspace.Services.GetRequiredService<ICodeLensReferencesService>(); 89var service = _workspace.Services.GetRequiredService<ICodeLensReferencesService>(); 115var service = _workspace.Services.GetRequiredService<ICodeLensReferencesService>(); 137var service = _workspace.Services.GetRequiredService<ICodeLensReferencesService>();
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
110var statusService = _workspace.Services.GetRequiredService<IWorkspaceStatusService>();
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (2)
69_codeAnalysisService = workspace.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>(); 352var projectMap = _workspace.Services.GetRequiredService<IHierarchyItemToProjectIdMap>();
EditorConfigSettings\SettingsEditorFactory.cs (1)
48_settingsDataProviderFactory = workspace.Services.GetRequiredService<ISettingsAggregator>();
ExternalAccess\LegacyCodeAnalysis\LegacyCodeAnalysisVisualStudioSuppressionFixServiceAccessor.cs (3)
37var errorReportingService = _workspace.Services.GetRequiredService<IErrorReportingService>(); 59var errorReportingService = _workspace.Services.GetRequiredService<IErrorReportingService>(); 81var errorReportingService = _workspace.Services.GetRequiredService<IErrorReportingService>();
Implementation\VirtualMemoryNotificationListener.cs (1)
161_workspace.Services.GetRequiredService<IErrorReportingService>()
NavigateTo\VisualStudioNavigateToItemProviderFactory.cs (1)
43if (_workspace.Services.GetRequiredService<IWorkspaceContextService>().IsInLspEditorContext())
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManagerFactory.cs (1)
28var temporaryStorage = (TemporaryStorageService)workspaceServices.GetRequiredService<ITemporaryStorageServiceInternal>();
ProjectSystem\VisualStudioProjectFactory.cs (1)
64_visualStudioWorkspaceImpl.Services.GetRequiredService<VisualStudioMetadataReferenceManager>();
ProjectSystem\VisualStudioWorkspace.cs (1)
78=> this.Services.GetRequiredService<IMetadataService>().GetReference(filePath, properties);
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
40var documentationProvider = Workspace.Services.GetRequiredService<IDocumentationProviderService>();
ProjectSystem\VisualStudioWorkspaceImpl.cs (4)
139_workspaceListener = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>().GetListener(); 174this.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>().Clear(); 222var telemetryService = (VisualStudioWorkspaceTelemetryService)Services.GetRequiredService<IWorkspaceTelemetryService>(); 716var documentTrackingService = this.Services.GetRequiredService<IDocumentTrackingService>();
ProjectSystem\VisualStudioWorkspaceImpl_SourceGenerators.cs (1)
57var workspaceStatusService = this.Services.GetRequiredService<IWorkspaceStatusService>();
Remote\VisualStudioRemoteHostClientProvider.cs (1)
71workspaceServices.GetRequiredService<IWorkspaceContextService>().IsCloudEnvironmentClient())
Remote\VisualStudioWorkspaceServiceHubConnector.cs (1)
44var service = workspace.Services.GetRequiredService<IRemoteHostClientProvider>();
Snippets\SnippetExpansionClient.cs (1)
1114var notificationService = workspace.Services.GetRequiredService<INotificationService>();
StackTraceExplorer\StackFrameViewModel.cs (1)
53_stackExplorerService = workspace.Services.GetRequiredService<IStackTraceExplorerService>();
SymbolSearch\AbstractDelayStartedService.cs (1)
107var statusService = this.Workspace.Services.GetRequiredService<IWorkspaceStatusService>();
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
148var previewChangeService = _workspace.Services.GetRequiredService<IPreviewDialogService>();
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
43=> _workspace.Services.GetRequiredService<IReferenceCleanupService>();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (4)
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
40var settingsAggregator = workspace.Services.GetRequiredService<ISettingsAggregator>();
EditorConfigSettings\DataProvider\DataProviderTests.cs (2)
39=> GetWorkspace("/a/b/proj1.csproj").Services.GetRequiredService<IWorkspaceSettingsProviderFactory<T>>(); 45=> GetWorkspace().Services.GetRequiredService<IWorkspaceSettingsProviderFactory<T>>();
PersistentStorage\AbstractPersistentStorageTests.cs (1)
843var configuration = workspace.Services.GetRequiredService<IPersistentStorageConfiguration>();
Microsoft.VisualStudio.LanguageServices.UnitTests (9)
ReferenceManager\VisualStudioMetadataReferenceManagerTests.vb (2)
22Dim tempStorageService = DirectCast(workspace.Services.GetRequiredService(Of ITemporaryStorageServiceInternal), TemporaryStorageService) 23Dim serializerService = DirectCast(workspace.Services.GetRequiredService(Of ISerializerService), SerializerService)
Snippets\CSharpSnippetExpansionClientTests.vb (3)
318Dim expansionClientFactory = workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)() 337Dim expansionClientFactory = workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)() 375Dim expansionClientFactory = workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)()
Snippets\SnippetTestState.vb (1)
56Dim snippetExpansionClientFactory = Workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)()
Snippets\VisualBasicSnippetExpansionClientTests.vb (3)
360Dim expansionClientFactory = workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)() 396Dim expansionClientFactory = workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)() 433Dim expansionClientFactory = workspace.Services.GetRequiredService(Of ISnippetExpansionClientFactory)()
Roslyn.VisualStudio.Next.UnitTests (7)
Remote\RemoteHostClientServiceFactoryTests.cs (2)
40var service = workspace.Services.GetRequiredService<IRemoteHostClientProvider>(); 74var service = workspace.Services.GetRequiredService<IRemoteHostClientProvider>();
Remote\SerializationValidator.cs (2)
78AssetStorage = services.GetRequiredService<ISolutionAssetStorageProvider>().AssetStorage; 79Serializer = services.GetRequiredService<ISerializerService>();
Services\SolutionServiceTests.cs (2)
1212var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 1326var assetSource = new SimpleAssetSource(workspace.Services.GetRequiredService<ISerializerService>(), map);
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
193var serializer = workspace.Services.GetRequiredService<ISerializerService>();