1 write to Services
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Workspace.cs (1)
74Services = host.CreateWorkspaceServices(this);
50 references to Services
dotnet-format (2)
Analyzers\AnalyzerReferenceInformationProvider.cs (1)
67var analyzerService = workspace.Services.GetService<IAnalyzerService>() ?? throw new NotSupportedException();
Analyzers\CodeStyleInformationProvider.cs (1)
26var analyzerService = workspace.Services.GetService<IAnalyzerService>() ?? throw new NotSupportedException();
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
181=> solution.Workspace.Services.GetExtendedLanguageServices(languageName);
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
181=> solution.Workspace.Services.GetExtendedLanguageServices(languageName);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
181=> solution.Workspace.Services.GetExtendedLanguageServices(languageName);
Microsoft.CodeAnalysis.CSharp.Features (1)
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (1)
38if (workspace.Services.GetService<IWorkspaceTelemetryService>()?.IsUserMicrosoftInternal is true)
Microsoft.CodeAnalysis.Features (19)
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (2)
97var service = workspace.Services.GetRequiredService<IMetadataService>(); 107var assemblyResolverService = workspace.Services.GetRequiredService<IFrameworkAssemblyPathResolver>();
ChangeSignature\ChangeSignatureCodeActionOperation.cs (1)
40var notificationService = workspace.Services.GetRequiredService<INotificationService>();
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsRefactoringProvider.cs (1)
26var services = document.Project.Solution.Workspace.Services.HostServices as IMefHostExportProvider;
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (1)
51_diagnosticAnalyzerService = _workspace.Services.GetRequiredService<IDiagnosticAnalyzerService>();
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)
20: 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)
107var service = workspace.Services.GetService<ILegacyGlobalOptionsWorkspaceService>();
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
289workspace.OnDocumentClosed(documentIdInfo.DocumentId, new WorkspaceFileTextLoader(workspace.Services.SolutionServices, fileInfo.TemporaryFilePath, MetadataAsSourceGeneratedFileInfo.Encoding));
MetadataAsSource\MetadataAsSourceFileService.cs (3)
94_workspace = new MetadataAsSourceWorkspace(this, sourceWorkspace.Services.HostServices); 164var threadingService = workspace.Services.GetRequiredService<IWorkspaceThreadingServiceProvider>().Service; 216workspace.OnDocumentClosed(documentId, new WorkspaceFileTextLoader(workspace.Services.SolutionServices, filePath, defaultEncoding: null));
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
137var documentationProvider = sourceWorkspace.Services.GetRequiredService<IDocumentationProviderService>(); 173var sourceLinkService = sourceWorkspace.Services.GetService<ISourceLinkService>(); 307var languageServices = workspace.Services.GetLanguageServices(languageName);
Microsoft.CodeAnalysis.Workspaces (21)
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)
61=> GetGenerator(workspace.Services.SolutionServices, language);
FindSymbols\SymbolFinder.cs (1)
51return FindSymbolAtPositionAsync(semanticModel, position, workspace.Services.SolutionServices, cancellationToken);
Formatting\Formatter.cs (2)
244var languageServices = workspace.Services.GetLanguageServices(node.Language); 319var 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);
Workspace\CommandLineProject.cs (1)
28var languageServices = workspace.Services.SolutionServices.GetLanguageServices(language);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
49public SolutionServices SolutionServices => this.Workspace.Services.SolutionServices;
Workspace\Solution\Solution.cs (2)
64new SolutionState(workspace.Kind, workspace.Services.SolutionServices, solutionAttributes, options, analyzerReferences, fallbackAnalyzerOptions), 79/// cref="Workspace.Services"/> when possible.
Workspace\Workspace.cs (4)
76_legacyOptions = Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions; 80_taskSchedulerProvider = Services.GetRequiredService<ITaskSchedulerProvider>(); 82var listenerProvider = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>(); 698Services.Dispose();
Workspace\Workspace_Events.cs (1)
195_workspaceEventListenerService ??= this.Services.GetService<IWorkspaceEventListenerService>();
Workspace\Workspace_SourceGeneration.cs (1)
37var configuration = this.Services.GetRequiredService<IWorkspaceConfigurationService>().Options;
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildProjectLoader.cs (1)
63: this(workspace.Services.SolutionServices, new DiagnosticReporter(workspace), properties)
MSBuild\MSBuildWorkspace.cs (2)
42_knownCommandLineParserLanguages = Services.SolutionServices.GetSupportedLanguages<ICommandLineParserService>(); 481.WithTextLoader(new WorkspaceFileTextLoader(Services.SolutionServices, fullPath, text.Encoding));
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
181=> solution.Workspace.Services.GetExtendedLanguageServices(languageName);