128 references to Services
IdeBenchmarks (2)
FormatterBenchmarks.cs (2)
49var options = workspace.GlobalOptions.GetSyntaxFormattingOptions(document.Project.Services); 62var options = workspace.GlobalOptions.GetSyntaxFormattingOptions(document.Project.Services);
IdeCoreBenchmarks (1)
NavigateToBenchmarks.cs (1)
216var searchTasks = solution.Projects.GroupBy(p => p.Services.GetService<INavigateToSearchService>()).Select(
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
144var formattingOptions = subjectBuffer.GetSyntaxFormattingOptions(_editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: false);
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (1)
101var indentationOptions = subjectBuffer.GetIndentationOptions(_editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: false);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
ExtractMethod\ExtractMethodBase.cs (1)
123CodeGenerationOptions = CodeGenerationOptionsProviders.GetDefault(document.Project.Services),
ExtractMethod\ExtractMethodTests.cs (1)
11222await service.ExtractMethodAsync(document, textSpan: default, localFunction: false, ExtractMethodGenerationOptions.GetDefault(project.Services), CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.Features (4)
ChangeSignature\CSharpChangeSignatureService.cs (1)
788return GetPermutedDocCommentTrivia(node, permutedParamNodes, document.Project.Services, options);
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
154var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>();
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
101var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>(); 131var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>();
Microsoft.CodeAnalysis.EditorFeatures (10)
CommentSelection\AbstractCommentSelectionBase.cs (1)
152var formattingOptions = subjectBuffer.GetSyntaxFormattingOptions(_editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: false);
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (2)
96var options = subjectBuffer.GetDocumentationCommentOptions(_editorOptionsService, document.Project.Services); 334var options = subjectBuffer.GetDocumentationCommentOptions(_editorOptionsService, document.Project.Services);
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
590var contentType = preMergeDocument.Project.Services.GetService<IContentTypeLanguageService>().GetDefaultContentType();
IntelliSense\AsyncCompletion\CompletionSource.cs (2)
164return TryInvokeSnippetCompletion(triggerLocation.Snapshot.TextBuffer, triggerLocation.Position, sourceText, document.Project.Services, completionService.GetRules(options)); 171document.Project, document.Project.Services, sourceText, triggerLocation.Position, roslynTrigger, options, document.Project.Solution.Options, _roles);
Preview\AbstractPreviewFactoryService.cs (1)
787oldDocument.Project.Services.GetRequiredService<IContentTypeLanguageService>().GetDefaultContentType());
Shared\Extensions\ITextSnapshotExtensions.cs (1)
42var options = textBuffer.GetSyntaxFormattingOptions(editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: false);
SmartIndent\SmartIndent.cs (1)
45var indentationOptions = line.Snapshot.TextBuffer.GetIndentationOptions(_editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: false);
TextDiffing\EditorTextDifferencingService.cs (1)
35var diffService = _differenceSelectorService.GetTextDifferencingService(oldDocument.Project.Services.GetService<IContentTypeLanguageService>().GetDefaultContentType())
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Completion\AbstractCompletionProviderTests.cs (2)
104var completionService = project.Services.GetRequiredService<CompletionService>(); 1058var isTextualTriggerCharacterResult = service.ShouldTriggerCompletion(document.Project, document.Project.Services, text, position + 1, trigger, options, document.Project.Solution.Options, GetRoles(document));
Formatting\AbstractNewDocumentFormattingServiceTests.cs (1)
31var languageServices = document.Project.Services;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
CodeGeneration\CodeGenerationTests.cs (1)
868this.Service = Document.Project.Services.GetService<ICodeGenerationService>();
Completion\CompletionServiceTests.cs (1)
44var completionService = project.Services.GetRequiredService<CompletionService>();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
QuickInfo\Extensions.cs (1)
36var contentTypeService = document.Project.Services.GetService<IContentTypeLanguageService>();
Microsoft.CodeAnalysis.ExternalAccess.FSharp (5)
Internal\Diagnostics\FSharpDocumentDiagnosticAnalyzer.cs (2)
75var analyzer = document.Project.Services.GetService<FSharpDocumentDiagnosticAnalyzerService>(); 86var analyzer = document.Project.Services.GetService<FSharpDocumentDiagnosticAnalyzerService>();
Internal\Diagnostics\FSharpSimplifyNameDiagnosticAnalyzer.cs (1)
59var analyzer = document.Project.Services.GetService<FSharpSimplifyNameDiagnosticAnalyzerService>();
Internal\Diagnostics\FSharpUnusedDeclarationsAnalyzer.cs (1)
61var analyzer = document.Project.Services.GetService<FSharpUnusedDeclarationsDiagnosticAnalyzerService>();
Internal\Diagnostics\FSharpUnusedOpensDiagnosticAnalyzer.cs (1)
54var analyzer = document.Project.Services.GetService<FSharpUnusedOpensDiagnosticAnalyzerService>();
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Completion\OmniSharpCompletionService.cs (1)
25return completionService.ShouldTriggerCompletion(document.Project, document.Project.Services, text, caretPosition, trigger, options.ToCompletionOptions(), document.Project.Solution.Options, roles);
Formatting\OmniSharpSyntaxFormattingOptionsWrapper.cs (1)
37optionsWithFallback.GetSyntaxFormattingOptions(document.Project.Services));
Microsoft.CodeAnalysis.ExternalAccess.Xaml (2)
Internal\DescriptionService.cs (2)
41var formatter = project.Services.GetService<IDocumentationCommentFormattingService>(); 47var symbolDisplayService = project.Services.GetService<ISymbolDisplayService>();
Microsoft.CodeAnalysis.Features (24)
AddImport\AbstractAddImportFeatureService.cs (1)
423var compilationService = project.Services.GetRequiredService<ICompilationFactoryService>();
AddImport\AddImportOptions.cs (1)
34return configOptions.GetAddImportOptions(document.Project.Services, searchOptions, document.AllowImportsInHiddenRegions());
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
86var syntaxFacts = _project.Services.GetRequiredService<ISyntaxFactsService>();
Completion\CommonCompletionProvider.cs (1)
79var snippetService = document.Project.Services.GetService<ISnippetInfoService>();
Completion\CompletionProvider.cs (1)
58=> ShouldTriggerCompletion(document.Project.Services, await document.GetValueTextAsync(cancellationToken).ConfigureAwait(false), caretPosition, trigger, options, document.Project.Solution.Options);
Completion\CompletionService_GetCompletions.cs (2)
136if (ShouldTriggerCompletion(document.Project, document.Project.Services, text, caretPosition, trigger, options, passThroughOptions, roles)) 138var triggeredProviders = providers.Where(p => p.ShouldTriggerCompletion(document.Project.Services, text, caretPosition, trigger, options, passThroughOptions)).ToImmutableArrayOrEmpty();
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (1)
92foreach (var language in GetLanguageProviders(context.Document.Project.Services))
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
262var syntaxFacts = project.Services.GetRequiredService<ISyntaxFactsService>();
EditAndContinue\DebuggingSession.cs (1)
800var 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>();
EditAndContinue\Utilities\Extensions.cs (1)
41=> project.Services.GetService<IEditAndContinueAnalyzer>() != null;
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (1)
21var syntaxFactsService = newDocument.Project.Services.GetService<ISyntaxFactsService>();
ExternalAccess\VSTypeScript\VSTypeScriptDocumentDiagnosticAnalyzer.cs (2)
20var analyzer = document.Project.Services.GetRequiredService<VSTypeScriptDiagnosticAnalyzerLanguageService>().Implementation; 31var analyzer = document.Project.Services.GetRequiredService<VSTypeScriptDiagnosticAnalyzerLanguageService>().Implementation;
ExternalAccess\VSTypeScript\VSTypeScriptProjectDiagnosticAnalyzer.cs (1)
20var analyzer = project.Services.GetRequiredService<VSTypeScriptDiagnosticAnalyzerLanguageService>().Implementation;
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (1)
38var options = await classificationOptions.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false);
FindUsages\DefinitionItemFactory.cs (1)
302var options = await optionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
137_targetLanguageService = _generateTypeOptionsResult.Project.Services.GetService<IGenerateTypeService>();
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
154var compilationFactory = sourceProject.Services.GetRequiredService<ICompilationFactoryService>();
PullMemberUp\MembersPuller.cs (2)
100var codeGenerationService = document.Project.Services.GetRequiredService<ICodeGenerationService>(); 278var codeGenerationService = document.Project.Services.GetRequiredService<ICodeGenerationService>();
SolutionCrawler\AbstractDocumentDifferenceService.cs (1)
22var syntaxFactsService = newDocument.Project.Services.GetService<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 (6)
ExternalAccess\Razor\SimplifyMethodHandler.cs (1)
61var simplificationService = originalDocument.Project.Services.GetRequiredService<ISimplificationService>();
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
41var breakpointService = document.Project.Services.GetRequiredService<IBreakpointResolutionService>();
Handler\Completion\CompletionHandler.cs (1)
62&& !completionService.ShouldTriggerCompletion(document.Project, document.Project.Services, documentText, position, completionTrigger, completionOptions, document.Project.Solution.Options, roles: null))
Handler\Completion\CompletionResolveHandler.cs (1)
55var completionService = document.Project.Services.GetRequiredService<CompletionService>();
Handler\Formatting\FormatDocumentOnTypeHandler.cs (1)
54var formattingService = document.Project.Services.GetRequiredService<ISyntaxFormattingService>();
Handler\Symbols\DocumentSymbolsHandler.cs (1)
53var navBarService = document.Project.Services.GetRequiredService<INavigationBarItemService>();
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
EndConstructGeneration\EndConstructCommandHandler.vb (1)
143Dim options = buffer.GetCodeCleanupOptions(_editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat:=False, allowImportsInHiddenRegions:=document.AllowImportsInHiddenRegions())
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
629Return GetPermutedDocCommentTrivia(node, permutedParamNodes, document.Project.Services, options)
Microsoft.CodeAnalysis.Workspaces (12)
Editing\SyntaxGenerator.cs (1)
78=> project.Services.GetRequiredService<SyntaxGenerator>();
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
401var 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>();
Formatting\Formatter.cs (1)
35=> GetDefaultFormattingRules(document.Project.Services);
Rename\ConflictEngine\ConflictResolver.cs (1)
206var renameRewriterService = implicitReferenceLocationsPerLanguage.First().Document.Project.Services.GetRequiredService<IRenameRewriterLanguageService>();
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
358var syntaxFactsService = newDocument.Project.Services.GetRequiredService<ISyntaxFactsService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
22=> project?.Services.GetService<TLanguageService>(); 29=> project.Services.GetRequiredService<TLanguageService>();
Workspace\Solution\Project.cs (2)
95public bool SupportsCompilation => this.Services.GetService<ICompilationFactoryService>() != null; 100[Obsolete($"Use {nameof(Services)} instead.")]
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SolutionTests\SolutionTests.cs (2)
1621var defaultOptions = solution.Projects.Single().Services.GetRequiredService<ICompilationFactoryService>().GetDefaultCompilationOptions(); 4407var factory = dummyProject.Services.GetService<ISyntaxTreeFactoryService>();
Microsoft.VisualStudio.LanguageServices (18)
Implementation\AbstractVsTextViewFilter.cs (1)
116var languageDebugInfo = document.Project.Services.GetService<ILanguageDebugInfoService>();
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (2)
59var formattingOptions = textBuffer.GetSyntaxFormattingOptions(EditorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: true); 74[ruleFactory.CreateRule(documentSyntax, start), .. Formatter.GetDefaultFormattingRules(document.Project.Services)],
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (1)
294var formattingService = _project.Services.GetService<IDocumentationCommentFormattingService>();
Library\ObjectBrowser\ObjectList.cs (1)
687var helpContextService = project.Services.GetService<IHelpContextService>();
Preview\FileChange.cs (1)
86left.Project.Services.GetService<IContentTypeLanguageService>().GetDefaultContentType());
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>();
Snippets\AbstractSnippetCommandHandler.cs (1)
47=> document.Project.Services.SolutionServices.GetRequiredService<ISnippetExpansionClientFactory>();
Snippets\SnippetExpansionClient.cs (1)
1064var languageServices = documentWithImports.Project.Services;
Venus\ContainedDocument.cs (1)
773var formattingOptions = subjectBuffer.GetSyntaxFormattingOptions(editorOptionsService, document.Project.GetFallbackAnalyzerOptions(), document.Project.Services, explicitFormat: false);
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (1)
77additionalFormattingRule: targetDocument.Project.Services.GetService<IAdditionalFormattingRuleLanguageService>().GetAdditionalCodeGenerationRule(),
Venus\ContainedLanguageCodeSupport.cs (3)
205var codeModel = targetDocument.Project.Services.GetRequiredService<ICodeModelNavigationPointService>(); 206var syntaxFacts = targetDocument.Project.Services.GetRequiredService<ISyntaxFactsService>(); 269var codeModel = thisDocument.Project.Services.GetService<ICodeModelNavigationPointService>();
Workspace\VisualStudioSymbolNavigationService.cs (1)
101var libraryService = project.Services.GetService<ILibraryService>();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
CodeModel\FileCodeModelTestHelpers.cs (1)
51project.Services,
Microsoft.VisualStudio.LanguageServices.UnitTests (8)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
467Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
CommonControls\MemberSelectionViewModelTests.vb (1)
183Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
236Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
ExtractInterface\ExtractInterfaceViewModelTests.vb (2)
299Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None) 308workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(),
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
33Dim syntaxFacts = workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)()
PullMemberUp\PullMemberUpViewModelTest.vb (1)
255Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
RQName\RQNameTests.vb (1)
247Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
Microsoft.VisualStudio.LanguageServices.VisualBasic (3)
Snippets\SnippetCompletionProvider.vb (1)
102Dim expansionClientFactory = document.Project.Services.SolutionServices.GetRequiredService(Of ISnippetExpansionClientFactory)()
Venus\ContainedLanguageStaticEventBinding.vb (2)
80Dim codeModel = targetDocument.Project.Services.GetService(Of ICodeModelService)() 108Dim codeModel = targetDocument.Project.Services.GetService(Of ICodeModelService)()
Microsoft.VisualStudio.LanguageServices.Xaml (11)
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (2)
29var formatter = codeProject.Services.GetService<IDocumentationCommentFormattingService>(); 35var symbolDisplayService = codeProject.Services.GetService<ISymbolDisplayService>();
Implementation\LanguageServer\Handler\Commands\CreateEventCommandHandler.cs (1)
54var commandService = document.Project.Services.GetService<IXamlCommandService>();
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
65var completionService = document.Project.Services.GetRequiredService<IXamlCompletionService>();
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
61var xamlGoToDefinitionService = document.Project.Services.GetService<IXamlGoToDefinitionService>();
Implementation\LanguageServer\Handler\FoldingRanges\FoldingRangesHandler.cs (1)
42var xamlStructureService = document.Project.Services.GetService<IXamlStructureService>();
Implementation\LanguageServer\Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
31var formattingService = document?.Project.Services.GetService<IXamlFormattingService>();
Implementation\LanguageServer\Handler\Formatting\FormatDocumentOnTypeHandler.cs (1)
43var formattingService = document?.Project.Services.GetService<IXamlFormattingService>();
Implementation\LanguageServer\Handler\Hover\HoverHandler.cs (1)
53var quickInfoService = document.Project.Services.GetService<IXamlQuickInfoService>();
Implementation\LanguageServer\Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
41var insertService = document.Project.Services.GetService<IXamlAutoInsertService>();
Implementation\LanguageServer\Handler\OnTypeRename\OnTypeRenameHandler.cs (1)
73var renameService = document.Project.Services.GetService<IXamlTypeRenameService>();