1 write to Services
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Workspace.cs (1)
71Services = host.CreateWorkspaceServices(this);
455 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)
31=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 38=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 45=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 52=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 59=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 66=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 73=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 80=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 87=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 93=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
38=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
171var 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)
3478var 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\MiscTests.cs (1)
136var callBackService = (INotificationServiceCallback)workspace.Services.GetRequiredService<INotificationService>();
Formatting\FormattingEngineTests.cs (2)
443var node = Formatter.Format(syntaxRoot, spans, workspace.Services.SolutionServices, options, rules: default, CancellationToken.None); 2550var 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)
167masWorkspace!.OnDocumentClosed(info.DocumentId, new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.FilePath, info.Encoding));
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
600var 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.Workspaces.UnitTests (12)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4585var 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 (3)
4655var newProperty = Formatter.Format(property, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None); 8241Formatter.Format(block, new AdhocWorkspace().Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None); 9281=> Formatter.Format(SyntaxFactory.StructDeclaration("S"), DefaultWorkspace.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)
105var notificationService = workspace.Services.GetRequiredService<INotificationService>(); 123var 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)
149var navigationService = workspace.Services.GetRequiredService<IDocumentNavigationService>(); 173var 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)
69var indicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 92var notificationService = workspace.Services.GetRequiredService<INotificationService>(); 109var previewService = workspace.Services.GetService<IPreviewDialogService>();
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>();
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)
91var backgroundWorkIndicatorFactory = workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 142var notificationService = workspace.Services.GetService<INotificationService>();
InlineRename\InlineRenameService.cs (1)
129var 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)
185var metadataService = _workspace.Services.GetRequiredService<IMetadataService>(); 281var 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 (2)
60_globalOperationService = workspace.Services.SolutionServices.ExportProvider.GetExports<IGlobalOperationNotificationService>().FirstOrDefault()?.Value; 63_documentTrackingService = workspace.Services.GetRequiredService<IDocumentTrackingService>();
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
128var 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 (12)
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);
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
556_codeAnalysisService = testWorkspace.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>(); 638var languageServer = (RoslynLanguageServer)factory.Create(jsonRpc, jsonMessageFormatter.JsonSerializerOptions, capabilitiesProvider, serverKind, logger, workspace.Services.HostServices);
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>())); 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>()));
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)
45=> workspace.Services.SolutionServices.ExportProvider.GetExportedValue<IGlobalOptionService>(); 51var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 65var exportProvider = workspace.Services.SolutionServices.ExportProvider; 180var exportProvider = workspace.Services.SolutionServices.ExportProvider; 221var exportProvider = workspace.Services.SolutionServices.ExportProvider; 243var exportProvider = workspace.Services.SolutionServices.ExportProvider; 315var exportProvider = workspace.Services.SolutionServices.ExportProvider; 401var exportProvider = workspace.Services.SolutionServices.ExportProvider; 447var exportProvider = workspace.Services.SolutionServices.ExportProvider; 523var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetService<IDocumentTrackingService>(); 647var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 707AnalysisKind.Semantic, new DiagnosticAnalyzerInfoCache(), workspace.Services, 775analysisKind, new DiagnosticAnalyzerInfoCache(), workspace.Services, 830projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, reportSuppressedDiagnostics: false, 843projectAnalyzerIds: [], analyzerIds, kind, diagnosticAnalyzerInfoCache, workspace.Services, isExplicit: false, reportSuppressedDiagnostics: false,
EditAndContinue\EditAndContinueLanguageServiceTests.cs (1)
251loader: 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)
23var cloneServices = workspace.Services.SolutionServices.ExportProvider.GetExports<ITextBufferCloneService>();
Suggestions\FixAll\FixAllGetFixesService.cs (1)
20var previewService = workspace.Services.GetRequiredService<IPreviewDialogService>();
Suggestions\FixAll\FixMultipleOccurrencesService.cs (1)
81var 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)
212var supportsFeatureService = workspace.Services.GetRequiredService<ITextBufferSupportsFeatureService>();
Suggestions\SuggestedActionWithNestedFlavors.cs (3)
75var extensionManager = this.Workspace.Services.GetService<IExtensionManager>(); 150var previewPaneService = Workspace.Services.GetService<IPreviewPaneService>(); 161var 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)
50var 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>(); 304var 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.Test.Utilities (1)
Diagnostics\TestDiagnosticAnalyzerDriver.cs (1)
30var mefServices = workspace.Services.SolutionServices.ExportProvider;
Microsoft.CodeAnalysis.Features.UnitTests (7)
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
60var provider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>(); 125var provider = workspace.Services.GetRequiredService<ICompileTimeSolutionProvider>();
EditAndContinue\RemoteEditAndContinueServiceTests.cs (2)
55var clientProvider = (InProcRemoteHostClientProvider?)localWorkspace.Services.GetService<IRemoteHostClientProvider>(); 70mockEncService = (MockEditAndContinueService)remoteWorkspace.Services.GetRequiredService<IEditAndContinueWorkspaceService>().Service;
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
50var hotReload = new UnitTestingHotReloadService(workspace.Services);
EditAndContinue\WatchHotReloadServiceTests.cs (2)
62var hotReload = new WatchHotReloadService(workspace.Services, ["Baseline", "AddDefinitionToExistingType", "NewTypeDefinition"]); 159var hotReload = new WatchHotReloadService(workspace.Services, ["Baseline", "AddDefinitionToExistingType", "NewTypeDefinition"]);
Microsoft.CodeAnalysis.LanguageServer (4)
HostWorkspace\LanguageServerProjectSystem.cs (2)
243if (projectLanguage != null && _workspaceFactory.Workspace.Services.GetLanguageService<ICommandLineParserService>(projectLanguage) == null) 280var 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)
62var workspaceProject = new WorkspaceProject(project, _workspaceFactory.Workspace.Services.SolutionServices, _workspaceFactory.TargetFrameworkManager, _loggerFactory);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
VSTypeScriptHandlerTests.cs (1)
122workspace.Services.HostServices,
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)
37=> new(solutionChecksum, assetCache, assetSource, this.Services.SolutionServices); 218solutionChecksum, this.Services.SolutionServices, cancellationToken).ConfigureAwait(false);
Host\RemoteWorkspace.SolutionCreator.cs (4)
76useAsync: true, deserializedAnalyzerReferences, _workspace.Services.SolutionServices, cancellationToken).ConfigureAwait(false); 385useAsync: true, deserializedAnalyzerReferences, _workspace.Services.SolutionServices, cancellationToken).ConfigureAwait(false); 622checksumFromRequest, _workspace.Services.SolutionServices, cancellationToken).ConfigureAwait(false); 623var workspace = new AdhocWorkspace(_workspace.Services.HostServices);
Services\AsynchronousOperationListener\RemoteAsynchronousOperationListenerService.cs (1)
41var exportProvider = workspace.Services.SolutionServices.ExportProvider;
Services\BrokeredServiceBase.cs (1)
80=> GetWorkspace().Services.SolutionServices;
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (2)
62var hostWorkspaceServices = this.GetWorkspace().Services; 116var 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)
65: this(root, (workspace ?? throw new ArgumentNullException(nameof(workspace))).Services.SolutionServices)
Editing\SyntaxGenerator.cs (1)
60=> GetGenerator(workspace.Services.SolutionServices, language);
FindSymbols\SymbolFinder.cs (1)
52return 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)
31=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 38=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 45=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 52=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 59=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 66=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 73=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 80=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 87=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 93=> 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)
49public 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)
73_legacyOptions = Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions; 77var schedulerProvider = Services.GetRequiredService<ITaskSchedulerProvider>(); 78var listenerProvider = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>(); 435var provider = Services.GetRequiredService<IFallbackAnalyzerConfigOptionsProvider>(); 687this.Services.GetService<IWorkspaceEventListenerService>()?.Stop(); 694Services.Dispose();
Workspace\Workspace_Events.cs (1)
255this.Services.GetService<IWorkspaceEventListenerService>()?.EnsureListeners();
Workspace\Workspace_SourceGeneration.cs (1)
36var 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); 472.WithTextLoader(new WorkspaceFileTextLoader(Services.SolutionServices, fullPath, text.Encoding));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
VisualStudioMSBuildWorkspaceTests.cs (6)
44Assert.NotNull(workspace.Services); 45Assert.NotNull(workspace.Services.Workspace); 46Assert.Equal(workspace, workspace.Services.Workspace); 47Assert.NotNull(workspace.Services.HostServices); 48Assert.NotNull(workspace.Services.TextFactory); 3127var 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)
152var languageServices = Services.GetLanguageServices(language); 367if (!Services.SupportedLanguages.Contains(languageName)) 370string.Join(", ", Services.SupportedLanguages), 513var languageServices = Services.GetLanguageServices(language); 514var metadataService = Services.GetService<IMetadataService>(); 766var languageServices = Services.GetLanguageServices(languageName);
Workspaces\TestWorkspace`1.cs (4)
74var partialSolutionsTestHook = Services.GetRequiredService<IWorkspacePartialSolutionsTestHook>(); 98if (Services.GetService<INotificationService>() is INotificationServiceCallback callback) 748var languageServices = Services.GetLanguageServices(languageName); 770var metadataService = Services.GetRequiredService<IMetadataService>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (47)
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)
230var languageServices = workspace.Services.SolutionServices.GetLanguageServices(language);
SolutionTests\SolutionTests.cs (6)
3301.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3350.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3417.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3842var service = ws.Services.GetLanguageServices(LanguageNames.CSharp).GetService<ITestLanguageService>(); 3846var service2 = ws2.Services.GetLanguageServices(LanguageNames.CSharp).GetService<ITestLanguageService>(); 5387var optionService = workspace.Services.GetRequiredService<ILegacyWorkspaceOptionService>().LegacyGlobalOptions;
UtilityTest\SourceTextSerializationTests.cs (1)
25var textService = Assert.IsType<TextFactoryService>(workspace.Services.GetService<ITextFactoryService>());
WorkspaceServiceTests\GlobalOptionServiceTests.cs (13)
33var optionService = GetLegacyGlobalOptionService(workspace.Services); 57var optionService = GetLegacyGlobalOptionService(workspace1.Services); 94var optionService = GetLegacyGlobalOptionService(workspace1.Services); 147var optionService = GetLegacyGlobalOptionService(workspace.Services); 158var optionService = GetLegacyGlobalOptionService(workspace.Services); 168var globalOptions = GetGlobalOptionService(workspace.Services); 211var optionService = GetLegacyGlobalOptionService(workspace.Services); 224var optionSet = new SolutionOptionSet(GetLegacyGlobalOptionService(workspace.Services)); 243var optionService = GetLegacyGlobalOptionService(workspace.Services); 259var optionService = GetLegacyGlobalOptionService(workspace.Services); 281var optionService = GetLegacyGlobalOptionService(workspace.Services); 300var optionService = GetLegacyGlobalOptionService(workspace.Services); 316var 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 (64)
CallHierarchy\CallHierarchyDetail.cs (1)
75var navigator = _workspace.Services.GetService<IDocumentNavigationService>();
CodeCleanup\AbstractCodeCleanUpFixer.cs (2)
78var hierarchyToProjectMap = _workspace.Services.GetRequiredService<IHierarchyItemToProjectIdMap>(); 186var 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)
110var statusService = _workspace.Services.GetRequiredService<IWorkspaceStatusService>();
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.WorkspaceEventListener.cs (1)
44var 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\AbstractEditorFactory.cs (1)
352var formattedRoot = Formatter.Format(rootToFormat, workspace.Services.SolutionServices, cleanupOptions.FormattingOptions, cancellationToken);
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)
106var formatter = this.Workspace.Services.GetLanguageServices(RoslynLanguageName).GetService<ISyntaxFormattingService>(); 220var languageServices = this.Workspace.Services.GetLanguageServices(RoslynLanguageName);
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (1)
68var ruleFactory = Workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>();
LanguageService\AbstractPackage`2.cs (2)
97_packageInstallerService = workspace.Services.GetService<IPackageInstallerService>() as PackageInstallerService; 98_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)
353var notificationService = Workspace.Services.GetService<INotificationService>(); 414var notificationService = Workspace.Services.GetService<INotificationService>();
ProjectSystem\MiscellaneousFilesWorkspace.cs (4)
65: base(visualStudioWorkspace.Services.HostServices, WorkspaceKind.MiscellaneousFiles) 133var manager = this.Services.GetService<VisualStudioMetadataReferenceManager>(); 295var fileLoader = new WorkspaceFileTextLoader(Services.SolutionServices, filePath, defaultEncoding: null); 297this, filePath, fileLoader, languageInformation, checksumAlgorithm, Services.SolutionServices, _metadataReferences);
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 (5)
139_workspaceListener = Services.GetRequiredService<IWorkspaceAsynchronousOperationListenerProvider>().GetListener(); 174this.Services.GetRequiredService<ICodeAnalysisDiagnosticAnalyzerService>().Clear(); 222var telemetryService = (VisualStudioWorkspaceTelemetryService)Services.GetRequiredService<IWorkspaceTelemetryService>(); 716var documentTrackingService = this.Services.GetRequiredService<IDocumentTrackingService>(); 1578language => 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)
125_argumentProviders = workspace.Services.SolutionServices 1109var notificationService = workspace.Services.GetRequiredService<INotificationService>();
StackTraceExplorer\StackFrameViewModel.cs (2)
53_stackExplorerService = workspace.Services.GetRequiredService<IStackTraceExplorerService>(); 130var navigationService = _workspace.Services.GetService<IDocumentNavigationService>();
SymbolSearch\AbstractDelayStartedService.cs (1)
107var statusService = this.Workspace.Services.GetRequiredService<IWorkspaceStatusService>();
SymbolSearch\VisualStudioSymbolSearchService.cs (1)
72_installerService = workspace.Services.GetRequiredService<IPackageInstallerService>();
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
148var previewChangeService = _workspace.Services.GetRequiredService<IPreviewDialogService>();
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
85_fixMultipleOccurencesService = workspace.Services.GetRequiredService<IFixMultipleOccurrencesService>(); 86_projectMap = workspace.Services.GetRequiredService<IHierarchyItemToProjectIdMap>();
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)
271_workspaceConfigurationService = this.Workspace.Services.GetService<IWorkspaceConfigurationService>();
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Interactive\CSharpVsInteractiveWindowProvider.cs (1)
74workspace.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)
30var 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).ToImmutableArray(), _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)
54var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), new Dictionary<Checksum, object>() { { checksum, data } }); 56var provider = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 85var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 87var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 113var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 115var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 138var assetSource = new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map); 140var service = new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices); 169var 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)
557Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 598Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 640Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 673Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 715Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 755Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 793Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 826Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 881Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 950Checksum.Create(ImmutableArray.CreateRange(Guid.NewGuid().ToByteArray())), new SolutionAssetCache(), new SimpleAssetSource(workspace.Services.GetService<ISerializerService>(), map), remoteWorkspace.Services.SolutionServices); 1170var documentTrackingService = (TestDocumentTrackingService)workspace.Services.GetRequiredService<IDocumentTrackingService>(); 1284var assetSource = new SimpleAssetSource(workspace.Services.GetRequiredService<ISerializerService>(), map); 1286return new AssetProvider(sessionId, storage, assetSource, remoteWorkspace.Services.SolutionServices);
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
192var remotableDataService = workspace.Services.GetService<ISolutionAssetStorageProvider>(); 193var serializer = workspace.Services.GetRequiredService<ISerializerService>();