96 references to GetRequiredService
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\AddImport\AddImportPlacementOptionsProviders.cs (1)
25=> languageServices.GetRequiredService<IAddImportsService>().GetAddImportOptions(options, allowInHiddenRegions ?? AddImportPlacementOptions.Default.AllowInHiddenRegions);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
34_symbolDeclarationService = languageServices.GetRequiredService<ISymbolDeclarationService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
19=> languageServices.GetRequiredService<ICodeGenerationService>().GetCodeGenerationOptions(options); 51=> languageServices.GetRequiredService<ICodeGenerationService>().DefaultOptions;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (3)
44var syntaxFacts = document.LanguageServices.GetRequiredService<ISyntaxFactsService>(); 45var headerFacts = document.LanguageServices.GetRequiredService<IHeaderFactsService>(); 163var syntaxKinds = document.LanguageServices.GetRequiredService<ISyntaxKindsService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (2)
15=> languageServices.GetRequiredService<ISyntaxFormattingService>().GetFormattingOptions(options); 27=> languageServices.GetRequiredService<ISyntaxFormattingService>().DefaultOptions;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (2)
50var syntaxGenerator = document.LanguageServices.GetRequiredService<SyntaxGeneratorInternal>(); 58var indenter = document.LanguageServices.GetRequiredService<IIndentationService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplifierOptionsProviders.cs (1)
27=> languageServices.GetRequiredService<ISimplificationService>().DefaultOptions;
Microsoft.CodeAnalysis.CSharp.Features (3)
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
154var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>();
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
97var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>(); 127var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>();
Microsoft.CodeAnalysis.EditorFeatures (3)
Organizing\OrganizeDocumentCommandHandler.cs (1)
63var organizeImportsService = workspace.Services.SolutionServices.GetProjectServices(args.SubjectBuffer)!.GetRequiredService<IOrganizeImportsService>();
Preview\AbstractPreviewFactoryService.cs (1)
799oldDocument.Project.Services.GetRequiredService<IContentTypeLanguageService>().GetDefaultContentType());
Shared\Extensions\HostWorkspaceServicesExtensions.cs (1)
83l => hostWorkspaceServices.GetLanguageServices(l).GetRequiredService<IContentTypeLanguageService>().GetDefaultContentType().TypeName);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractCompletionProviderTests.cs (1)
104var completionService = project.Services.GetRequiredService<CompletionService>();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Completion\CompletionServiceTests.cs (1)
44var completionService = project.Services.GetRequiredService<CompletionService>();
Microsoft.CodeAnalysis.Features (14)
AddImport\AbstractAddImportFeatureService.cs (1)
423var compilationService = project.Services.GetRequiredService<ICompilationFactoryService>();
ChangeSignature\AbstractChangeSignatureService.cs (1)
976var syntaxFacts = services.GetRequiredService<ISyntaxFactsService>();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
86var syntaxFacts = _project.Services.GetRequiredService<ISyntaxFactsService>();
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
262var syntaxFacts = project.Services.GetRequiredService<ISyntaxFactsService>();
EditAndContinue\DebuggingSession.cs (1)
839var analyzer = newProject.Services.GetRequiredService<IEditAndContinueAnalyzer>();
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (1)
131var analyzer = newDocument.Project.Services.GetRequiredService<IEditAndContinueAnalyzer>();
EditAndContinue\EditSession.cs (1)
624var analyzer = newProject.Services.GetRequiredService<IEditAndContinueAnalyzer>();
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
173var formatter = LanguageServices.GetRequiredService<IDocumentationCommentFormattingService>();
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AnonymousTypes.cs (1)
32var info = LanguageServices.GetRequiredService<IStructuralTypeDisplayService>().GetTypeDisplayInfo(
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
37: sourceProject.Solution.Services.GetLanguageServices(LanguageName).GetRequiredService<ISyntaxTreeFactoryService>().GetDefaultParseOptionsWithLatestLanguageVersion();
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
154var compilationFactory = sourceProject.Services.GetRequiredService<ICompilationFactoryService>();
PullMemberUp\MembersPuller.cs (2)
97var codeGenerationService = document.Project.Services.GetRequiredService<ICodeGenerationService>(); 272var codeGenerationService = document.Project.Services.GetRequiredService<ICodeGenerationService>();
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
194var syntaxFacts = languageServices.GetRequiredService<ISyntaxFactsService>();
Microsoft.CodeAnalysis.Features.UnitTests (5)
EditAndContinue\ActiveStatementsMapTests.cs (3)
122var analyzer = project.Services.GetRequiredService<IEditAndContinueAnalyzer>(); 177var analyzer = project.Services.GetRequiredService<IEditAndContinueAnalyzer>(); 228var analyzer = project.Services.GetRequiredService<IEditAndContinueAnalyzer>();
EditAndContinue\EditSessionActiveStatementsTests.cs (2)
227var analyzer = solution.GetProject(projectId).Services.GetRequiredService<IEditAndContinueAnalyzer>(); 685var analyzer = solution.GetProject(project.Id).Services.GetRequiredService<IEditAndContinueAnalyzer>();
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
ExternalAccess\Razor\SimplifyMethodHandler.cs (1)
68var simplificationService = originalDocument.Project.Services.GetRequiredService<ISimplificationService>();
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
41var breakpointService = document.Project.Services.GetRequiredService<IBreakpointResolutionService>();
Handler\Completion\CompletionResolveHandler.cs (1)
102var completionService = document.Project.Services.GetRequiredService<CompletionService>();
Handler\Formatting\FormatDocumentOnTypeHandler.cs (1)
54var formattingService = document.Project.Services.GetRequiredService<ISyntaxFormattingService>();
Handler\Symbols\DocumentSymbolsHandler.cs (1)
55var navBarService = document.Project.Services.GetRequiredService<INavigationBarItemService>();
Microsoft.CodeAnalysis.Workspaces (44)
Classification\Classifier.cs (1)
79var classificationService = projectServices.GetRequiredService<ISyntaxClassificationService>();
Editing\SyntaxGenerator.cs (2)
66=> services.GetLanguageServices(language).GetRequiredService<SyntaxGenerator>(); 78=> project.Services.GetRequiredService<SyntaxGenerator>();
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
402var factory = project.Services.GetRequiredService<ICompilationFactoryService>();
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
54project.Services.GetRequiredService<ISyntaxFactsService>().StringComparer);
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
84if (TryGetNameWithoutAttributeSuffix(typeName, project.Services.GetRequiredService<ISyntaxFactsService>(), out var simpleName))
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (1)
88var syntaxFacts = project.Services.GetRequiredService<ISyntaxFactsService>();
FindSymbols\Shared\AbstractSyntaxIndex.cs (1)
126var syntaxKinds = project.LanguageServices.GetRequiredService<ISyntaxKindsService>();
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (1)
43var syntaxFacts = project.LanguageServices.GetRequiredService<ISyntaxFactsService>();
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex_Create.cs (1)
18var infoFactory = project.LanguageServices.GetRequiredService<IDeclaredSymbolInfoFactoryService>();
Rename\ConflictEngine\ConflictResolver.cs (3)
157var renameRewriterLanguageService = languageServices.GetRequiredService<IRenameRewriterLanguageService>(); 158var syntaxFactsLanguageService = languageServices.GetRequiredService<ISyntaxFactsService>(); 206var renameRewriterService = implicitReferenceLocationsPerLanguage.First().Document.Project.Services.GetRequiredService<IRenameRewriterLanguageService>();
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
358var syntaxFactsService = newDocument.Project.Services.GetRequiredService<ISyntaxFactsService>();
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
131var isCaseSensitive = solution.Services.GetLanguageServices(reference.Definition.Language).GetRequiredService<ISyntaxFactsService>().IsCaseSensitive;
Shared\Extensions\ITypeSymbolExtensions.cs (2)
150var semanticFacts = provider.GetRequiredService<ISemanticFactsService>(); 164var syntaxFacts = provider.GetRequiredService<ISyntaxFactsService>();
Shared\Extensions\SemanticModelExtensions.cs (3)
77var syntaxFacts = languageServices.GetRequiredService<ISyntaxFactsService>(); 78var syntaxKinds = languageServices.GetRequiredService<ISyntaxKindsService>(); 83var semanticFacts = languageServices.GetRequiredService<ISemanticFactsService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\AddImport\AddImportPlacementOptionsProviders.cs (1)
25=> languageServices.GetRequiredService<IAddImportsService>().GetAddImportOptions(options, allowInHiddenRegions ?? AddImportPlacementOptions.Default.AllowInHiddenRegions);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
34_symbolDeclarationService = languageServices.GetRequiredService<ISymbolDeclarationService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
19=> languageServices.GetRequiredService<ICodeGenerationService>().GetCodeGenerationOptions(options); 51=> languageServices.GetRequiredService<ICodeGenerationService>().DefaultOptions;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (3)
44var syntaxFacts = document.LanguageServices.GetRequiredService<ISyntaxFactsService>(); 45var headerFacts = document.LanguageServices.GetRequiredService<IHeaderFactsService>(); 163var syntaxKinds = document.LanguageServices.GetRequiredService<ISyntaxKindsService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
29=> project.Services.GetRequiredService<TLanguageService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (2)
15=> languageServices.GetRequiredService<ISyntaxFormattingService>().GetFormattingOptions(options); 27=> languageServices.GetRequiredService<ISyntaxFormattingService>().DefaultOptions;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (2)
50var syntaxGenerator = document.LanguageServices.GetRequiredService<SyntaxGeneratorInternal>(); 58var indenter = document.LanguageServices.GetRequiredService<IIndentationService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplifierOptionsProviders.cs (1)
27=> languageServices.GetRequiredService<ISimplificationService>().DefaultOptions;
Workspace\CommandLineProject.cs (1)
34var commandLineParser = languageServices.GetRequiredService<ICommandLineParserService>();
Workspace\Host\SolutionServices.cs (1)
62=> this.GetLanguageServices(language).GetRequiredService<TLanguageService>();
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (1)
53_commandLineParserService = workspaceServices.GetLanguageServices(project.Language).GetRequiredService<ICommandLineParserService>();
Workspace\Solution\DocumentState.cs (4)
170var treeFactory = languageServices.GetRequiredService<ISyntaxTreeFactoryService>(); 357var syntaxKinds = LanguageServices.GetRequiredService<ISyntaxKindsService>(); 360var treeFactory = LanguageServices.GetRequiredService<ISyntaxTreeFactoryService>(); 516var syntaxTreeFactory = LanguageServices.GetRequiredService<ISyntaxTreeFactoryService>();
Workspace\Solution\DocumentState_LinkedFileReuse.cs (2)
146var treeFactory = languageServices.GetRequiredService<ISyntaxTreeFactoryService>(); 215var syntaxKinds = languageServices.GetRequiredService<ISyntaxKindsService>();
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
649var compilationFactory = this.ProjectState.LanguageServices.GetRequiredService<ICompilationFactoryService>();
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
395var compilationFactory = projectState.LanguageServices.GetRequiredService<ICompilationFactoryService>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
1745var defaultOptions = solution.Projects.Single().Services.GetRequiredService<ICompilationFactoryService>().GetDefaultCompilationOptions();
Microsoft.VisualStudio.LanguageServices (6)
Preview\PreviewUpdater.cs (1)
82var contentTypeService = document.Project.Services.GetRequiredService<IContentTypeLanguageService>();
ProjectSystem\VisualStudioWorkspaceImpl.cs (2)
396=> project.Services.GetRequiredService<ICompilationOptionsChangingService>().CanApplyChange(oldOptions, newOptions); 402return project.Services.GetRequiredService<IParseOptionsChangingService>().CanApplyChange(oldOptions, newOptions, maxSupportLangVersion);
PullMemberUp\SymbolDependentsBuilder.cs (1)
50_declarationService = project.Services.GetRequiredService<ISymbolDeclarationService>();
Venus\ContainedLanguageCodeSupport.cs (2)
205var codeModel = targetDocument.Project.Services.GetRequiredService<ICodeModelNavigationPointService>(); 206var syntaxFacts = targetDocument.Project.Services.GetRequiredService<ISyntaxFactsService>();
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
65var completionService = document.Project.Services.GetRequiredService<IXamlCompletionService>();