1 write to Services
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Workspace.cs (1)
76Services = host.CreateWorkspaceServices(this);
450 references to Services
AnalyzerRunner (2)
IncrementalAnalyzerRunner.cs (2)
39var exportProvider = _workspace.Services.SolutionServices.ExportProvider; 45var persistentStorageService = _workspace.Services.SolutionServices.GetPersistentStorageService();
IdeBenchmarks (2)
FormatterBenchmarks.cs (2)
50return Formatter.GetFormattedTextChanges(root, workspace.Services.SolutionServices, options, CancellationToken.None); 63return Formatter.GetFormattedTextChanges(root, workspace.Services.SolutionServices, options, CancellationToken.None);
IdeCoreBenchmarks (2)
FindReferencesBenchmarks.cs (1)
83var storageService = _workspace.Services.SolutionServices.GetPersistentStorageService();
NavigateToBenchmarks.cs (1)
185var storageService = _workspace.Services.SolutionServices.GetPersistentStorageService();
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
26var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (10)
30=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 37=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 44=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 51=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 58=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 65=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 72=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 79=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 86=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 92=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
37=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
147var factory = document.Project.Solution.Workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (19)
CodeActions\GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersTests.cs (1)
45var service = (TestPickMembersService)workspace.Services.GetService<IPickMembersService>();
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>();
Completion\CompletionProviders\LoadDirectiveCompletionProviderTests.cs (1)
86var languageServices = workspace.Services.GetLanguageServices(LanguageNames.CSharp);
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (1)
127var languageServices = workspace.Services.GetLanguageServices(LanguageNames.CSharp);
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (2)
49=> workspace.Services.SolutionServices.ExportProvider.GetExportedValue<IGlobalOptionService>(); 400var settingsProviderFactory = workspace.Services.GetRequiredService<IWorkspaceSettingsProviderFactory<NamingStyleSetting>>();
EncapsulateField\EncapsulateFieldTestState.cs (1)
37var notificationService = Workspace.Services.GetService<INotificationService>() as INotificationServiceCallback;
ExtractMethod\ExtractMethodMiscellaneousTests.cs (1)
143var callBackService = (INotificationServiceCallback)workspace.Services.GetRequiredService<INotificationService>();
Formatting\FormattingEngineTests.cs (2)
442var node = Formatter.Format(syntaxRoot, spans, workspace.Services.SolutionServices, options, rules: default, CancellationToken.None); 2549var formattedRoot = Formatter.Format(root, workspace.Services.SolutionServices, options, CancellationToken.None);
Formatting\Indentation\CSharpFormatterTestsBase.cs (2)
85var formattingRuleProvider = workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>(); 114var factory = (TestFormattingRuleFactoryServiceFactory.Factory)workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>();
Formatting\Indentation\SmartIndenterTests.cs (1)
3465var provider = (TestFormattingRuleFactoryServiceFactory.Factory)workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>();
LineSeparators\LineSeparatorTests.cs (1)
601var lineSeparatorService = Assert.IsType<CSharpLineSeparatorService>(workspace.Services.GetLanguageServices(LanguageNames.CSharp).GetRequiredService<ILineSeparatorService>());
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
166masWorkspace!.OnDocumentClosed(info.DocumentId, new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.FilePath, info.Encoding));
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
607var trackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>();
Microsoft.CodeAnalysis.CSharp.Features (1)
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (1)
38if (workspace.Services.GetService<IWorkspaceTelemetryService>()?.IsUserMicrosoftInternal is true)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Copilot\CSharpImplementNotImplementedExceptionFixProviderTests.cs (1)
597var copilotService = testWorkspace.Services.GetLanguageServices(LanguageNames.CSharp)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (11)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4603var elasticOnlyFormatted = Formatter.Format(newRoot, SyntaxAnnotation.ElasticAnnotation, _workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None).ToFullString();
Formatting\FormattingElasticTriviaTests.cs (5)
89var newCompilation = Formatter.Format(compilation, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None); 129var formatted = Formatter.Format(newRoot, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString(); 132var elasticOnlyFormatted = Formatter.Format(newRoot, SyntaxAnnotation.ElasticAnnotation, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString(); 135var annotationFormatted = Formatter.Format(newRoot, Formatter.Annotation, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString(); 185var newCompilation = Formatter.Format(compilation, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingMultipleSpanTests.cs (1)
169var result = Formatter.Format(root, TextSpan.FromBounds(0, 0), workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingTests.cs (2)
5237var newProperty = Formatter.Format(property, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None); 9345Formatter.Format(block, new AdhocWorkspace().Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingTriviaTests.cs (2)
1752var formatted = Formatter.Format(tree, workspace.Services.SolutionServices, options, CancellationToken.None); 1798var formatted = Formatter.Format(tree, workspace.Services.SolutionServices, options, CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures (42)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (2)
99var notificationService = workspace.Services.GetRequiredService<INotificationService>(); 117var previewService = workspace.Services.GetService<IPreviewDialogService>();
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
146if (workspace?.Services.SolutionServices is not { } solutionServices)
CodeActions\CodeActionEditHandlerService.cs (6)
113workspace.Services.GetService<INotificationService>()?.SendNotification( 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)
150var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 174var symbolNavigationService = workspace.Services.GetRequiredService<ISymbolNavigationService>();
EditAndContinue\ActiveStatementTaggerProvider.EventSource.cs (2)
16var trackingService = workspace.Services.GetService<IActiveStatementTrackingService>(); 26var trackingService = workspace.Services.GetService<IActiveStatementTrackingService>();
EditAndContinue\ActiveStatementTrackingService.cs (1)
122_compileTimeSolutionProvider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>();
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 (3)
67var indicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 90var notificationService = workspace.Services.GetRequiredService<INotificationService>(); 107var previewService = workspace.Services.GetService<IPreviewDialogService>();
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (2)
57var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 65var notificationService = workspace.Services.GetRequiredService<INotificationService>();
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
60var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>();
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (2)
71(errorMessage, severity) => workspace.Services.GetService<INotificationService>().SendNotification(errorMessage, severity: severity), 85var navigationService = workspace.Services.GetService<IDocumentNavigationService>();
InlineRename\CommandHandlers\AbstractRenameCommandHandler_RenameHandler.cs (2)
90var backgroundWorkIndicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 141var notificationService = workspace.Services.GetService<INotificationService>();
InlineRename\InlineRenameService.cs (1)
128var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>();
InlineRename\InlineRenameSession.cs (1)
188this.UndoManager = workspace.Services.GetService<IInlineRenameUndoManager>();
InlineRename\UndoManagerServiceFactory.cs (1)
43var textUndoHistoryService = workspace.Services.GetService<ITextUndoHistoryWorkspaceService>();
IntelliSense\QuickInfo\QuickInfoHyperLink.cs (1)
44var navigateToLinkService = _workspace.Services.GetRequiredService<INavigateToLinkService>();
Interactive\InteractiveSession.cs (2)
201var metadataService = _workspace.Services.GetRequiredService<IMetadataService>(); 297var metadataService = _workspace.Services.GetRequiredService<IMetadataService>();
Navigation\AbstractDefinitionLocationService.cs (1)
34var service = workspace.Services.GetRequiredService<IDocumentNavigationService>();
Organizing\OrganizeDocumentCommandHandler.cs (1)
129var indicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Remote\SolutionChecksumUpdater.cs (2)
62_globalOperationService = workspace.Services.SolutionServices.ExportProvider.GetExports<IGlobalOperationNotificationService>().FirstOrDefault()?.Value; 65_documentTrackingService = workspace.Services.GetRequiredService<IDocumentTrackingService>();
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
123var notificationService = workspace.Services.GetService<INotificationService>();
Shared\Extensions\HostWorkspaceServicesExtensions.cs (1)
42workspace.Services.SolutionServices.GetProjectServices(buffer.ContentType)?.Language : null;
Shared\Extensions\ITextBufferExtensions.cs (2)
20var workspaceContextService = workspace.Services.GetRequiredService<IWorkspaceContextService>(); 59service = workspace.Services.GetService<ITextBufferSupportsFeatureService>();
Shared\Preview\PreviewWorkspace.cs (1)
27: base(solution.Workspace.Services.HostServices, WorkspaceKind.Preview)
Undo\Extensions.cs (1)
19var undoService = workspace.Services.GetService<IGlobalUndoService>();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (10)
AbstractCommandHandlerTestState.cs (1)
70var contentType = Workspace.Services.GetLanguageServices(languageName).GetRequiredService<IContentTypeLanguageService>().GetDefaultContentType();
Completion\AbstractArgumentProviderTests`1.cs (1)
101var syntaxFacts = workspace.Services.GetLanguageServices(root.Language).GetRequiredService<ISyntaxFactsService>();
Formatting\CoreFormatterTestsBase.cs (6)
97if (workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>() is TestFormattingRuleFactoryServiceFactory.Factory factory && factory.BaseIndentation != 0 && factory.TextSpan.Contains(p.Position)) 192var formattingRuleProvider = workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>(); 215var newRootNode = Formatter.Format(root, spans, workspace.Services.SolutionServices, options, rules, CancellationToken.None); 228var result = Formatter.GetFormattedTextChanges(root, spans, workspace.Services.SolutionServices, options, rules, CancellationToken.None); 288var formattingService = workspace.Services.GetLanguageServices(node.Language).GetRequiredService<ISyntaxFormattingService>(); 290var result = Formatter.Format(node, workspace.Services.SolutionServices, options, CancellationToken.None);
Workspaces\EditorTestHostProject.cs (2)
61: base(workspace.Services, 89: base(workspace.Services, name, language, compilationOptions, parseOptions, [document], [], [], projectReferences, metadataReferences, analyzerReferences, assemblyName, defaultNamespace)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (40)
CodeFixes\CodeFixServiceTests.cs (4)
51var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>())); 286var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>(); 313var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>(); 762var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>()));
CodeGeneration\AbstractCodeGenerationTests.cs (2)
81var codeDefFactory = workspace.Services.GetLanguageServices(LanguageNames.CSharp).GetRequiredService<SyntaxGenerator>(); 102var codeDefFactory = workspace.Services.GetLanguageServices(LanguageNames.VisualBasic).GetRequiredService<SyntaxGenerator>();
CodeRefactorings\CodeRefactoringServiceTest.cs (1)
98var errorReportingService = (TestErrorReportingService)workspace.Services.GetRequiredService<IErrorReportingService>();
Diagnostics\DiagnosticAnalyzerServiceTests.cs (15)
44=> workspace.Services.SolutionServices.ExportProvider.GetExportedValue<IGlobalOptionService>(); 50var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 64var exportProvider = workspace.Services.SolutionServices.ExportProvider; 178var exportProvider = workspace.Services.SolutionServices.ExportProvider; 218var exportProvider = workspace.Services.SolutionServices.ExportProvider; 238var exportProvider = workspace.Services.SolutionServices.ExportProvider; 310var exportProvider = workspace.Services.SolutionServices.ExportProvider; 395var exportProvider = workspace.Services.SolutionServices.ExportProvider; 441var exportProvider = workspace.Services.SolutionServices.ExportProvider; 514var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetService<IDocumentTrackingService>(); 636var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 695AnalysisKind.Semantic, new DiagnosticAnalyzerInfoCache(), workspace.Services, 763analysisKind, new DiagnosticAnalyzerInfoCache(), workspace.Services, 818projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, 831projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false,
EditAndContinue\EditAndContinueLanguageServiceTests.cs (1)
256loader: new WorkspaceFileTextLoader(workspace.Services.SolutionServices, sourceFile.Path, Encoding.UTF8),
EditorConfigSettings\Data\CodeStyleSettingsTest.cs (1)
22=> workspace.Services.SolutionServices.ExportProvider.GetExportedValue<IGlobalOptionService>();
Options\GlobalOptionsTests.cs (1)
185var languageServices = workspace.Services.SolutionServices.GetLanguageServices(language);
Preview\PreviewWorkspaceTests.cs (1)
117var persistentService = previewWorkspace.Services.SolutionServices.GetPersistentStorageService();
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\DefaultMefHostTests.cs (2)
26var csservice = ws.Services.GetLanguageServices(LanguageNames.CSharp).GetService<Microsoft.CodeAnalysis.Completion.CompletionService>(); 29var vbservice = ws.Services.GetLanguageServices(LanguageNames.VisualBasic).GetService<Microsoft.CodeAnalysis.Completion.CompletionService>();
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 (13)
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
74var navigateService = workspace.Services.GetRequiredService<INavigateToLinkService>();
Peek\PeekableItemSource.cs (1)
128var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>();
Peek\PeekHelpers.cs (1)
53var syntaxFactsService = workspace.Services.GetLanguageServices(root.Language).GetService<ISyntaxFactsService>();
QuickInfo\Extensions.cs (1)
22var cloneServices = workspace.Services.SolutionServices.ExportProvider.GetExports<ITextBufferCloneService>();
Suggestions\FixAll\FixAllGetFixesService.cs (1)
20var previewService = workspace.Services.GetRequiredService<IPreviewDialogService>();
Suggestions\FixAll\FixMultipleOccurrencesService.cs (1)
74var extensionManager = workspace.Services.GetService<IExtensionManager>();
Suggestions\PreviewChanges\PreviewChangesCodeAction.cs (1)
37var previewDialogService = _workspace.Services.GetService<IPreviewDialogService>();
Suggestions\SuggestedActions\SuggestedAction.cs (2)
142await Workspace.Services.GetService<IExtensionManager>().PerformActionAsync( 218var extensionManager = Workspace.Services.GetService<IExtensionManager>();
Suggestions\SuggestedActionsSource_Async.cs (1)
211var supportsFeatureService = workspace.Services.GetRequiredService<ITextBufferSupportsFeatureService>();
Suggestions\SuggestedActionWithNestedFlavors.cs (3)
74var extensionManager = this.Workspace.Services.GetService<IExtensionManager>(); 149var previewPaneService = Workspace.Services.GetService<IPreviewPaneService>(); 160var extensionManager = this.Workspace.Services.GetService<IExtensionManager>();
Microsoft.CodeAnalysis.ExternalAccess.FSharp (8)
Completion\FSharpCompletionServiceWithProviders.cs (1)
15: base(workspace.Services.SolutionServices, AsynchronousOperationListenerProvider.NullProvider)
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>();
Navigation\FSharpDocumentNavigationService.cs (4)
25var service = workspace.Services.GetService<IDocumentNavigationService>(); 32var service = workspace.Services.GetService<IDocumentNavigationService>(); 39var service = workspace.Services.GetService<IDocumentNavigationService>(); 47var service = workspace.Services.GetService<IDocumentNavigationService>();
Microsoft.CodeAnalysis.Features (15)
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\SolutionCrawler\UnitTestingSolutionCrawlerService.cs (1)
42if (workspace.Services.GetService<IUnitTestingSolutionCrawlerRegistrationService>() is UnitTestingSolutionCrawlerRegistrationService registration)
ExternalAccess\VSTypeScript\Api\VSTypeScriptCompletionServiceWithProviders.cs (1)
19: base(workspace.Services.SolutionServices, AsynchronousOperationListenerProvider.NullProvider)
ExternalAccess\VSTypeScript\Api\VSTypeScriptDocumentNavigationServiceWrapper.cs (2)
21=> new(workspace.Services.GetRequiredService<IDocumentNavigationService>(), 22workspace.Services.GetRequiredService<IWorkspaceThreadingServiceProvider>());
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
49var navigationService = workspace.Services.GetRequiredService<ISymbolNavigationService>();
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (1)
104var service = workspace.Services.GetService<ILegacyGlobalOptionsWorkspaceService>();
MetadataAsSource\MetadataAsSourceFileService.cs (1)
92_workspace = new MetadataAsSourceWorkspace(this, sourceWorkspace.Services.HostServices);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (2)
146var documentationProvider = sourceWorkspace.Services.GetRequiredService<IDocumentationProviderService>(); 316var languageServices = workspace.Services.GetLanguageServices(languageName);
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
26var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
Microsoft.CodeAnalysis.Features.UnitTests (5)
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
60var provider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>(); 125var provider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>();
EditAndContinue\RemoteEditAndContinueServiceTests.cs (2)
54var clientProvider = (InProcRemoteHostClientProvider?)localWorkspace.Services.GetService<IRemoteHostClientProvider>(); 69mockEncService = (MockEditAndContinueService)remoteWorkspace.Services.GetRequiredService<IEditAndContinueWorkspaceService>().Service;
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
49var hotReload = new UnitTestingHotReloadService(workspace.Services);
Microsoft.CodeAnalysis.LanguageServer (4)
HostWorkspace\LanguageServerProjectSystem.cs (2)
244if (projectLanguage != null && _workspaceFactory.Workspace.Services.GetLanguageService<ICommandLineParserService>(projectLanguage) == null) 281var loadedProject = new LoadedProject(projectSystemProject, _workspaceFactory.Workspace.Services.SolutionServices, _fileChangeWatcher, _workspaceFactory.TargetFrameworkManager);
HostWorkspace\LanguageServerWorkspaceFactory.cs (1)
60var loaderProvider = Workspace.Services.GetRequiredService<IAnalyzerAssemblyLoaderProvider>();
HostWorkspace\WorkspaceProjectFactoryService.cs (1)
60var workspaceProject = new WorkspaceProject(project, _workspaceFactory.Workspace.Services.SolutionServices, _workspaceFactory.TargetFrameworkManager, _loggerFactory);
Microsoft.CodeAnalysis.Remote.ServiceHub (12)
ExternalAccess\UnitTesting\Api\UnitTestingBrokeredServiceImplementation.cs (1)
24return NewUnitTestingIncrementalAnalyzerProvider.TryRegister(workspace.Kind, workspace.Services.SolutionServices, analyzerName, provider);
Host\RemoteWorkspace.cs (2)
36=> new(solutionChecksum, assetCache, assetSource, this.Services.SolutionServices); 217solutionChecksum, this.Services.SolutionServices, cancellationToken).ConfigureAwait(false);
Host\RemoteWorkspace.SolutionCreator.cs (4)
74useAsync: true, deserializedAnalyzerReferences, _workspace.Services.SolutionServices, cancellationToken).ConfigureAwait(false); 383useAsync: true, deserializedAnalyzerReferences, _workspace.Services.SolutionServices, cancellationToken).ConfigureAwait(false); 624checksumFromRequest, _workspace.Services.SolutionServices, cancellationToken).ConfigureAwait(false); 625var workspace = new AdhocWorkspace(_workspace.Services.HostServices);
Services\AsynchronousOperationListener\RemoteAsynchronousOperationListenerService.cs (1)
40var exportProvider = workspace.Services.SolutionServices.ExportProvider;
Services\BrokeredServiceBase.cs (1)
79=> GetWorkspace().Services.SolutionServices;
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (2)
59var hostWorkspaceServices = this.GetWorkspace().Services; 112var service = GetWorkspace().Services.GetService<IPerformanceTrackerService>();
Services\EditAndContinue\RemoteEditAndContinueService.cs (1)
75=> GetWorkspace().Services.GetRequiredService<IEditAndContinueWorkspaceService>().Service;
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (8)
Formatting\FormattingTests.vb (4)
3021Dim result = Formatter.GetFormattedTextChanges(root, workspace.Services.SolutionServices, options, CancellationToken.None) 3028Dim result2 = Formatter.GetFormattedTextChanges(root, workspace.Services.SolutionServices, options, CancellationToken.None) 3788Dim result = Formatter.Format(root, goo, workspace.Services.SolutionServices, VisualBasicSyntaxFormattingOptions.Default, CancellationToken.None).ToString() 4605Dim formatted = Formatter.Format(tree, workspace.Services.SolutionServices, options, CancellationToken.None)
Formatting\VisualBasicFormattingTestBase.vb (4)
67Dim changes = Formatter.GetFormattedTextChanges(Await syntaxTree.GetRootAsync(), workspace.Services.SolutionServices, options, CancellationToken.None) 70changes = Formatter.GetFormattedTextChanges(Await syntaxTree.GetRootAsync(), (Await syntaxTree.GetRootAsync()).FullSpan, workspace.Services.SolutionServices, options, CancellationToken.None) 76changes = Formatter.GetFormattedTextChanges(Await syntaxTree.GetRootAsync(), spans, workspace.Services.SolutionServices, options, CancellationToken.None) 80AssertFormatWithTransformation(workspace.Services.SolutionServices, expected, syntaxTree.GetRoot(), spans, options, False)
Microsoft.CodeAnalysis.Workspaces (33)
Classification\Classifier.cs (1)
54return GetClassifiedSpans(workspace.Services.SolutionServices, project: null, semanticModel, textSpan, ClassificationOptions.Default, cancellationToken);
Editing\SyntaxEditor.cs (1)
64: this(root, (workspace ?? throw new ArgumentNullException(nameof(workspace))).Services.SolutionServices)
Editing\SyntaxGenerator.cs (1)
60=> GetGenerator(workspace.Services.SolutionServices, language);
FindSymbols\SymbolFinder.cs (1)
51return FindSymbolAtPositionAsync(semanticModel, position, workspace.Services.SolutionServices, cancellationToken);
Formatting\Formatter.cs (2)
242var languageServices = workspace.Services.GetLanguageServices(node.Language); 320var syntaxFormattingService = workspace.Services.GetRequiredLanguageService<ISyntaxFormattingService>(language);
Remote\RemoteHostClient.cs (2)
24var service = workspace.Services.GetService<IRemoteHostClientProvider>(); 42=> TryGetClientAsync(workspace.Services.SolutionServices, cancellationToken);
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
121if (workspace?.Services.GetService<IRemoteHostClientProvider>() is { } remoteHostClientProvider)
Simplification\Simplifier.cs (2)
86return Expand(node, semanticModel, workspace.Services.SolutionServices, expandInsideNode, expandParameter, cancellationToken); 131return Expand(token, semanticModel, workspace.Services.SolutionServices, expandInsideNode, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (10)
30=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 37=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 44=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 51=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 58=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 65=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 72=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 79=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 86=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 92=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
Workspace\CommandLineProject.cs (1)
28var languageServices = workspace.Services.SolutionServices.GetLanguageServices(language);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
48public SolutionServices SolutionServices => this.Workspace.Services.SolutionServices;
Workspace\Solution\Solution.cs (2)
65new SolutionState(workspace.Kind, workspace.Services.SolutionServices, solutionAttributes, options, analyzerReferences, fallbackAnalyzerOptions), 80/// cref="Workspace.Services"/> when possible.
Workspace\Workspace.cs (6)
78_legacyOptions = Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions; 82_taskSchedulerProvider = Services.GetRequiredService<ITaskSchedulerProvider>(); 84var listenerProvider = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>(); 446var provider = Services.GetRequiredService<IFallbackAnalyzerConfigOptionsProvider>(); 708this.Services.GetService<IWorkspaceEventListenerService>()?.Stop(); 715Services.Dispose();
Workspace\Workspace_Events.cs (1)
291this.Services.GetService<IWorkspaceEventListenerService>()?.EnsureListeners();
Workspace\Workspace_SourceGeneration.cs (1)
37var configuration = this.Services.GetRequiredService<IWorkspaceConfigurationService>().Options;
Microsoft.CodeAnalysis.Workspaces.MSBuild (4)
MSBuild\MSBuildProjectLoader.cs (1)
62_solutionServices = workspace.Services.SolutionServices;
MSBuild\MSBuildWorkspace.cs (3)
43_projectFileExtensionRegistry = new ProjectFileExtensionRegistry(Services.SolutionServices, _reporter); 45_loader = new MSBuildProjectLoader(Services.SolutionServices, _reporter, _loggerFactory, _projectFileExtensionRegistry, properties); 474.WithTextLoader(new WorkspaceFileTextLoader(Services.SolutionServices, fullPath, text.Encoding));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
VisualStudioMSBuildWorkspaceTests.cs (6)
49Assert.NotNull(workspace.Services); 50Assert.NotNull(workspace.Services.Workspace); 51Assert.Equal(workspace, workspace.Services.Workspace); 52Assert.NotNull(workspace.Services.HostServices); 53Assert.NotNull(workspace.Services.TextFactory); 3132var commandLineParser = workspace.Services
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (13)
Formatting\FormattingTestBase.cs (2)
58await AssertFormatAsync(workspace.Services.SolutionServices, expected, root, spans.AsImmutable(), formattingOptions, await document.GetTextAsync()); 61AssertFormatWithTransformation(workspace.Services.SolutionServices, expected, root, spans, formattingOptions, treeCompare, parseOptions);
Workspaces\TestHostProject.cs (1)
103: base(workspace.Services,
Workspaces\TestWorkspace_XmlConsumption.cs (6)
151var languageServices = Services.GetLanguageServices(language); 366if (!Services.SupportedLanguages.Contains(languageName)) 369string.Join(", ", Services.SupportedLanguages), 511var languageServices = Services.GetLanguageServices(language); 512var metadataService = Services.GetService<IMetadataService>(); 756var languageServices = Services.GetLanguageServices(languageName);
Workspaces\TestWorkspace`1.cs (4)
68var partialSolutionsTestHook = Services.GetRequiredService<IWorkspacePartialSolutionsTestHook>(); 91if (Services.GetService<INotificationService>() is INotificationServiceCallback callback) 721var languageServices = Services.GetLanguageServices(languageName); 743var metadataService = Services.GetRequiredService<IMetadataService>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (55)
Editing\SyntaxEditorTests.cs (2)
30var formatted = Formatter.Format(node, EmptyWorkspace.Services.SolutionServices, options, CancellationToken.None); 36=> new SyntaxEditor(root, EmptyWorkspace.Services.SolutionServices);
FindAllDeclarationsTests.TestSolutionsAndProject.cs (1)
84var remoteHostProvider = (InProcRemoteHostClientProvider)workspace.Services.GetRequiredService<IRemoteHostClientProvider>();
FormattingTests.cs (3)
37var service = workspace.Services.GetLanguageServices(LanguageNames.CSharp).GetService<ISyntaxFormattingService>(); 64var service = workspace.Services.GetLanguageServices(LanguageNames.VisualBasic).GetService<ISyntaxFormattingService>(); 86var formattedRoot = Formatter.Format(tree.GetRoot(), workspace.Services.SolutionServices, options, CancellationToken.None);
Remote\ServiceDescriptorTests.cs (1)
227var languageServices = workspace.Services.SolutionServices.GetLanguageServices(language);
SolutionTests\SolutionTests.cs (14)
2823.AddProject(ProjectInfo.Create(pm1, VersionStamp.Create(), "goo", "goo.dll", LanguageNames.CSharp, compilationOptions: workspace.Services 3304.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3353.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3420.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3845var service = ws.Services.GetLanguageServices(LanguageNames.CSharp).GetService<ITestLanguageService>(); 3849var service2 = ws2.Services.GetLanguageServices(LanguageNames.CSharp).GetService<ITestLanguageService>(); 3974var options = solution.Workspace.Services 4034compilationOptions: workspace.Services 4239compilationOptions: workspace.Services 5348compilationOptions: workspace.Services 5362compilationOptions: workspace.Services 5376compilationOptions: workspace.Services 5390compilationOptions: workspace.Services 5422var optionService = workspace.Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions;
UtilityTest\SourceTextSerializationTests.cs (1)
25var textService = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>());
WorkspaceServiceTests\GlobalOptionServiceTests.cs (13)
32var optionService = GetLegacyGlobalOptionService(workspace.Services); 56var optionService = GetLegacyGlobalOptionService(workspace1.Services); 93var optionService = GetLegacyGlobalOptionService(workspace1.Services); 146var optionService = GetLegacyGlobalOptionService(workspace.Services); 157var optionService = GetLegacyGlobalOptionService(workspace.Services); 167var globalOptions = GetGlobalOptionService(workspace.Services); 210var optionService = GetLegacyGlobalOptionService(workspace.Services); 223var optionSet = new SolutionOptionSet(GetLegacyGlobalOptionService(workspace.Services)); 242var optionService = GetLegacyGlobalOptionService(workspace.Services); 258var optionService = GetLegacyGlobalOptionService(workspace.Services); 280var optionService = GetLegacyGlobalOptionService(workspace.Services); 299var optionService = GetLegacyGlobalOptionService(workspace.Services); 315var optionService = GetLegacyGlobalOptionService(workspace.Services);
WorkspaceServiceTests\TemporaryStorageServiceTests.cs (18)
34var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 35var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 54var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 55var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 91var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 92var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 109var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 110var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 151var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 152var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 181var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 182var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 206var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 207var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 241var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 242var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>()); 276var textFactory = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>()); 277var service = Assert.IsType<TemporaryStorageService>(workspace.Services.GetRequiredService<ITemporaryStorageServiceInternal>());
WorkspaceTests\AdhocWorkspaceTests.cs (2)
396: base(solution.Workspace.Services.HostServices, solution.Workspace.Kind) 574var service = ws.Services.GetService<IDocumentTextDifferencingService>();
Microsoft.VisualStudio.LanguageServices (57)
CallHierarchy\CallHierarchyDetail.cs (1)
75var navigator = _workspace.Services.GetService<IDocumentNavigationService>();
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
175var workspaceStatusService = workspace.Services.GetService<IWorkspaceStatusService>();
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>();
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
15: base(solution.Workspace.Services.HostServices, WorkspaceKind.Debugger)
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
114var statusService = _workspace.Services.GetRequiredService<IWorkspaceStatusService>();
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.WorkspaceEventListener.cs (1)
38var setter = workspace.Services.GetService<ISolutionAnalyzerSetterWorkspaceService>();
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 (2)
49_workspaceCacheService = workspace.Services.GetService<IWorkspaceCacheService>() as WorkspaceCacheService; 161_workspace.Services.GetRequiredService<IErrorReportingService>()
InlineRename\InlineRenameUndoManager.cs (1)
105var textUndoHistoryService = workspace.Services.GetService<ITextUndoHistoryWorkspaceService>();
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (1)
107var languageServices = Workspace.Services.GetExtendedLanguageServices(_languageName);
LanguageService\AbstractLanguageService`2.cs (2)
108var formatter = this.Workspace.Services.GetLanguageServices(RoslynLanguageName).GetService<ISyntaxFormattingService>(); 222var languageServices = this.Workspace.Services.GetLanguageServices(RoslynLanguageName);
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (1)
68var ruleFactory = Workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>();
LanguageService\AbstractPackage`2.cs (2)
99_packageInstallerService = workspace.Services.GetService<IPackageInstallerService>() as PackageInstallerService; 100_symbolSearchService = workspace.Services.GetService<ISymbolSearchService>() as VisualStudioSymbolSearchService;
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (1)
58_libraryService = new Lazy<ILibraryService>(() => Workspace.Services.GetLanguageServices(_languageName).GetService<ILibraryService>());
NavigateTo\VisualStudioNavigateToItemProviderFactory.cs (1)
43if (_workspace.Services.GetRequiredService<IWorkspaceContextService>().IsInLspEditorContext())
Packaging\PackageInstallerServiceFactory.cs (2)
354var notificationService = Workspace.Services.GetService<INotificationService>(); 415var notificationService = Workspace.Services.GetService<INotificationService>();
ProjectSystem\MiscellaneousFilesWorkspace.cs (4)
63: base(visualStudioWorkspace.Services.HostServices, WorkspaceKind.MiscellaneousFiles) 131var manager = this.Services.GetService<VisualStudioMetadataReferenceManager>(); 296var fileLoader = new WorkspaceFileTextLoader(Services.SolutionServices, filePath, defaultEncoding: null); 298this, filePath, fileLoader, languageInformation, checksumAlgorithm, Services.SolutionServices, _metadataReferences);
ProjectSystem\VisualStudioProjectFactory.cs (1)
68_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 (5)
136_workspaceListener = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>().GetListener(); 171this.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>().Clear(); 219var telemetryService = (VisualStudioWorkspaceTelemetryService)Services.GetRequiredService<IWorkspaceTelemetryService>(); 713var documentTrackingService = this.Services.GetRequiredService<IDocumentTrackingService>(); 1574language => Services.GetLanguageServices(language).GetService<IProjectExistsUIContextProviderLanguageService>()?.GetUIContext());
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (3)
331w.OnDocumentClosed(documentId, new WorkspaceFileTextLoader(w.Services.SolutionServices, moniker, defaultEncoding: null)); 335w.OnAdditionalDocumentClosed(documentId, new WorkspaceFileTextLoader(w.Services.SolutionServices, moniker, defaultEncoding: null)); 340w.OnAnalyzerConfigDocumentClosed(documentId, new WorkspaceFileTextLoader(w.Services.SolutionServices, moniker, defaultEncoding: null));
ProjectSystem\VisualStudioWorkspaceImpl_SourceGenerators.cs (1)
57var workspaceStatusService = this.Services.GetRequiredService<IWorkspaceStatusService>();
Remote\VisualStudioRemoteHostClientProvider.cs (2)
70workspaceServices.SolutionServices.WorkspaceServices.HostServices != _vsWorkspace.Services.HostServices || 82_cachedVSInstance = new VisualStudioRemoteHostClientProvider(_vsWorkspace.Services.SolutionServices, _globalOptions, _brokeredServiceContainer, _threadingContext, _listenerProvider, _callbackDispatchers);
Remote\VisualStudioWorkspaceServiceHubConnector.cs (1)
44var service = workspace.Services.GetRequiredService<IRemoteHostClientProvider>();
Snippets\SnippetExpansionClient.cs (2)
126_argumentProviders = [.. workspace.Services.SolutionServices.SelectMatchingExtensionValues(ExtensionOrderer.Order(_allArgumentProviders), SubjectBuffer.ContentType)]; 1112var notificationService = workspace.Services.GetRequiredService<INotificationService>();
SymbolSearch\AbstractDelayStartedService.cs (1)
108var statusService = this.Workspace.Services.GetRequiredService<IWorkspaceStatusService>();
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
146var previewChangeService = _workspace.Services.GetRequiredService<IPreviewDialogService>();
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (1)
43=> _workspace.Services.GetRequiredService<IReferenceCleanupService>();
ValueTracking\ValueTrackedTreeItemViewModel.cs (1)
180var navigationService = Workspace.Services.GetService<IDocumentNavigationService>();
Venus\ContainedDocument.cs (3)
604_workspace.Services.GetLanguageServices(_project.Language).GetService<IContentTypeLanguageService>().GetDefaultContentType()); 974var service = _workspace.Services.GetLanguageServices(_project.Language).GetService<IVenusBraceMatchingService>(); 998var syntaxFact = _workspace.Services.GetLanguageServices(_project.Language).GetService<ISyntaxFactsService>();
Workspace\SourceGeneratedFileManager.cs (1)
272_workspaceConfigurationService = this.Workspace.Services.GetService<IWorkspaceConfigurationService>();
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Interactive\CSharpVsInteractiveWindowProvider.cs (1)
70workspace.Services.HostServices,
Options\NamingStylesOptionPage.cs (1)
28_notificationService = workspace.Services.GetService<INotificationService>();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (24)
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
40var settingsAggregator = workspace.Services.GetRequiredService<ISettingsAggregator>();
EditorConfigSettings\DataProvider\DataProviderTests.cs (4)
39=> GetWorkspace("/a/b/proj1.csproj").Services.GetRequiredService<IWorkspaceSettingsProviderFactory<T>>(); 42=> GetWorkspace("/a/b/proj1.csproj").Services.GetLanguageServices(languageName).GetRequiredService<ILanguageSettingsProviderFactory<T>>(); 45=> GetWorkspace().Services.GetRequiredService<IWorkspaceSettingsProviderFactory<T>>(); 48=> GetWorkspace().Services.GetLanguageServices(languageName).GetRequiredService<ILanguageSettingsProviderFactory<T>>();
F1Help\F1HelpTests.cs (1)
29var service = Assert.IsType<CSharpHelpContextService>(workspace.Services.GetLanguageServices(LanguageNames.CSharp).GetService<IHelpContextService>());
PersistentStorage\AbstractPersistentStorageTests.cs (18)
492var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 513var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 624var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 648var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 667var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 672var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 688var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 693var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 709var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 730var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 751var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 775var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 799var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 804var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 823var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 828var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 843var configuration = workspace.Services.GetRequiredService<IPersistentStorageConfiguration>(); 1013_storageService = (AbstractPersistentStorageService)solution.Workspace.Services.SolutionServices.GetPersistentStorageService();
Microsoft.VisualStudio.LanguageServices.LiveShare (3)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
80var projectInfo = CreateProjectInfo(project.Name, project.Language, [.. files.Select(f => f.LocalPath)], _remoteLanguageServiceWorkspace.Services.SolutionServices);
Client\RemoteLanguageServiceWorkspace.cs (2)
337loader: new WorkspaceFileTextLoader(Services.SolutionServices, filePath, defaultEncoding: null), 372OnDocumentClosed(id, new WorkspaceFileTextLoaderNoException(Services.SolutionServices, moniker, defaultEncoding: null));
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CallHierarchy\CallHierarchyTestState.vb (1)
94Dim notificationService = DirectCast(workspace.Services.GetService(Of INotificationService)(), INotificationServiceCallback)
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)()
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
Options\NamingStylesOptionPage.vb (1)
24_notificationService = workspace.Services.GetService(Of INotificationService)
ProjectSystemShim\TempPECompiler.vb (1)
28Dim metadataService = _workspace.Services.GetService(Of IMetadataService)
ProjectSystemShim\VisualBasicProject.vb (1)
52VisualStudioProjectOptionsProcessor = New OptionsProcessor(ProjectSystemProject, Workspace.Services.SolutionServices)
Roslyn.VisualStudio.DiagnosticsWindow (2)
OptionPages\PerformanceLoggersPage.cs (1)
42_workspaceServices = workspace.Services.SolutionServices;
VisualStudioDiagnosticsWindowPackage.cs (1)
94PerformanceLoggersPage.SetLoggers(globalOptions, _threadingContext, _workspace.Services.SolutionServices);
Roslyn.VisualStudio.Next.UnitTests (29)
Remote\RemoteHostClientServiceFactoryTests.cs (3)
35var exportProvider = workspace.Services.SolutionServices.ExportProvider; 40var service = workspace.Services.GetRequiredService<IRemoteHostClientProvider>(); 74var service = workspace.Services.GetRequiredService<IRemoteHostClientProvider>();
Services\AssetProviderTests.cs (9)
55var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), new Dictionary<Checksum, object>() { { checksum, data } }); 57var provider = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 86var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 88var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 114var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 116var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 139var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 141var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 170var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices);
Services\ServiceHubServicesTests.cs (2)
116var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 118return new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices);
Services\SolutionServiceTests.cs (13)
556Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 597Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 639Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 672Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 714Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 754Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 792Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 825Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 880Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 949Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 1211var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 1325var assetSource = new SimpleAssetSource(workspace.Services.GetRequiredService<ISerializerService>(), map); 1327return new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices);
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
191var remotableDataService = workspace.Services.GetService<ISolutionAssetStorageProvider>(); 192var serializer = workspace.Services.GetRequiredService<ISerializerService>();