1 write to Project
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\TextDocument.cs (1)
30this.Project = project;
1888 references to Project
AnalyzerRunner (5)
CodeRefactoringRunner.cs (5)
78var syntaxKinds = _syntaxKinds[document.Project.Language]; 87foreach (var refactoringProvider in _refactorings[document.Project.Language]) 96document.Project.Solution, new ProgressTracker(), cancellationToken).ConfigureAwait(false); 104var changes = applyChangesOperation.ChangedSolution.GetChanges(document.Project.Solution); 106if (projectChanges.Length != 1 || projectChanges[0].ProjectId != document.Project.Id)
IdeBenchmarks (3)
FormatterBenchmarks.cs (2)
49var options = workspace.GlobalOptions.GetSyntaxFormattingOptions(document.Project.Services); 62var options = workspace.GlobalOptions.GetSyntaxFormattingOptions(document.Project.Services);
RegexClassifierBenchmarks.cs (1)
84var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>();
IdeCoreBenchmarks (1)
CloudCachePersistentStorage.cs (1)
87? s_projectToContainerKeyCache.GetValue(document.Project.State, _projectToContainerKeyCacheCallback).GetDocumentContainerKey(document.State)
Microsoft.CodeAnalysis.CodeStyle.Fixes (47)
AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
60var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (4)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 55var targetFolders = PathMetadataUtilities.BuildFoldersFromNamespace(targetNamespace, document.Project.DefaultNamespace); 67var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false); 68Debug.Assert(newSolution != document.Project.Solution);
AbstractConvertToAsyncCodeFixProvider.cs (1)
72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
AbstractFileHeaderCodeFixProvider.cs (1)
65!document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(tree).TryGetEditorConfigOption(CodeStyleOptions2.FileHeaderTemplate, out fileHeaderTemplate))
AbstractGeneratedCodeRecognitionService.cs (1)
34return syntaxTree.IsGeneratedCode(document.Project.AnalyzerOptions, syntaxFacts, cancellationToken);
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
164var solution = document.Project.Solution; 198return newDocument.Project.Solution;
AbstractMakeMethodSynchronousCodeFixProvider.cs (6)
77var solution = document.Project.Solution; 99var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 110var newSolution = newDocument.Project.Solution; 133methodSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false); 146document.Project.Solution, referencedSymbol.Locations.ToImmutableArray(), cancellationToken).ConfigureAwait(false); 151return document.Project.Solution;
AbstractMoveDeclarationNearReferenceService.cs (1)
83var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractMoveDeclarationNearReferenceService.State.cs (1)
91var findReferencesResult = await SymbolFinder.FindReferencesAsync(LocalSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
33var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 67var solutionServices = document.Project.Solution.Services;
AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
292var editor = new SyntaxEditor(root, document.Project.Solution.Services); 914var referencedSymbols = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractUnsealClassCodeFixProvider.cs (3)
43type, document.Project.Solution, cancellationToken).ConfigureAwait(false); 50c => UnsealDeclarationsAsync(document.Project.Solution, definition.DeclaringSyntaxReferences, c), 66var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractUpgradeProjectCodeFixProvider.cs (1)
43var project = context.Document.Project;
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
99var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AbstractUseConditionalExpressionCodeFixProvider.cs (1)
62var nestedEditor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractUseObjectInitializerCodeFixProvider.cs (1)
100var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AddImportPlacementOptionsProviders.cs (1)
18var configOptions = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(syntaxTree).GetOptionsReader();
AddParameterService.cs (2)
83var solution = invocationDocument.Project.Solution; 151method, invocationDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
AnalyzerOptionsProviders.cs (2)
20var analyzerOptions = document.Project.AnalyzerOptions; 23return new AnalyzerOptionsProvider(configOptions, document.Project.Language, analyzerOptions);
CodeFixOptionsProvider.cs (1)
91return new CodeFixOptionsProvider(configOptions.GetOptionsReader(), fallbackOptions, document.Project.GetExtendedLanguageServices());
DocumentExtensions.cs (6)
29=> document?.Project?.GetLanguageService<TLanguageService>(); 32=> document.Project.GetRequiredLanguageService<TLanguageService>(); 79var workspace = document.Project.Solution.Workspace; 144var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>(); 200var solution = document.Project.Solution; 212return document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(syntaxTree);
NamingStyleCodeFixProvider.cs (1)
110document.Project.Solution, symbol, new SymbolRenameOptions(), fixedName,
ParsedDocument.cs (1)
38return new ParsedDocument(document.Id, text, root, document.Project.GetExtendedLanguageServices());
SyntacticDocument.cs (1)
25public Project Project => Document.Project;
SyntaxEditorBasedCodeFixProvider.cs (1)
82var editor = new SyntaxEditor(root, document.Project.Solution.Services);
TextDocumentExtensions.cs (2)
39return textDocument.Project.Solution.WithAdditionalDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!; 48return textDocument.Project.Solution.WithAnalyzerConfigDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!;
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (3)
AbstractUserDiagnosticTest.cs (3)
155(a, d) => fixes.Add(new CodeFix(document.Project, a, d)), 214? new FixAllState(fixAllProvider, diagnostic.Location.SourceSpan, document, document.Project, fixer, scope, equivalenceKey, diagnosticIds, fixAllDiagnosticProvider, optionsProvider) 215: new FixAllState(fixAllProvider, diagnosticSpan: null, document: null, document.Project, fixer, scope, equivalenceKey, diagnosticIds, fixAllDiagnosticProvider, optionsProvider);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
ConvertToRecordEngine.cs (2)
113var solutionEditor = new SolutionEditor(document.Project.Solution); 467if (documentEditor.OriginalDocument.Project.Language != LanguageNames.CSharp)
CSharpCodeFixOptionsProvider.cs (1)
127return new CSharpCodeFixOptionsProvider(configOptions.GetOptionsReader(), fallbackOptions, document.Project.GetExtendedLanguageServices());
CSharpCodeGenerationService.cs (2)
75var compilation = await newDocument.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 77var newContext = context with { Solution = newDocument.Project.Solution };
CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
87var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
CSharpInlineDeclarationCodeFixProvider.cs (1)
118var editor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
67var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
43var editor = new SyntaxEditor(memberDeclaration, document.Project.Solution.Services);
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
39_ => Task.FromResult(AllowUnsafeOnProject(context.Document.Project))), context.Diagnostics);
CSharpUseDeconstructionCodeFixProvider.cs (1)
68var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpUseLocalFunctionCodeFixProvider.cs (2)
96CodeGenerationContext.Default, CSharpCodeGenerationOptions.Default, new CSharpCodeGenerationService(document.Project.Services), root.SyntaxTree.Options.LanguageVersion()); 117document.Project.Solution.Services, currentRoot,
EmbeddedStatementPlacementCodeFixProvider.cs (1)
51var editor = new SyntaxEditor(root, document.Project.Solution.Services);
MakeLocalFunctionStaticCodeFixHelper.cs (4)
36var syntaxEditor = new SyntaxEditor(root, document.Project.Solution.Services); 56localFunctionSymbol, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 128capture, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 172CodeGenerationContext.Default, CSharpCodeGenerationOptions.Default, new CSharpCodeGenerationService(document.Project.Services), root.SyntaxTree.Options.LanguageVersion());
Microsoft.CodeAnalysis.CSharp.EditorFeatures (7)
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
153var formattingOptions = subjectBuffer.GetSyntaxFormattingOptions(_editorOptionsService, document.Project.Services, explicitFormat: false);
DecompiledSource\CSharpDecompiledSourceService.cs (1)
126var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
183return document.Project.Solution.WithDocumentText(
Formatting\CSharpFormattingInteractionService.cs (1)
100return Task.FromResult(Formatter.GetFormattedTextChanges(parsedDocument.Root, SpecializedCollections.SingletonEnumerable(formattingSpan), document.Project.Solution.Services, options, cancellationToken).ToImmutableArray());
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (1)
102var indentationOptions = subjectBuffer.GetIndentationOptions(_editorOptionsService, document.Project.Services, explicitFormat: false);
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
228var copyPasteService = documentBeforePaste.Project.Solution.Services.GetRequiredService<IStringCopyPasteService>();
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (1)
67var copyPasteService = document.Project.Solution.Services.GetService<IStringCopyPasteService>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (41)
CodeActions\ApplyChangesOperationTests.cs (1)
36var codeAction = new TestCodeAction(_changeSolution(context.Document.Project.Solution));
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (2)
929Assert.NotEqual(documentToModify.Project.Solution, modifiedSolution); 933Assert.Equal(documentToModify.Project.Solution, modifiedSolution);
CodeActions\Preview\PreviewExceptionTests.cs (1)
118extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>() as EditorLayerExtensionManager.ExtensionManager;
CodeActions\Preview\PreviewTests.cs (5)
74var solution = _oldDocument.Project.Solution; 77solution = solution.AddDocument(DocumentId.CreateNewId(_oldDocument.Project.Id, AddedDocumentName), AddedDocumentName, AddedDocumentText); 80var removedReference = _oldDocument.Project.MetadataReferences[_oldDocument.Project.MetadataReferences.Count - 1]; 82solution = solution.RemoveMetadataReference(_oldDocument.Project.Id, removedReference);
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
172var service = GetCompletionService(document.Project);
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
433var service = GetCompletionService(document.Project);
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
624var service = GetCompletionService(document.Project); 1196var service = GetCompletionService(document.Project);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (11)
2487var service = GetCompletionService(document.Project); 2491if (service.GetProvider(completionItem, document.Project) is ICustomCommitCompletionProvider customCommitCompletionProvider) 2744var service = GetCompletionService(document.Project); 2748if (service.GetProvider(completionItem, document.Project) is ICustomCommitCompletionProvider customCommitCompletionProvider) 2800var service = GetCompletionService(document.Project); 2804if (service.GetProvider(completionItem, document.Project) is ICustomCommitCompletionProvider customCommitCompletionProvider) 3082var service = GetCompletionService(document.Project); 3219var service = GetCompletionService(document.Project); 3273var service = GetCompletionService(document.Project); 3284document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution);
Completion\CompletionProviders\SuggestionModeCompletionProviderTests.cs (1)
1415var service = GetCompletionService(document.Project);
Completion\CompletionServiceTests.cs (2)
63var provider = service.GetProvider(item, document.Project); 172.AddDocument("Document1.cs", sourceMarkup, filePath: "Document1.cs").Project;
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
59.Projects.Single().AddAdditionalDocument(name: "dummy.txt", text: "", filePath: "dummy.txt").Project.Solution;
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
47AddDocument("test.cs", SourceText.From(source, Encoding.UTF8), filePath: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution; 465AddDocument("test.cs", root, filePath: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution;
ExtractMethod\ExtractMethodBase.cs (2)
136CodeGenerationOptions = CodeGenerationOptions.GetDefault(document.Project.Services), 160var (doc, _) = await result.GetFormattedDocumentAsync(CodeCleanupOptions.GetDefault(document.Project.Services), CancellationToken.None);
Formatting\CodeCleanupTests.cs (1)
744project = project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From(editorconfigText), filePath: @"z:\\.editorconfig").Project;
Formatting\CodeCleanupTests.TestFixers.cs (2)
97project ??= document.Project; 153project ??= document.Project;
Workspaces\WorkspaceTests_EditorFeatures.cs (6)
554var newVersionX = await doc1Z.Project.GetDependentSemanticVersionAsync(); 615var compilation2Z = await partialDoc2Z.Project.GetCompilationAsync(); 1061Assert.NotEqual(oldVersion, await doc.Project.GetSemanticVersionAsync()); 1094Assert.NotEqual(oldVersion, await doc.Project.GetSemanticVersionAsync()); 1241workspace.TryApplyChanges(doc.Project.Solution); 1269workspace.TryApplyChanges(doc.Project.Solution);
Microsoft.CodeAnalysis.CSharp.Features (53)
AddDebuggerDisplay\CSharpAddDebuggerDisplayCodeRefactoringProvider.cs (1)
31=> document.Project.ParseOptions!.LanguageVersion().HasConstantInterpolatedStrings();
AddImport\CSharpAddImportFeatureService.cs (1)
397var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
ChangeSignature\CSharpChangeSignatureService.cs (2)
777return GetPermutedDocCommentTrivia(node, permutedParamNodes, document.Project.Services, options); 863convertedType = await SymbolFinder.FindSourceDefinitionAsync(convertedType, document.Project.Solution, cancellationToken).ConfigureAwait(false)
CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
44if (context.Document.Project.IsSubmission)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
42if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
40if (!ShouldOfferRefactoring(document.Project)) 57new CustomCodeAction((purpose, cancellationToken) => EnableNullableReferenceTypesAsync(document.Project, purpose, context.Options, cancellationToken)));
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
44if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
41if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles 67document.Project.Solution, allDocumentIds, containerSpan, cancellationToken).ConfigureAwait(false);
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (2)
35if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 127var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
50if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
68var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\ImportCompletion\ImportCompletionProviderHelper.cs (3)
33if (_sdkGlobalUsingsCache.TryGetValue(context.Document.Project.Id, out var cacheEntry)) 37_ = GetGlobalUsingsAsync(context.Document.Project, cacheEntry, CancellationToken.None); 43var globalUsings = await GetGlobalUsingsAsync(context.Document.Project, CacheEntry.Default, cancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
103var languageVersion = document.Project.ParseOptions!.LanguageVersion();
Completion\CompletionProviders\SnippetCompletionProvider.cs (3)
65var solution = document.Project.Solution; 126completionContext, document.Project.Solution.Services, semanticModel, isPreProcessorContext: true); 142completionContext, document.Project.Solution.Services, semanticModel, isPreProcessorContext: false);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
35var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
ConvertProgram\ConvertToProgramMainCodeRefactoringProvider.cs (2)
39if (!IsApplication(document.Project.CompilationOptions!)) 54var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
ConvertProgram\ConvertToTopLevelStatementsCodeRefactoringProvider.cs (2)
38if (document.Project.ParseOptions!.LanguageVersion() < LanguageVersion.CSharp9 || 39!IsApplication(document.Project.CompilationOptions!))
ConvertToRecordEngine.cs (2)
113var solutionEditor = new SolutionEditor(document.Project.Solution); 467if (documentEditor.OriginalDocument.Project.Language != LanguageNames.CSharp)
CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
87var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
CSharpInlineDeclarationCodeFixProvider.cs (1)
118var editor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
67var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
39_ => Task.FromResult(AllowUnsafeOnProject(context.Document.Project))), context.Diagnostics);
CSharpUseDeconstructionCodeFixProvider.cs (1)
68var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
117document.Project.Solution.Services, currentRoot,
EmbeddedStatementPlacementCodeFixProvider.cs (1)
51var editor = new SyntaxEditor(root, document.Project.Solution.Services);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
111document.Project.Solution,
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
24var preservationService = selectionResult.SemanticDocument.Document.Project.Services.GetService<ISyntaxTriviaService>();
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
42var editor = new SyntaxEditor(root, document.Project.Solution.Services);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
65var project = document.Project;
ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
58.Select(n => service.GetCodeActions(document, context.Options.GetImplementTypeGenerationOptions(document.Project.Services), model, n, cancellationToken))
MakeLocalFunctionStaticCodeFixHelper.cs (3)
36var syntaxEditor = new SyntaxEditor(root, document.Project.Solution.Services); 56localFunctionSymbol, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 128capture, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false);
NavigationBar\CSharpNavigationBarItemService.cs (1)
54return GetMembersInTypes(document.Project.Solution, tree, typesInFile, cancellationToken);
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (2)
141var hostAnalyzers = document.Project.Solution.State.Analyzers; 142var groupedDiagnostics = hostAnalyzers.GetDiagnosticDescriptorsPerReference(_diagnosticAnalyzerInfoCache, document.Project).Values;
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
270var editor = new SyntaxEditor(root, document.Project.Solution.Services);
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
165var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>();
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
108var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>(); 140var structuralTypeDisplayService = document.Project.Services.GetRequiredService<IStructuralTypeDisplayService>();
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
43var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
47var project = propertyDocument.Project;
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CSharpCodeFixOptionsProvider.cs (1)
127return new CSharpCodeFixOptionsProvider(configOptions.GetOptionsReader(), fallbackOptions, document.Project.GetExtendedLanguageServices());
CSharpCodeGenerationService.cs (2)
75var compilation = await newDocument.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 77var newContext = context with { Solution = newDocument.Project.Solution };
CSharpRemoveUnnecessaryImportsService.cs (1)
78var provider = document.Project.Solution.Services;
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
43var editor = new SyntaxEditor(memberDeclaration, document.Project.Solution.Services);
Rename\CSharpRenameRewriterLanguageService.cs (2)
149_simplificationService = parameters.Document.Project.Services.GetRequiredService<ISimplificationService>(); 150_semanticFactsService = parameters.Document.Project.Services.GetRequiredService<ISemanticFactsService>();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
CodeGeneration\AddImportsTests.cs (2)
788project = project.AddDocument("duplicate.cs", externalCode).Project; 791var compilation = await document.Project.GetCompilationAsync(CancellationToken.None);
Formatting\FormattingTreeEditTests.cs (2)
46var result1 = Formatter.Format(root1, document.Project.Solution.Services, options, CancellationToken.None); 59var result2 = Formatter.Format(root2, document.Project.Solution.Services, options, CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures (136)
AddImports\AbstractAddImportsPasteCommandHandler.cs (4)
145var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 165HideAdvancedMembers: _globalOptions.GetOption(CompletionOptionsStorage.HideAdvancedMembers, document.Project.Language)); 177document.Project.Solution.Workspace.TryApplyChanges(updatedDocument.Project.Solution);
BraceMatching\BraceHighlightingViewTaggerProvider.cs (1)
72var options = GlobalOptions.GetBraceMatchingOptions(document.Project.Language);
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
101HandleResult(result, document.Project.Solution, workspace, context);
Classification\CopyPasteAndPrintingClassificationBufferTaggerProvider.Tagger.cs (1)
137var options = _globalOptions.GetClassificationOptions(document.Project.Language);
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (2)
114var workspaceContextService = document.Project.Solution.Services.GetRequiredService<IWorkspaceContextService>(); 123var classificationOptions = _globalOptions.GetClassificationOptions(document.Project.Language);
Classification\Semantic\ClassificationUtilities.cs (2)
110var currentSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 173var version = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (2)
328return new(classificationService.ComputeSyntacticChangeRange(currentDocument.Project.Solution.Services, previousRoot, currentRoot, _diffTimeout, cancellationToken)); 430classificationService.AddSyntacticClassifications(document.Project.Solution.Services, root, span.Span.ToTextSpan(), tempList, cancellationToken);
CodeDefinitionWindow\DefinitionContextTracker.cs (3)
201var definitionItem = symbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: false); 210var options = _globalOptions.GetMetadataAsSourceOptions(document.Project.Services); 211var declarationFile = await _metadataAsSourceFileService.GetGeneratedFileAsync(workspace, document.Project, symbol, signaturesOnly: false, options, cancellationToken).ConfigureAwait(false);
CommentSelection\AbstractCommentSelectionBase.cs (2)
155var formattingOptions = subjectBuffer.GetSyntaxFormattingOptions(_editorOptionsService, document.Project.Services, explicitFormat: false); 157var formattedChanges = Formatter.GetFormattedTextChanges(newRoot, formattingSpans, document.Project.Solution.Services, formattingOptions, rules: null, cancellationToken);
CommentSelection\AbstractToggleBlockCommentBase.cs (1)
80m[LanguageNameString] = document.Project.Language;
CommentSelection\ToggleLineCommentCommandHandler.cs (1)
70m[LanguageNameString] = document.Project.Language;
Diagnostics\AbstractPushOrPullDiagnosticsTaggerProvider.PushDiagnosticsTaggerProvider.cs (3)
130var workspace = document.Project.Solution.Workspace; 140workspace, document.Project.Id, document.Id, cancellationToken); 164workspace, document.Project.Id, document.Id, id,
Diagnostics\AbstractPushOrPullDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
100var project = document.Project;
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (2)
96var options = subjectBuffer.GetDocumentationCommentOptions(_editorOptionsService, document.Project.Services); 336var options = subjectBuffer.GetDocumentationCommentOptions(_editorOptionsService, document.Project.Services);
EditAndContinue\ActiveStatementTaggerProvider.cs (1)
79var activeStatementTrackingService = document.Project.Solution.Services.GetService<IActiveStatementTrackingService>();
EditAndContinue\ActiveStatementTrackingService.cs (2)
169var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution); 350var solution = document.Project.Solution;
EditAndContinue\EditAndContinueDiagnosticAnalyzer.cs (2)
56var workspace = designTimeDocument.Project.Solution.Workspace; 69var designTimeSolution = designTimeDocument.Project.Solution;
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
86var oldSolutionVersion = oldDocument.Project.Solution.WorkspaceVersion;
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
78var workspace = initialDocument.Project.Solution.Workspace; 118var solution = document.Project.Solution;
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (1)
48var workspace = document.Project.Solution.Workspace;
ExternalAccess\IntelliCode\IntentProcessor.cs (3)
59var languageName = currentDocument.Project.Language; 108newSolution = await newSolution.WithMergedLinkedFileChangesAsync(originalDocument.Project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 114var docChanges = await GetTextChangesForDocumentAsync(newSolution, currentDocument.Project.Solution, changedDocumentId, cancellationToken).ConfigureAwait(false);
ExternalAccess\UnitTestGenerator\Api\UnitTestGeneratorAddMissingImportsFeatureServiceAccessor.cs (4)
36var service = document.Project.GetRequiredLanguageService<IAddMissingImportsFeatureService>(); 43var service = document.Project.GetRequiredLanguageService<IAddMissingImportsFeatureService>(); 51var service = document.Project.GetRequiredLanguageService<IAddMissingImportsFeatureService>(); 62HideAdvancedMembers: _globalOptions.GetOption(CompletionOptionsStorage.HideAdvancedMembers, document.Project.Language));
ExternalAccess\VSTypeScript\VSTypeScriptGoToSymbolService.cs (1)
40document.Project.Solution.Workspace, cancellationToken).ConfigureAwait(false);
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
65var workspace = document.Project.Solution.Workspace;
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (1)
85if (!document.Project.Solution.Workspace.TryApplyChanges(result.UpdatedSolution))
ExtractMethod\ExtractMethodCommandHandler.cs (4)
127var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 161var notificationService = document.Project.Solution.Services.GetService<INotificationService>(); 238var project = document.Project; 243if (!_globalOptions.GetOption(ExtractMethodPresentationOptionsStorage.AllowBestEffort, document.Project.Language) ||
FindReferences\FindReferencesCommandHandler.cs (2)
130includeContainingTypeAndMemberColumns: document.Project.SupportsCompilation, 131includeKindColumn: document.Project.Language != LanguageNames.FSharp);
Formatting\FormatCommandHandler.cs (1)
80var ruleFactory = document.Project.Solution.Services.GetRequiredService<IHostDependentFormattingRuleFactoryService>();
Formatting\FormatCommandHandler.Paste.cs (2)
67if (!_globalOptions.GetOption(FormattingOptionsStorage.FormatOnPaste, document.Project.Language)) 70var solution = document.Project.Solution;
GoToDefinition\AbstractGoToCommandHandler`2.cs (2)
194document.Project.Solution.Workspace, 262var service = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>();
GoToDefinition\AbstractGoToDefinitionService.cs (1)
38var solution = document.Project.Solution;
GoToDefinition\GoToDefinitionCommandHandler.cs (2)
160var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>(); 170var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
InlineHints\InlineHintsDataTaggerProvider.cs (1)
114var options = GlobalOptions.GetInlineHintsOptions(document.Project.Language);
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (3)
140var solution = this.Document.Project.Solution; 162this.Document.Project.Solution.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)) 172var symbolSourceDocument = this.Document.Project.Solution.GetDocument(RenameSymbol.Locations.Single().SourceTree);
InlineRename\InlineRenameService.cs (2)
121document.Project.Solution.Workspace, 141var workspace = document.Project.Solution.Workspace;
InlineRename\InlineRenameSession.cs (2)
183_baseSolution = _triggerDocument.Project.Solution; 835_triggerDocument.Project.Solution);
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (3)
573var textDiffService = oldDocument.Project.Solution.Services.GetService<IDocumentTextDifferencingService>(); 591var textDiffService = preMergeDocument.Project.Solution.Services.GetService<IDocumentTextDifferencingService>(); 592var contentType = preMergeDocument.Project.Services.GetService<IContentTypeLanguageService>().GetDefaultContentType();
IntelliSense\AsyncCompletion\CommitManager.cs (2)
130var options = _globalOptions.GetCompletionOptions(document.Project.Language); 226var provider = completionService.GetProvider(roslynItem, document.Project);
IntelliSense\AsyncCompletion\CompletionSource.cs (13)
121var options = _editorOptionsService.GlobalOptions.GetCompletionOptions(document.Project.Language); 180return TryInvokeSnippetCompletion(triggerLocation.Snapshot.TextBuffer, triggerLocation.Position, sourceText, document.Project.Services, completionService.GetRules(options)); 187document.Project, document.Project.Services, sourceText, triggerLocation.Position, roslynTrigger, options, document.Project.Solution.Options, _roles); 267var showCompletionItemFilters = _editorOptionsService.GlobalOptions.GetOption(CompletionViewOptionsStorage.ShowCompletionItemFilters, document.Project.Language); 268var options = _editorOptionsService.GlobalOptions.GetCompletionOptions(document.Project.Language) with 414var options = _editorOptionsService.GlobalOptions.GetCompletionOptions(document.Project.Language) with 453document, triggerLocation, options, document.Project.Solution.Options, roslynTrigger, _roles, cancellationToken).ConfigureAwait(false); 455var filterSet = new FilterSet(document.Project.Language is LanguageNames.CSharp or LanguageNames.VisualBasic); 526var completionOptions = _editorOptionsService.GlobalOptions.GetCompletionOptions(document.Project.Language); 527var displayOptions = _editorOptionsService.GlobalOptions.GetSymbolDescriptionOptions(document.Project.Language); 589var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution);
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (3)
96_completionRules = _completionService?.GetRules(globalOptions.GetCompletionOptions(_document.Project.Language)) ?? CompletionRules.Default; 107&& globalOptions.GetOption(CompletionViewOptionsStorage.HighlightMatchingPortionsOfCompletionListItems, _document.Project.Language); 109_showCompletionItemFilters = globalOptions.GetOption(CompletionViewOptionsStorage.ShowCompletionItemFilters, _document.Project.Language);
IntelliSense\Helpers.cs (2)
148var target = new QuickInfoHyperLink(document.Project.Solution.Workspace, absoluteUri); 159var workspace = document.Project.Solution.Workspace;
IntelliSense\QuickInfo\QuickInfoSourceProvider.QuickInfoSource.cs (2)
89var options = _editorOptionsService.GlobalOptions.GetSymbolDescriptionOptions(document.Project.Language); 95var classificationOptions = _editorOptionsService.GlobalOptions.GetClassificationOptions(document.Project.Language);
Intents\DeleteParameterIntentProvider.cs (1)
71var changedDocuments = changeSignatureResult.UpdatedSolution.GetChangedDocuments(priorDocument.Project.Solution).ToImmutableArray();
KeywordHighlighting\HighlighterViewTaggerProvider.cs (1)
88if (!GlobalOptions.GetOption(KeywordHighlightingOptionsStorage.KeywordHighlighting, document.Project.Language))
LanguageServer\EditorHoverCreationService.cs (1)
41var language = document.Project.Language;
LanguageServer\EditorLspReferencesResultCreationService.cs (1)
59result.ProjectName = documentSpan.Value.Document.Project.Name;
NavigateTo\NavigateToHelpers.cs (1)
38var workspace = document.Project.Solution.Workspace;
NavigationBar\NavigationBarController.cs (5)
222d.Project.Name, 223d.Project.GetGlyph(), 224workspace: d.Project.Solution.Workspace, 226language: d.Project.Language)).OrderBy(projectItem => projectItem.Text).ToImmutableArray(); 230? projectItems.FirstOrDefault(p => p.Text == document.Project.Name) ?? projectItems.First()
Preview\AbstractPreviewFactoryService.cs (9)
259document.Name, document.Project.Name); 290var rightWorkspace = new PreviewWorkspace(document.Project.Solution); 331document.Name, document.Project.Name); 372var leftWorkspace = new PreviewWorkspace(document.Project.Solution); 480var leftWorkspace = new PreviewWorkspace(oldDocument.Project.Solution); 483var rightWorkspace = new PreviewWorkspace(newDocument.Project.Solution); 537var leftWorkspace = new PreviewWorkspace(oldDocument.Project.Solution); 540var rightWorkspace = new PreviewWorkspace(newDocument.Project.Solution); 760oldDocument.Project.Services.GetRequiredService<IContentTypeLanguageService>().GetDefaultContentType());
ReferenceHighlighting\ReferenceHighlightingViewTaggerProvider.cs (3)
121if (!_globalOptions.GetOption(ReferenceHighlightingOptionsStorage.ReferenceHighlighting, document.Project.Language)) 138var options = _globalOptions.GetHighlightingOptions(document.Project.Language); 149var solution = document.Project.Solution;
RenameTracking\RenameTrackingCancellationCommandHandler.cs (1)
43RenameTrackingDismisser.DismissVisibleRenameTracking(document.Project.Solution.Workspace, document.Id);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (2)
69if (!_globalOptions.GetOption(RenameTrackingOptionsStorage.RenameTrackingPreview, _document.Project.Language) || 93_document.Project.Solution.Services.GetService<INotificationService>()
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
127var workspace = document.Project.Solution.Workspace; 196var solution = document.Project.Solution;
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
244document.Project.Solution.Workspace,
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
215var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, _cancellationToken).ConfigureAwait(false) ?? symbol; 229var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, _cancellationToken).ConfigureAwait(false) ?? symbol;
Shared\Extensions\ITextSnapshotExtensions.cs (2)
46var options = textBuffer.GetSyntaxFormattingOptions(editorOptionsService, document.Project.Services, explicitFormat: false); 78var service = document.Project.Solution.Services.GetService<IWorkspaceStatusService>();
SmartIndent\SmartIndent.cs (1)
51var indentationOptions = line.Snapshot.TextBuffer.GetIndentationOptions(_editorOptionsService, document.Project.Services, explicitFormat: false);
SpellCheck\RoslynSpellCheckFixerProvider.cs (1)
114var workspace = document.Project.Solution.Workspace;
SplitComment\SplitCommentCommandHandler.cs (1)
77if (!_globalOptions.GetOption(SplitCommentOptionsStorage.Enabled, document.Project.Language))
Structure\AbstractStructureTaggerProvider.cs (7)
79if (!GlobalOptions.GetOption(OutliningOptionsStorage.Outlining, openDocument.Project.Language)) 82var options = BlockStructureOptionsStorage.GetBlockStructureOptions(GlobalOptions, openDocument.Project); 86if (openDocument.Project.Solution.Workspace is MetadataAsSourceWorkspace masWorkspace && 95var collapseRegions = GlobalOptions.GetOption(BlockStructureOptionsStorage.CollapseRegionsWhenFirstOpened, openDocument.Project.Language); 96var collapseImports = GlobalOptions.GetOption(BlockStructureOptionsStorage.CollapseImportsWhenFirstOpened, openDocument.Project.Language); 103if (ContainsRegionOrImport(subjectBuffer.CurrentSnapshot, collapseRegions, collapseImports, openDocument.Project.Language)) 197var options = GlobalOptions.GetBlockStructureOptions(document.Project);
Tagging\CompilationAvailableTaggerEventSource.cs (1)
87_eventSource.EnsureCompilationAvailability(document.Project, _onCompilationAvailable);
TextDiffing\EditorTextDifferencingService.cs (1)
40var diffService = _differenceSelectorService.GetTextDifferencingService(oldDocument.Project.Services.GetService<IContentTypeLanguageService>().GetDefaultContentType())
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (19)
AsyncSuggestedActionsSource.cs (2)
104using var _1 = RemoteKeepAliveSession.Create(document.Project.Solution, _listener); 176var workspace = document.Project.Solution.Workspace;
CommandHandlers\GoToMatchingBraceCommandHandler.cs (1)
44var options = _globalOptions.GetBraceMatchingOptions(document.Project.Language);
Controller.cs (1)
134_providers = document.Project.Solution.Services.SelectMatchingExtensionValues(
Controller.Session_ComputeModel.cs (1)
87var options = Controller.GlobalOptions.GetSignatureHelpOptions(document.Project.Language);
NavigableSymbolService.NavigableSymbolSource.cs (1)
57var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
NavigationCommandHandlers\FindBaseSymbolsCommandHandler.cs (1)
90var definitionItem = overriddenSymbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindDerivedSymbolsCommandHandler.cs (2)
104document.Project.Solution, cancellationToken).ConfigureAwait(false); 108var definitionItem = candidate.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindExtensionMethodsCommandHandler.cs (2)
69var solution = document.Project.Solution; 91if (!document.Project.TryGetCompilation(out var compilation))
NavigationCommandHandlers\FindImplementingMembersCommandHandler.cs (3)
106var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 115await InspectInterfaceAsync(context, interfaceSymbol, namedTypeSymbol, document.Project, cancellationToken).ConfigureAwait(false); 120await InspectInterfaceAsync(context, iFace, namedTypeSymbol, document.Project, cancellationToken).ConfigureAwait(false);
NavigationCommandHandlers\FindMemberOverloadsCommandHandler.cs (1)
86var definitionItem = curSymbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindReferencesOfOverloadsCommandHandler.cs (3)
116if (!document.Project.TryGetCompilation(out var compilation)) 125var symbolsToAdd = await GatherSymbolsAsync(sym, document.Project.Solution, cancellationToken).ConfigureAwait(false); 132await AbstractFindUsagesService.FindSymbolReferencesAsync(context, candidate, document.Project, cancellationToken).ConfigureAwait(false);
SuggestedActionsSource.cs (1)
165var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (5)
ChangeSignature\ChangeSignatureTestState.cs (1)
75return (TestChangeSignatureOptionsService)InvocationDocument.Project.Solution.Services.GetRequiredService<IChangeSignatureOptionsService>();
Diagnostics\AbstractSuppressionAllCodeTests.cs (1)
111document.Project.Solution, new ProgressTracker(), CancellationToken.None).GetAwaiter().GetResult();
Diagnostics\AbstractUserDiagnosticTest.cs (3)
155(a, d) => fixes.Add(new CodeFix(document.Project, a, d)), 214? new FixAllState(fixAllProvider, diagnostic.Location.SourceSpan, document, document.Project, fixer, scope, equivalenceKey, diagnosticIds, fixAllDiagnosticProvider, optionsProvider) 215: new FixAllState(fixAllProvider, diagnosticSpan: null, document: null, document.Project, fixer, scope, equivalenceKey, diagnosticIds, fixAllDiagnosticProvider, optionsProvider);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (26)
ChangeSignature\AddedParameterOrExistingIndex.cs (1)
66var type = document.Project.Language switch
Completion\AbstractCompletionProviderTests.cs (16)
159var completionService = GetCompletionService(document.Project); 277return await GetCompletionListAsync(GetCompletionService(currentDocument.Project), currentDocument, position, RoslynCompletion.CompletionTrigger.Invoke, options).ConfigureAwait(false); 463var service = GetCompletionService(document.Project); 470if (service.GetProvider(firstItem, document.Project) is ICustomCommitCompletionProvider customCommitCompletionProvider) 510document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution); 586var service = GetCompletionService(document.Project); 816var completionService = GetCompletionService(document.Project); 872var completionService = GetCompletionService(document.Project); 904var completionService = GetCompletionService(document.Project); 1052var service = GetCompletionService(document.Project); 1060var isTextualTriggerCharacterResult = service.ShouldTriggerCompletion(document.Project, document.Project.Services, text, position + 1, trigger, options, document.Project.Solution.Options, GetRoles(document)); 1102var service = GetCompletionService(document.Project); 1134var completionService = GetCompletionService(document.Project);
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
69return (TestGenerateTypeOptionsService)InvocationDocument.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>(); 77return (TestProjectManagementService)InvocationDocument.Project.Solution.Services.GetService<IProjectManagementService>();
Diagnostics\TestDiagnosticAnalyzerDriver.cs (2)
88=> GetDiagnosticsAsync(document.Project, document, filterSpan, getDocumentDiagnostics: true, getProjectDiagnostics: true); 106=> GetDiagnosticsAsync(document.Project, document, span, getDocumentDiagnostics: true, getProjectDiagnostics: false);
EditAndContinue\EditAndContinueTestHelpers.cs (1)
402oldProject = oldProject.AddDocument(name, oldRoot, filePath: oldPath).Project;
ExtractInterface\ExtractInterfaceTestState.cs (1)
75return (TestExtractInterfaceOptionsService)ExtractFromDocument.Project.Solution.Services.GetService<IExtractInterfaceOptionsService>();
Formatting\AbstractNewDocumentFormattingServiceTests.cs (1)
33var languageServices = document.Project.Services;
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
101document1 = document1.Project.WithParseOptions(parseOptions).GetDocument(document1.Id); 112document2 = document2.Project.WithParseOptions(parseOptions).GetDocument(document2.Id);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (128)
CodeFixes\CodeFixServiceTests.cs (3)
373extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 824var solution = await codeAction.GetChangedSolutionInternalAsync(txtDocument.Project.Solution); 882return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText);
CodeGeneration\AbstractCodeGenerationTests.cs (1)
42var options = document.Project.Services.GetRequiredService<ISimplificationService>().DefaultOptions;
CodeGeneration\CodeGenerationTests.cs (1)
882this.Service = Document.Project.Services.GetService<ICodeGenerationService>();
CodeRefactorings\CodeRefactoringServiceTest.cs (7)
117var extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 176.AddAdditionalDocument("test.txt", "", filePath: "test.txt").Project 177.AddAdditionalDocument("test.log", "", filePath: "test.log").Project; 215.AddAnalyzerConfigDocument(".editorconfig", SourceText.From(""), filePath: "c:\\.editorconfig").Project 216.AddAnalyzerConfigDocument(".globalconfig", SourceText.From("is_global = true"), filePath: "c:\\.globalconfig").Project; 257return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 258return document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, newText);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (9)
194project = project.AddAnalyzerConfigDocument(".editorconfig", filePath: "z:\\.editorconfig", text: SourceText.From(editorconfigText)).Project; 198var applied = workspace.TryApplyChanges(document.Project.Solution); 400document.Project.Id, 401ImmutableArray.Create(DiagnosticData.Create(document.Project.Solution, Diagnostic.Create(NoNameAnalyzer.s_syntaxRule, location, properties), document.Project))), 557filePath: "z:\\.editorconfig").Project; 646.AddAdditionalDocument(name: "dummy.txt", text: "Additional File Text", filePath: "dummy.txt").Project; 649project = project.AddAdditionalDocument(name: "dummy2.txt", text: "Additional File2 Text", filePath: "dummy2.txt").Project; 1240await analyzer.AnalyzeProjectAsync(textDocument.Project, semanticsChanged: true, reasons: InvocationReasons.Empty, cancellationToken: CancellationToken.None).ConfigureAwait(false);
Diagnostics\DiagnosticDataTests.cs (14)
125projectId: document.Project.Id, 129language: document.Project.Language); 144.Project.AddAdditionalDocument("AdditionalDocument.txt", "First line in file", filePath: "AdditionalDocument.txt"); 145var document = additionalDocument.Project.Documents.Single(); 158projectId: document.Project.Id, 163language: document.Project.Language); 165var diagnostic = await diagnosticData.ToDiagnosticAsync(document.Project, CancellationToken.None); 231secondDocument = firstDocument.Project.Solution.AddProject("TestProject2", "TestProject2", LanguageNames.CSharp) 236secondDocument = firstDocument.Project.AddDocument("test2.cs", "class C2 { }", filePath: "test2.cs"); 239firstDocument = secondDocument.Project.Solution.GetRequiredDocument(firstDocument.Id); 252projectId: firstDocument.Project.Id, 257language: firstDocument.Project.Language); 259var diagnostic = await diagnosticData.ToDiagnosticAsync(firstDocument.Project, CancellationToken.None); 263firstDocument = firstDocument.Project.Solution
Diagnostics\DiagnosticServiceTests.cs (22)
49var diagnostic = RaiseDiagnosticEvent(mutex, source, workspace, document.Project.Id, document.Id, id); 54var data2 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, null, null, includeSuppressedDiagnostics: false, CancellationToken.None); 57var data3 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, document.Id, null, includeSuppressedDiagnostics: false, CancellationToken.None); 60var data4 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, document.Id, id, includeSuppressedDiagnostics: false, CancellationToken.None); 70var document2 = document.Project.AddDocument("TestDocument2", string.Empty); 79RaiseDiagnosticEvent(mutex, source, workspace, document.Project.Id, document.Id, id); 81var id2 = Tuple.Create(workspace, document.Project, document); 82RaiseDiagnosticEvent(mutex, source, workspace, document.Project.Id, document.Id, id2); 84RaiseDiagnosticEvent(mutex, source, workspace, document2.Project.Id, document2.Id, Tuple.Create(workspace, document2)); 86var id3 = Tuple.Create(workspace, document.Project); 87RaiseDiagnosticEvent(mutex, source, workspace, document.Project.Id, null, id3); 93var data2 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, null, null, includeSuppressedDiagnostics: false, CancellationToken.None); 96var data3 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, null, id3, includeSuppressedDiagnostics: false, CancellationToken.None); 99var data4 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, document.Id, null, includeSuppressedDiagnostics: false, CancellationToken.None); 102var data5 = await diagnosticService.GetDiagnosticsAsync(workspace, document.Project.Id, document.Id, id, includeSuppressedDiagnostics: false, CancellationToken.None); 112var document2 = document.Project.AddDocument("TestDocument2", string.Empty); 125RaiseDiagnosticEvent(mutex, source1, workspace, document.Project.Id, document.Id, Tuple.Create(workspace, document)); 126RaiseDiagnosticEvent(mutex, source1, workspace, document.Project.Id, document.Id, Tuple.Create(workspace, document.Project, document)); 127RaiseDiagnosticEvent(mutex, source1, workspace, document2.Project.Id, document2.Id, Tuple.Create(workspace, document2)); 129RaiseDiagnosticEvent(mutex, source2, workspace, document.Project.Id, null, Tuple.Create(workspace, document.Project));
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (1)
68workspace.TryApplyChanges(document.WithText(text.WithChanges(new TextChange(new TextSpan(text.Length - 1, 1), string.Empty))).Project.Solution);
EditAndContinue\ActiveStatementsMapTests.cs (3)
92.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution; 147.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution; 198.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution;
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (45)
158solution = document.Project.Solution; 161return document.Project.Solution; 648solution = solution.WithProjectOutputFilePath(document.Project.Id, moduleFile.Path); 683solution = document.Project.Solution; 718var documentInfo = CreateDesignTimeOnlyDocument(document1.Project.Id); 719solution = solution.WithProjectOutputFilePath(document1.Project.Id, moduleFile.Path).AddDocument(documentInfo); 754DocumentId.CreateNewId(document.Project.Id), 856Assert.True(designTimeOnlyDocument2.Project.SupportsEditAndContinue()); 931AssertEx.Equal(new[] { $"{document2.Project.Id}: Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, moduleFile.Path, expectedErrorMessage)}" }, InspectDiagnostics(emitDiagnostics)); 984var project = document1.Project; 1037var project = document1.Project; 1096solution = documentA.Project.Solution; 1101var project = documentA.Project; 1112solution = documentB.Project.Solution; 1192solution = document0.Project.Solution; 1302AssertEx.Equal(new[] { $"{document2.FilePath}: (5,0)-(5,32): Error ENC2016: {string.Format(FeaturesResources.EditAndContinueDisallowedByProject, document2.Project.Name, "*message*")}" }, InspectDiagnostics(emitDiagnostics)); 1580solution = document1.Project.Solution; 1679var project = document1.Project; 1723var project = document1.Project; 1866AddDocument("A.cs", "class Program { void Main() { System.Console.WriteLine(1); } }", filePath: pathA).Project.Solution. 1868AddDocument("Common.cs", "class Common {}", filePath: pathCommon).Project. 1869AddDocument("B.cs", "class B {}", filePath: pathB).Project.Solution. 1871AddDocument("Common.cs", "class Common {}", filePath: pathCommon).Project. 1872AddDocument("C.cs", "class C {}", filePath: pathC).Project.Solution; 1951var project = solution.AddProject("A", "A", "C#").AddDocument("A.cs", "", filePath: pathA).Project; 2120solution = documentB2.Project.Solution; 2140await debuggingSession.GetCurrentActiveStatementPositionAsync(documentB2.Project.Solution, (_, _, _) => new(trackedActiveSpans), activeStatements[1].ActiveInstruction, CancellationToken.None)); 2341AssertEx.Equal(new[] { $"{document2.Project.Id}: Error ENC1007: {FeaturesResources.ChangesRequiredSynthesizedType}" }, InspectDiagnostics(emitDiagnostics)); 2434solution = document1.Project.Solution; 2523var project = document2.Project; 2614solution = document1.Project.Solution; 2651var project = document1.Project; 2738Assert.Equal(document2.Project.Id, baselineProjectId); 2762Assert.Same(newBaseline, debuggingSession.GetTestAccessor().GetProjectEmitBaseline(document2.Project.Id)); 2878Assert.Equal(document2.Project.Id, baselineProjectId); 2890Assert.Same(newBaseline, debuggingSession.GetTestAccessor().GetProjectEmitBaseline(document2.Project.Id)); 3253solution = document1.Project.Solution.RemoveDocument(document1.Id); 3303AssertEx.Equal(new[] { $"{document2.Project.Id}: Error ENC1007: {FeaturesResources.ChangesRequiredSynthesizedType}" }, InspectDiagnostics(emitDiagnostics)); 3340var projectA = documentA.Project; 3344AddDocument("DocB", source1, filePath: Path.Combine(TempRoot.Root, "DocB.cs")).Project; 3487AssertEx.Equal(new[] { $"{document1.Project.Id}: Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, "test-pdb", new FileNotFoundException().Message)}" }, InspectDiagnostics(emitDiagnostics)); 3520AssertEx.Equal(new[] { $"{document.Project.Id}: Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, "test-assembly", "*message*")}" }, InspectDiagnostics(emitDiagnostics)); 3601await debuggingSession.GetCurrentActiveStatementPositionAsync(document1.Project.Solution, (_, _, _) => new(trackedActiveSpans1), activeInstruction1, CancellationToken.None)); 3604await debuggingSession.GetCurrentActiveStatementPositionAsync(document1.Project.Solution, (_, _, _) => new(trackedActiveSpans1), activeInstruction2, CancellationToken.None)); 3724solution = document.Project.Solution;
EditAndContinue\EmitSolutionUpdateResultsTests.cs (4)
36var solution = document.Project.Solution; 49document.Project.Id, 65document.Project.Id, 82document.Project.Id,
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (3)
83var linkedDocument = document.Project.Solution.Projects.Single(p => p != document.Project).Documents.Single(); 85var newSolution = document.Project.Solution
MetadataAsSource\AbstractMetadataAsSourceTests.cs (2)
87metadataProject = newDoc.Project; 111var generatedCompilation = await generatedDocument.Project.GetCompilationAsync();
MetadataAsSource\MetadataAsSourceTests.cs (2)
1727Assert.Equal("mscorlib", openedDocument.Project.AssemblyName); 1728Assert.Equal("mscorlib", openedDocument.Project.Name);
Preview\PreviewWorkspaceTests.cs (5)
83.AddDocument("document", "").Project.Solution; 89var changedSolution = previewWorkspace.CurrentSolution.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution; 112Assert.True(previewWorkspace.TryApplyChanges(document.Project.Solution)); 197incrementalAnalyzer.CreateIncrementalAnalyzer(leftDocument.Project.Solution.Workspace); 198incrementalAnalyzer.CreateIncrementalAnalyzer(rightDocument.Project.Solution.Workspace);
SolutionCrawler\WorkCoordinatorTests.cs (4)
198var changedSolution = solution.AddProject("P3", "P3", LanguageNames.CSharp).AddDocument("D1", "").Project.Solution; 348project = project.AddAdditionalDocument("a1", SourceText.From("")).Project; 1673var documentTrackingService = (TestDocumentTrackingService)document.Project.Solution.Services.GetRequiredService<IDocumentTrackingService>(); 1897if (_globalOptions.GetBackgroundAnalysisScope(document.Project.Language) != BackgroundAnalysisScope.ActiveFile)
TextEditor\OpenDocumentTests.cs (2)
63Assert.Same(workspace.CurrentSolution, newDocumentWithChanges.Project.Solution); 69Assert.NotSame(workspace.CurrentSolution, originalDocumentWithChanges.Project.Solution);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (20)
InlineDiagnostics\InlineDiagnosticsAdornmentManager.cs (1)
72var option = _globalOptions.GetOption(InlineDiagnosticsOptionsStorage.Location, document.Project.Language);
InlineHints\InlineHintsTag.cs (1)
107var classificationOptions = _taggerProvider.EditorOptionsService.GlobalOptions.GetClassificationOptions(document.Project.Language);
InlineHints\InlineHintsTagger.cs (1)
170var classify = document != null && _taggerProvider.EditorOptionsService.GlobalOptions.GetOption(InlineHintsViewOptionsStorage.ColorHints, document.Project.Language);
LineSeparators\LineSeparatorTaggerProvider.cs (1)
92if (!GlobalOptions.GetOption(LineSeparatorsOptionsStorage.LineSeparator, document.Project.Language))
NavigableSymbols\NavigableSymbolService.NavigableSymbolSource.cs (1)
57var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
NavigateTo\NavigateToItemDisplay.cs (3)
75new[] { new DescriptionRun(document.Project.Name) })), 117var workspace = document.Project.Solution.Workspace; 131var workspace = document.Project.Solution.Workspace;
Peek\PeekableItemSource.cs (3)
76var services = document.Project.Solution.Services; 90navigableItems, document.Project, _peekResultFactory, cancellationToken).ConfigureAwait(false)) 116mappingResult ??= new SymbolMappingResult(document.Project, symbol);
QuickInfo\ContentControlService.cs (1)
71var workspace = new PreviewWorkspace(document.Project.Solution);
QuickInfo\Extensions.cs (2)
36var contentTypeService = document.Project.Services.GetService<IContentTypeLanguageService>(); 39var cloneServices = document.Project.Solution.Services.ExportProvider.GetExports<ITextBufferCloneService>();
SignatureHelp\Controller.cs (1)
134_providers = document.Project.Solution.Services.SelectMatchingExtensionValues(
SignatureHelp\Controller.Session_ComputeModel.cs (1)
87var options = Controller.GlobalOptions.GetSignatureHelpOptions(document.Project.Language);
StringIndentation\StringIndentationTaggerProvider.cs (1)
90if (!GlobalOptions.GetOption(StringIndentationOptionsStorage.StringIdentation, document.Project.Language))
Suggestions\AsyncSuggestedActionsSource.cs (2)
104using var _1 = RemoteKeepAliveSession.Create(document.Project.Solution, _listener); 176var workspace = document.Project.Solution.Workspace;
Suggestions\SuggestedActionsSource.cs (1)
165var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (32)
CodeFixes\CodeFixServiceTests.vb (2)
238Contract.ThrowIfFalse(context.Document.Project.Language = LanguageNames.CSharp) 263Contract.ThrowIfFalse(context.Document.Project.Language = LanguageNames.CSharp)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (2)
120Utilities.AssertEx.TokensAreEqual(expected, actual, updatedDocument.Project.Language) 169Dim context = New CodeFixContext(document, diagnostic, Sub(a, d) fixes.Add(New CodeFix(document.Project, a, d)), CancellationToken.None)
Diagnostics\AddImport\AddImportCrossLanguageTests.vb (2)
580Dim oldProject = oldSolution.GetDocument(initialDocId).Project 581Dim newProject = newSolution.GetDocument(initialDocId).Project
Diagnostics\AdditionalFileDiagnosticsTests.vb (2)
115Dim project = context.Document.Project 122Dim newSln = appConfigDoc.Project.Solution.WithAdditionalDocumentText(appConfigDoc.Id, SourceText.From("true", text.Encoding))
Diagnostics\DiagnosticServiceTests.vb (2)
1440project = additionalDoc.Project 1452project = additionalDoc.Project
Expansion\AbstractExpansionTest.vb (1)
31Dim cleanupOptions = CodeCleanupOptions.GetDefault(document.Project.Services)
FindReferences\FindReferencesTests.LinkedFiles.vb (10)
39Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 71Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 114Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 128references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 224Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 264Dim references = (Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing)).ToList() 306Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 349Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 392Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 435Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing)
FindReferences\FindReferencesTests.vb (4)
295Dim project = document.Project 309Function(g) GetFilePathAndProjectLabel(document.Project.Solution, g.Key), 421Function(g) GetFilePathAndProjectLabel(document.Project.Solution, g.Key), 512Return $"{document.Project.Name}: {document.FilePath}"
GoToDefinition\GoToDefinitionTestsBase.vb (1)
44Dim goToDefService = If(document.Project.Language = LanguageNames.CSharp,
IntelliSense\AbstractIntellisenseQuickInfoBuilderTests.vb (1)
81Dim classificationOptions = workspace.GlobalOptions.GetClassificationOptions(document.Project.Language)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (4)
6889service.QueueCacheWarmUpTask(document.Project) 6896service.QueueCacheWarmUpTask(document.Project) 6939Await ExtensionMethodImportCompletionHelper.WarmUpCacheAsync(document.Project, CancellationToken.None) 6947Await ExtensionMethodImportCompletionHelper.WarmUpCacheAsync(document.Project, CancellationToken.None)
KeywordHighlighting\AbstractKeywordHighlightingTests.vb (1)
32globalOptions.SetGlobalOption(KeywordHighlightingOptionsStorage.KeywordHighlighting, document.Project.Language, optionIsEnabled)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (1)
Internal\EmbeddedLanguages\AspNetCoreEmbeddedLanguageDocumentHighlighter.cs (1)
37var highlighters = AspNetCoreDocumentHighlighterExtensionProvider.GetExtensions(document.Project);
Microsoft.CodeAnalysis.ExternalAccess.FSharp (8)
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>();
Internal\Editor\FSharpNavigationBarItemService.cs (1)
69var workspace = document.Project.Solution.Workspace;
Internal\Editor\FSharpSmartIndentProvider.cs (2)
88var indentStyle = _provider._globalOptions.GetOption(IndentationOptionsStorage.SmartIndent, document.Project.Language); 95result = _provider._service.GetDesiredIndentation(document.Project.LanguageServices, text, document.Id, document.FilePath, line.LineNumber, fsharpOptions);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (7)
Completion\OmniSharpCompletionService.cs (4)
25return completionService.ShouldTriggerCompletion(document.Project, document.Project.Services, text, caretPosition, trigger, options.ToCompletionOptions(), document.Project.Solution.Options, roles); 37return completionService.GetCompletionsAsync(document, caretPosition, options.ToCompletionOptions(), document.Project.Solution.Options, trigger, roles, cancellationToken);
Formatting\OmniSharpSyntaxFormattingOptionsWrapper.cs (1)
26var defaultOptions = CodeCleanupOptions.GetDefault(document.Project.Services);
MetadataAsSource\OmniSharpMetadataAsSourceService.cs (2)
41GenerationOptions = CodeGenerationOptions.GetDefault(document.Project.Services), 65GenerationOptions = CodeGenerationOptions.GetDefault(document.Project.Services),
Microsoft.CodeAnalysis.ExternalAccess.Razor (4)
RazorClassifierAccessor.cs (2)
20document.Project.Solution.Services, document.Project, semanticModel, textSpan, options.UnderlyingObject, cancellationToken);
RazorCSharpFormattingInteractionService.cs (1)
41Contract.ThrowIfFalse(document.Project.Language is LanguageNames.CSharp);
RazorSpanMappingServiceWrapper.cs (1)
36var diffService = newDocument.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
Microsoft.CodeAnalysis.Features (495)
AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
60var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (4)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 55var targetFolders = PathMetadataUtilities.BuildFoldersFromNamespace(targetNamespace, document.Project.DefaultNamespace); 67var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false); 68Debug.Assert(newSolution != document.Project.Solution);
AbstractConvertToAsyncCodeFixProvider.cs (1)
72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
AbstractFileHeaderCodeFixProvider.cs (1)
65!document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(tree).TryGetEditorConfigOption(CodeStyleOptions2.FileHeaderTemplate, out fileHeaderTemplate))
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
164var solution = document.Project.Solution; 198return newDocument.Project.Solution;
AbstractMakeMethodSynchronousCodeFixProvider.cs (6)
77var solution = document.Project.Solution; 99var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 110var newSolution = newDocument.Project.Solution; 138ImmutableArray.Create<ISymbol>(methodSymbol), document.Project.Solution, cancellationToken).ConfigureAwait(false); 146document.Project.Solution, referencedSymbol.Locations.ToImmutableArray(), cancellationToken).ConfigureAwait(false); 151return document.Project.Solution;
AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
33var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 67var solutionServices = document.Project.Solution.Services;
AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
292var editor = new SyntaxEditor(root, document.Project.Solution.Services); 842var provider = document.Project.Solution.Services; 914var referencedSymbols = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractUnsealClassCodeFixProvider.cs (3)
43type, document.Project.Solution, cancellationToken).ConfigureAwait(false); 50c => UnsealDeclarationsAsync(document.Project.Solution, definition.DeclaringSyntaxReferences, c), 66var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractUpgradeProjectCodeFixProvider.cs (1)
43var project = context.Document.Project;
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
99var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AbstractUseConditionalExpressionCodeFixProvider.cs (3)
62var nestedEditor = new SyntaxEditor(root, document.Project.Solution.Services); 80var provider = document.Project.Solution.Services; 154fallbackOptions.GetOptions(document.Project.Services)?.ConditionalExpressionWrappingLength ??
AbstractUseObjectInitializerCodeFixProvider.cs (1)
100var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (3)
55var services = _document.Project.Solution.Services; 71var constructorDocument = _document.Project.GetDocument(syntaxTree); 74return Task.FromResult<Solution?>(constructorDocument.WithSyntaxRoot(newRoot).Project.Solution);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (2)
42if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 184priorDocument.Project.Solution, postProcessChanges: true, cancellationToken).ConfigureAwait(false);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
104var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
118var editor = new SyntaxEditor(syntaxRoot, document.Project.Solution.Services);
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
73document.Project.Documents
AddImport\AbstractAddImportCodeFixProvider.cs (3)
57var services = document.Project.Solution.Services; 59var codeActionOptions = context.Options.GetOptions(document.Project.Services); 67var packageSources = installerService?.IsEnabled(document.Project.Id) == true
AddImport\AbstractAddImportFeatureService.cs (6)
62var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 66document.Project.Solution, 127var project = document.Project; 513var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 517document.Project.Solution, 596AddImportFixKind.PackageSymbol => installerService?.IsInstalled(document.Project.Id, fixData.PackageName) == false
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
40var newProject = newDocument.Project;
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
61this.OriginalDocument.Project.Solution, cancellationToken).ConfigureAwait(false)); 77return updatedDocument.Project.Solution;
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (2)
39=> fixData.ProjectReferenceToAdd != null && fixData.ProjectReferenceToAdd != originalDocument.Project.Id; 53return Task.FromResult<CodeActionOperation?>(new AddProjectReferenceCodeActionOperation(OriginalDocument.Project.Id, FixData.ProjectReferenceToAdd, applyOperation));
AddImport\CodeActions\SymbolReference.SymbolReferenceCodeAction.cs (2)
62var updatedProject = await UpdateProjectAsync(updatedDocument.Project, isPreview, cancellationToken).ConfigureAwait(false); 63return updatedProject ?? new ApplyChangesOperation(updatedDocument.Project.Solution);
AddImport\References\ProjectSymbolReference.cs (4)
44return document.Project.Id == _project.Id 59=> document.Project.Id != _project.Id; 68if (document.Project.Id == _project.Id) 100var project = document.Project;
AddImport\SymbolReferenceFinder.cs (1)
94_owner, _document.Project, exact, cancellationToken);
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (1)
98var project = _document.Project;
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (2)
61context.Document.Project, identity, context.CancellationToken).ConfigureAwait(false); 71var compilation = await context.Document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
AddPackage\AbstractAddPackageCodeFixProvider.cs (3)
47var workspaceServices = document.Project.Solution.Services; 55context.Options.GetOptions(document.Project.Services).SearchOptions.SearchNuGetPackages && 56installerService.IsEnabled(document.Project.Id))
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
55_document.Project.Solution, packageName, versionOpt).ToList();
AddParameterService.cs (2)
83var solution = invocationDocument.Project.Solution; 151method, invocationDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
AnalyzerOptionsProviders.cs (2)
20var analyzerOptions = document.Project.AnalyzerOptions; 23return new AnalyzerOptionsProvider(configOptions, document.Project.Language, analyzerOptions);
BraceMatching\AbstractEmbeddedLanguageBraceMatcher.cs (1)
46var result = braceMatcher.Value.FindBraces(document.Project, semanticModel, token, position, options, cancellationToken);
BraceMatching\BraceMatchingService.cs (1)
39var matchers = _braceMatchers.Where(b => b.Metadata.Language == document.Project.Language);
ChangeSignature\AbstractChangeSignatureService.cs (4)
107symbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false) ?? symbol; 161var solution = document.Project.Solution; 382var updater = doc.Project.Services.GetRequiredService<AbstractChangeSignatureService>(); 409doc.Project.Solution.Services,
ChangeSignature\ChangeSignatureAnalyzedContext.cs (1)
31public Solution Solution => Document.Project.Solution;
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
274var solution = editorConfigDocument.Project.Solution; 324currentSolution = addedAnalyzerConfigDocument.Project.Solution;
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (1)
58=> Task.FromResult(GetConfigurations(document.Project, diagnostics, cancellationToken));
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.cs (1)
47=> Task.FromResult(GetConfigurations(document.Project, diagnostics, cancellationToken));
CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
34if (context.Document.Project.IsSubmission)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
35new ApplyChangesOperation(changedSuppressionDocument.Project.Solution),
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
168document, document.Project, diagnostics, suppressionTargetInfo, fallbackOptions, skipSuppressMessage, skipUnsuppress, cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (1)
41var services = suppressionsDoc.Project.Solution.Services;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (5)
80var currentSolution = triggerDocument.Project.Solution; 81foreach (var grouping in diagnosticsByDocument.GroupBy(d => d.Key.Project)) 95currentSolution = newDocument.Project.Solution; 125currentSolution = newDocument.Project.Solution; 139var services = suppressionsDoc.Project.Solution.Services;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (1)
87=> Formatter.Format(node, _document.Project.Solution.Services, _options, cancellationToken);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
70return editor.GetChangedDocument().Project.Solution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
221=> Formatter.Format(node, _document.Project.Solution.Services, _options, cancellationToken);
CodeFixes\Suppression\WrapperCodeFixProvider.cs (1)
42var suppressionFixes = await _suppressionFixProvider.GetFixesAsync(context.Document.Project, projectDiagnostics, context.Options, context.CancellationToken).ConfigureAwait(false);
CodeLens\CodeLensReferencesService.cs (1)
257return !string.IsNullOrEmpty(fullName) ? new ReferenceMethodDescriptor(fullName, document.FilePath, document.Project.OutputFilePath) : null;
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (9)
57var solution = document.Project.Solution; 73var usableFixes = unambiguousFixes.WhereAsArray(fixData => DoesNotAddReference(fixData, document.Project.Id)); 92var solution = document.Project.Solution; 119var newProject = document.Project; 166var services = document.Project.Solution.Services; 216document.Project.Solution, progressTracker, cancellationToken).ConfigureAwait(false); 220newSolution = document.Project.Solution; 236var projectChanges = newDocument.Project.GetChanges(document.Project);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsRefactoringProvider.cs (2)
45context.Options.GetOptions(document.Project.Services).HideAdvancedMembers); 64return modifiedDocument.Project.Solution;
CodeRefactorings\CodeRefactoringService.cs (4)
72if (LanguageToProvidersMap.TryGetValue(document.Project.Language, out var lazyProviders)) 82if (document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive) 98var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 128var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
43var solution = document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
65return document.Project.Solution; 78return modifiedSolution ?? document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (4)
51var projectToBeUpdated = SemanticDocument.Document.Project; 67var solutionWithNewDocument = documentWithMovedType.Project.Solution; 125var projectToBeUpdated = document.Project; 205return updatedDocument.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
97return changedDocument.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameFileEditor.cs (1)
40var oldSolution = SemanticDocument.Document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (1)
30var solution = SemanticDocument.Document.Project.Solution;
CodeRefactorings\MoveType\MoveTypeCodeRefactoringProvider.cs (1)
25if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (10)
132var solution = document.Project.Solution; 193var solution = document.Project.Solution; 348var solution = document.Project.Solution; 356!PathUtilities.PathsEqual(arg.solution.GetRequiredDocument(id).Project.FilePath!, arg.document.Project.FilePath!), (solution, document))) 471var solutionWithChangedNamespace = documentWithNewNamespace.Project.Solution; 555symbol, document.Project.Solution, progress, documents: null, 631var services = documentWithAddedImports.Project.Solution.Services; 785solution = document.Project.Solution; 846var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (1)
26if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles ||
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (3)
45var solution = _state.Document.Project.Solution; 46var newDocumentId = DocumentId.CreateNewId(document.Project.Id, document.Name); 74var projectRootFolder = FolderInfo.CreateFolderHierarchyForProject(document.Project);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (3)
157var projectRoot = PathUtilities.GetDirectoryName(document.Project.FilePath); 171var solution = document.Project.Solution; 180documents.Select(d => d.Project.DefaultNamespace),
Common\AbstractProjectExtensionProvider.cs (1)
82var extensions = GetExtensions(document.Project);
Completion\CommonCompletionProvider.cs (1)
79var snippetService = document.Project.Services.GetService<ISnippetInfoService>();
Completion\CompletionOptions.cs (1)
69var solution = document.Project.Solution;
Completion\CompletionProvider.cs (2)
58=> ShouldTriggerCompletion(document.Project.Services, await document.GetTextAsync(cancellationToken).ConfigureAwait(false), caretPosition, trigger, options, document.Project.Solution.Options);
Completion\CompletionService.cs (5)
101var languageServices = document?.Project.Services ?? _services.GetLanguageServices(Language); 105var passThroughOptions = options ?? document?.Project.Solution.Options ?? OptionSet.Empty; 107return ShouldTriggerCompletion(document?.Project, languageServices, text, caretPosition, trigger, completionOptions, passThroughOptions, roles); 196var provider = GetProvider(item, document.Project); 222var provider = GetProvider(item, document.Project);
Completion\CompletionService_GetCompletions.cs (5)
45var passThroughOptions = options ?? document.Project.Solution.Options; 102var providers = _providerManager.GetFilteredProviders(document.Project, roles, trigger, options); 161if (ShouldTriggerCompletion(document.Project, document.Project.Services, text, caretPosition, trigger, options, passThroughOptions, roles)) 163var 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\AbstractInternalsVisibleToCompletionProvider.cs (4)
135var currentProject = context.Document.Project; 137foreach (var project in context.Document.Project.Solution.Projects) 179var project = completionContext.Document.Project; 272var project = document.Project.Solution.GetRequiredProject(projectId);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (2)
41var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService>(); 144document.Project.Solution,
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
23var solution = originatingDocument.Project.Solution;
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
206var relatedDocumentIds = document.Project.Solution.GetRelatedDocumentIds(document.Id); 211var relatedDocument = document.Project.Solution.GetRequiredDocument(relatedId);
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
183supportedPlatformData = new SupportedPlatformData(completionContext.Document.Project.Solution, invalidProjects, totalProjects); 312var solution = document.Project.Solution;
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
31_ = ExtensionMethodImportCompletionHelper.WarmUpCacheAsync(document.Project, CancellationToken.None);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (3)
133var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService>(); 141var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 218var solution = document.Project.Solution;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (2)
33typeImportCompletionService.QueueCacheWarmUpTask(document.Project); 44completionContext.Document.Project,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (2)
58var project = document.Project; 121var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (7)
51_cacheService = GetCacheService(document.Project); 99foreach (var peReference in GetAllRelevantPeReferences(_originatingDocument.Project)) 107foreach (var project in GetAllRelevantProjects(_originatingDocument.Project)) 142GetCacheService(_originatingDocument.Project).WorkQueue.AddWork(_originatingDocument.Project); 188return project == _originatingDocument.Project 202_originatingDocument.Project.Solution, peReference, checksum: null, cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (2)
132var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 140document.Project.Solution.Services,
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
169if (document.Project.CompilationOptions?.MetadataReferenceResolver is RuntimeMetadataReferenceResolver resolver)
Completion\Providers\Scripting\AbstractReferenceDirectiveCompletionProvider.cs (1)
52var resolver = context.Document.Project.CompilationOptions.MetadataReferenceResolver as RuntimeMetadataReferenceResolver;
Completion\Providers\SymbolCompletionItem.cs (8)
131var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 142var linkedDoc = document.Project.Solution.GetRequiredDocument(id); 143var linkedCompilation = await linkedDoc.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 193var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); 197var services = document.Project.Solution.Services; 208return document.Project.Solution.GetRequiredDocument(contextId); 358var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); 362return await CommonCompletionUtilities.CreateDescriptionAsync(document.Project.Solution.Services, semanticModel, position, symbols, options, supportedPlatforms, cancellationToken).ConfigureAwait(false);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
84var editor = new SyntaxEditor(root, document.Project.Solution.Services);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
419var services = document.Project.Solution.Services;
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
38if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
151var editor = new SyntaxEditor(converter.ForEachInfo.SemanticModel.SyntaxTree.GetRoot(cancellationToken), document.Project.Solution.Services);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
46if (!syntaxFacts.SupportsConstantInterpolatedStrings(document.Project.ParseOptions!))
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
58if (!syntaxFacts.SupportsConstantInterpolatedStrings(document.Project.ParseOptions!))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (8)
214var solution = document.Project.Solution; 251return document.WithSyntaxRoot(newRoot).Project.Solution; 325foreach (var group in documentsToUpdate.GroupBy(d => d.Document.Project)) 420document.Project, tupleType, cancellationToken).ConfigureAwait(false), 422document.Project, tupleType, cancellationToken).ConfigureAwait(false), 516var solution = startingDocument.Project.Solution; 578var currentSolution = startingDocument.Project.Solution; 599currentSolution = updatedDocument.Project.Solution;
DesignerAttribute\DesignerAttributeDiscoveryService.cs (2)
83await ProcessProjectAsync(priorityDocument.Project, priorityDocument, useFrozenSnapshots, callback, cancellationToken).ConfigureAwait(false); 126project = document.WithFrozenPartialSemantics(cancellationToken).Project;
DocumentHighlighting\AbstractDocumentHighlightsService.cs (8)
39var solution = document.Project.Solution; 41var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 47document.Project, 71var solution = document.Project.Solution; 124symbol, document.Project.Solution, progress, 164var solution = startingDocument.Project.Solution; 182if (currentDocument.Project.Language == startingDocument.Project.Language)
DocumentSpanExtensions.cs (1)
16var solution = documentSpan.Document.Project.Solution;
EditAndContinue\CommittedSolution.cs (3)
210if (committedDocument == null && !solution.ContainsProject(document.Project.Id)) 475var compilationOutputs = _debuggingSession.GetCompilationOutputs(document.Project); 476using var debugInfoReaderProvider = GetMethodDebugInfoReader(compilationOutputs, document.Project.Name);
EditAndContinue\DebuggingSession.cs (5)
460var project = document.Project; 649if (!document.Project.SupportsEditAndContinue()) 777if (_isDisposed || !EditSession.InBreakState || !mappedDocument.State.SupportsEditAndContinue() || !mappedDocument.Project.SupportsEditAndContinue()) 784var newProject = mappedDocument.Project; 960var analyzer = newDocument.Project.Services.GetRequiredService<IEditAndContinueAnalyzer>();
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (4)
86var oldProject = oldDocument?.Project ?? oldSolution.GetRequiredProject(newDocument.Project.Id); 138var analyzer = newDocument.Project.Services.GetRequiredService<IEditAndContinueAnalyzer>(); 196var analyzer = document.Project.Services.GetRequiredService<IEditAndContinueAnalyzer>();
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (2)
262if (!RemoteSupportedLanguages.IsSupported(document.Project.Language)) 274document.Project.Solution,
EditAndContinue\Remote\RemoteEditAndContinueServiceProxy.cs (6)
175if (!RemoteSupportedLanguages.IsSupported(document.Project.Language)) 188diagnostic => RemapLocation(designTimeDocument, DiagnosticData.Create(document.Project.Solution, diagnostic, document.Project))); 195document.Project.Solution, 205var project = document.Project; 223diagnostic = await data.ToDiagnosticAsync(document.Project, cancellationToken).ConfigureAwait(false);
EditAndContinue\TraceLog.cs (3)
152Debug.Assert(document.Project.FilePath != null); 154var projectDir = PathUtilities.GetDirectoryName(document.Project.FilePath)!; 162var directory = CreateSessionDirectory(updateId.SessionId, Path.Combine(document.Project.Name, relativeDir));
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
41AddEmbeddedLanguageClassifications(document.Project, semanticModel, textSpan, options, result, cancellationToken);
EncapsulateField\AbstractEncapsulateFieldService.cs (9)
112var solution = document.Project.Solution; 143var currentSolution = document.Project.Solution; 180var solution = document.Project.Solution; 219solution = document.Project.Solution; 226solution = updatedLinkedDocument.Project.Solution; 249document, document.Project.Solution, field, generatedProperty, fallbackOptions, cancellationToken).ConfigureAwait(false); 254return documentWithProperty.Project.Solution; 265var projectId = document.Project.Id; 279var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (1)
21var syntaxFactsService = newDocument.Project.Services.GetService<ISyntaxFactsService>();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (4)
606await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, UnitTestingInvocationReasons.DocumentChanged).ConfigureAwait(false); 617await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, differenceResult.ChangeType, differenceResult.ChangedMember).ConfigureAwait(false); 644list.Add(new UnitTestingWorkItem(document.Id, document.Project.Language, UnitTestingInvocationReasons.DocumentAdded, isLowPriority: false, activeMember: null, EmptyAsyncToken.Instance)); 722pool.Object.Add(document.Project.Language);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
139EnqueueFullProjectDependency(document.Project, assembly); 176var solution = thisDocument.Project.Solution;
ExternalAccess\VSTypeScript\VSTypeScriptDocumentDiagnosticAnalyzer.cs (2)
20var analyzer = document.Project.Services.GetRequiredService<VSTypeScriptDiagnosticAnalyzerLanguageService>().Implementation; 31var analyzer = document.Project.Services.GetRequiredService<VSTypeScriptDiagnosticAnalyzerLanguageService>().Implementation;
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
37var solution = context.Document.Project.Solution;
ExtractClass\ExtractClassWithDialogCodeAction.cs (6)
66var extractClassService = _service ?? _document.Project.Solution.Services.GetRequiredService<IExtractClassOptionsService>(); 84_document.Project.Solution, 102_document.Project.CompilationOptions); 118_document.Project.Id, 127updatedDocument.Project.Solution, 266unformattedSolution = document.WithSyntaxRoot(currentRoot).Project.Solution;
ExtractInterface\AbstractExtractInterfaceService.cs (10)
143var solution = refactoringResult.DocumentToExtractFrom.Project.Solution; 157var containingNamespaceDisplay = GetContainingNamespaceDisplay(refactoringResult.TypeToExtractFrom, refactoringResult.DocumentToExtractFrom.Project.CompilationOptions); 193refactoringResult.DocumentToExtractFrom.Project.Id, 201unformattedInterfaceDocument.Project.Solution, 242var unformattedSolution = documentWithInterface.Project.Solution; 275var notificationService = document.Project.Solution.Services.GetService<INotificationService>(); 279var service = document.Project.Solution.Services.GetService<IExtractInterfaceOptionsService>(); 288document.Project.Language, 317formattedSolution = simplifiedDocument.Project.Solution; 361unformattedSolution = document.WithSyntaxRoot(editor.GetChangedRoot()).Project.Solution;
ExtractMethod\ExtractMethodResult.cs (1)
98var services = DocumentWithoutFinalFormatting.Project.Solution.Services;
ExtractMethod\MethodExtractor.Analyzer.cs (3)
351var syntaxFactsService = _semanticDocument.Document.Project.Services.GetService<ISyntaxFactsService>(); 592var semanticFacts = _semanticDocument.Document.Project.Services.GetRequiredService<ISemanticFactsService>(); 915var semanticFacts = _semanticDocument.Document.Project.Services.GetRequiredService<ISemanticFactsService>();
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (1)
44var options = await _context.GetOptionsAsync(document.Project.Language, cancellationToken).ConfigureAwait(false);
FindUsages\AbstractFindUsagesService_FindReferences.cs (2)
35document.Project.Solution, definitionTrackingContext.GetDefinitions(), cancellationToken).ConfigureAwait(false); 222var solution = document.Project.Solution;
FindUsages\DefinitionItem.cs (1)
229new TaggedText(TextTags.Text, firstDocument.Project.Name));
FindUsages\FindUsagesHelpers.cs (1)
43var mappingService = document.Project.Solution.Services.GetService<ISymbolMappingService>();
FindUsages\IDefinitionsAndReferencesFactory.cs (2)
205var options = await context.GetOptionsAsync(documentSpan.Document.Project.Language, cancellationToken).ConfigureAwait(false); 257var options = await context.GetOptionsAsync(document.Project.Language, cancellationToken).ConfigureAwait(false);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
25var hideAdvancedMembers = context.Options.GetOptions(document.Project.Services).HideAdvancedMembers;
FullyQualify\AbstractFullyQualifyService.cs (4)
43var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 47document.Project, 63var project = document.Project; 223newDocument, CodeCleanupOptions.GetDefault(document.Project.Services), cancellationToken).ConfigureAwait(false);
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
153document.Project.Solution,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (2)
51var project = _document.Project; 95_document.Project.Solution,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.cs (4)
109priorDocument.Project.Solution, codeAction, cancellationToken).ConfigureAwait(false); 155if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 234var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>(); 235var optionValue = globalOptions.GetGenerateConstructorFromMembersOptionsAddNullChecks(document.Project.Language);
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
81_document.Project.Solution,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (4)
60var service = _service._pickMembersService_forTesting ?? _document.Project.Solution.Services.GetRequiredService<IPickMembersService>(); 82var globalOptions = _document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>(); 83globalOptions.SetGenerateEqualsAndGetHashCodeFromMembersGenerateOperators(_document.Project.Language, addNullChecksOption.Value); 99var solution = _document.Project.Solution;
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (1)
49_document.Project.Solution,
GenerateDefaultConstructors\GenerateDefaultConstructorsCodeRefactoringProvider.cs (2)
42if (document.Project.IsSubmission) 45if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (3)
44var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 66var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 123var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
144var compilation = await _document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (5)
58if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 262var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>(); 263var value = globalOptions.GetGenerateEqualsAndGetHashCodeFromMembersImplementIEquatable(document.Project.Language); 277var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>(); 278var value = globalOptions.GetGenerateEqualsAndGetHashCodeFromMembersGenerateOperators(document.Project.Language);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (4)
59var service = _service._pickMembersService_forTestingPurposes ?? _document.Project.Solution.Services.GetRequiredService<IPickMembersService>(); 70var solution = _document.Project.Solution; 83globalOptions.SetGenerateEqualsAndGetHashCodeFromMembersGenerateOperators(_document.Project.Language, generateOperatorsOption.Value); 88globalOptions.SetGenerateEqualsAndGetHashCodeFromMembersImplementIEquatable(_document.Project.Language, implementIEqutableOption.Value);
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (5)
582var provider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language); 601document.Project.Solution, 617var provider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language); 640var provider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language); 650document.Project.Solution,
GenerateMember\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (2)
36var languageServices = _document.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language); 46_document.Project.Solution,
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (3)
70var syntaxFactory = _document.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language).GetService<SyntaxGenerator>(); 78_document.Project.Solution, 95_document.Project.Solution,
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Services.GetLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs (2)
58var canGenerateMember = CodeGenerator.CanAdd(document.Project.Solution, state.TypeToGenerateIn, cancellationToken); 219var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (3)
51var services = _document.Project.Solution.Services; 84_document.Project.Solution, 95new ApplyChangesOperation(newDocument.Project.Solution),
GenerateType\AbstractGenerateTypeService.CodeAction.cs (4)
104var generateTypeOptionsService = _document.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>(); 105var notificationService = _document.Project.Solution.Services.GetService<INotificationService>(); 106var projectManagementService = _document.Project.Solution.Services.GetService<IProjectManagementService>(); 109var isPublicOnlyAccessibility = IsPublicOnlyAccessibility(_state, _document.Project);
GenerateType\AbstractGenerateTypeService.Editor.cs (4)
318if (newDocument.Project.Language == _semanticDocument.Document.Project.Language) 407return new CodeActionOperation[] { new ApplyChangesOperation(codeGenResult.Project.Solution) }; 572return new CodeActionOperation[] { new ApplyChangesOperation(codeGenResult.Project.Solution) };
GenerateType\AbstractGenerateTypeService.State.cs (1)
321if (documentToBeGeneratedIn.Project != document.Project)
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (2)
25var project = document.Project; 26var services = document.Project.Solution.Services;
ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
42document, classNode, GetClassIdentifier(classNode), context.Options.GetImplementTypeGenerationOptions(document.Project.Services), cancellationToken).ConfigureAwait(false);
ImplementAbstractClass\ImplementAbstractClassData.cs (2)
63if (!CodeGenerator.CanAdd(document.Project.Solution, classType, cancellationToken)) 92var compilation = await _document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (2)
195var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 210document.Project.Solution,
ImplementInterface\AbstractImplementInterfaceService.CodeAction_Property.cs (1)
167var generator = Document.Project.Services.GetRequiredService<SyntaxGenerator>();
ImplementInterface\AbstractImplementInterfaceService.DisposePatternCodeAction.cs (4)
132var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 334var configOptions = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(syntaxTree); 341var fallbackFormattingOptions = await ((OptionsProvider<SyntaxFormattingOptions>)Options.FallbackOptions).GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false); 356var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
ImplementInterface\AbstractImplementInterfaceService.State.cs (1)
57if (!CodeGenerator.CanAdd(document.Project.Solution, classOrStructType, cancellationToken))
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
49var solution = document.Project.Solution;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (9)
57project = document.Project; 90var mappingService = document.Project.Solution.Services.GetRequiredService<ISymbolMappingService>(); 116return (document.Project, SymbolAndLineNumberArray.Empty); 131var remapped = remappedProject != document.Project; 209var projectState = document.Project.State; 211var languageGlyph = document.Project.Language switch 215_ => throw ExceptionUtilities.UnexpectedValue(document.Project.Language), 241var destinationDocument = document.Project.Solution.GetDocument(groupSyntaxTree); 555? definition.SourceSpans[0].Document.Project.State
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (2)
363var editor = new SyntaxEditor(root, document.Project.Solution.Services); 509var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (4)
399var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 453var services = document.Project.Solution.Services; 504var currentSolution = document.Project.Solution; 739var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
47var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>();
InlineHints\AbstractInlineTypeHintsService.cs (1)
43var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>();
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
337var solution = document.Project.Solution;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
61var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 304.FindReferencesAsync(symbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (2)
172var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 450.FindReferencesAsync(parameterSymbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken).ConfigureAwait(false);
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
38local, document.Project.Solution, options, cancellationToken).ConfigureAwait(false);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (6)
49if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 235var modifiedSolution = originalDocument.Project.Solution; 239foreach (var (project, projectCallSites) in methodCallSites.GroupBy(kvp => kvp.Key.Project)) 261methodSymbol, document.Project.Solution, progress, 280if (refLocation.Document.Project.Language == document.Project.Language)
IntroduceVariable\IntroduceVariableCodeRefactoringProvider.cs (1)
31if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
49var editor = new SyntaxEditor(root, document.Project.Solution.Services);
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
44document.Project.Solution,
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
151var sourceFromMetadataService = temporaryDocument.Project.Services.GetRequiredService<IMetadataAsSourceService>();
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
66await generatedDocument.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false),
MetadataAsSource\SymbolMappingServiceFactory.cs (1)
39if (document.Project.Solution.WorkspaceKind is not WorkspaceKind.MetadataAsSource)
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
26var service = document.Project.Solution.Services.GetService<IMoveStaticMembersOptionsService>();
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (9)
80var destinationDocId = _document.Project.Solution.GetDocumentIdsWithFilePath(moveOptions.FileName).Single(); 84sourceDoc.Project.Solution, 111sourceDoc.Project.Solution, 114_document.Project.Id, 127var memberReferenceLocations = await FindMemberReferencesAsync(moveOptions.SelectedMembers, newDoc.Project.Solution, cancellationToken).ConfigureAwait(false); 128var projectToLocations = memberReferenceLocations.ToLookup(loc => loc.location.Document.Project.Id); 129var solutionWithFixedReferences = await RefactorReferencesAsync(projectToLocations, newDoc.Project.Solution, newType, typeArgIndices, cancellationToken).ConfigureAwait(false); 185oldSolution = newTypeDoc.WithSyntaxRoot(newTypeRoot).Project.Solution; 189var projectToLocations = memberReferenceLocations.ToLookup(loc => loc.location.Document.Project.Id);
MoveToNamespace\AbstractMoveToNamespaceService.cs (3)
227var originalSolution = document.Project.Solution; 289var solution = formattedDocument.Project.Solution; 319var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
44if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
NamingStyleCodeFixProvider.cs (2)
95document.Project.Solution, 110document.Project.Solution, symbol, new SymbolRenameOptions(), fixedName,
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (2)
211var solution = document.Project.Solution; 221result.Add(linkedDocument.Project.Id);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (4)
29var solution = document.Project.Solution; 32var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 38document.Project, 52document.Project, priorityDocuments: ImmutableArray<Document>.Empty, document,
NavigateTo\NavigateToSearcher.cs (7)
149var project = _activeDocument.Project; 235processedProjects.Add(_activeDocument.Project); 236result.Add(ImmutableArray.Create(_activeDocument.Project)); 243if (processedProjects.Add(doc.Project)) 244buffer.Add(doc.Project); 271if (_activeDocument?.Project == project) 276if (doc.Project == project)
NavigateTo\RoslynNavigateToItem.cs (2)
152var firstProject = _itemDocument.Project; 181return _itemDocument.Project.Name;
NavigationBar\AbstractNavigationBarItemService.cs (2)
23var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 30document.Project,
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (2)
37_service ??= document.Project.Solution.Services.GetService<IPullMemberUpOptionsService>(); 76document.Project.Solution,
PullMemberUp\MembersPuller.cs (5)
102var solution = document.Project.Solution; 104var codeGenerationService = document.Project.Services.GetRequiredService<ICodeGenerationService>(); 281var solution = document.Project.Solution; 283var codeGenerationService = document.Project.Services.GetRequiredService<ICodeGenerationService>(); 314var info = codeGenerationService.GetInfo(context, options.GenerationOptions, destinationEditor.OriginalDocument.Project.ParseOptions);
QuickInfo\CommonSemanticQuickInfoProvider.cs (4)
31var services = context.Document.Project.Solution.Services; 59var services = document.Project.Solution.Services; 81var solution = document.Project.Solution; 87var candidateProjects = new List<ProjectId> { document.Project.Id };
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
89var referencedSymbols = await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, documentsToBeSearched, cancellationToken).ConfigureAwait(false);
Rename\SymbolicRenameInfo.cs (4)
175semanticModel, triggerToken.SpanStart, document.Project.Solution.Services, cancellationToken: cancellationToken).ConfigureAwait(false); 221var solution = document.Project.Solution; 231if (document.Project.IsSubmission) 233var projectIdOfLocation = sourceDocument.Project.Id;
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (3)
169var project = document.Project; 224var editor = new SyntaxEditor(root, originalDocument.Project.Solution.Services); 356var compilation = await updatedDocument.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
89var originalSolution = document.Project.Solution; 228var editor = new SyntaxEditor(root, originalDocument.Project.Solution.Services);
Shared\Extensions\DocumentExtensions.cs (2)
71values = await getItemsWorker(document.Project.Solution.GetRequiredDocument(linkedDocumentId)).ConfigureAwait(false); 88var solution = document.Project.Solution;
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
109annotatedSolution = document.WithSyntaxRoot(root.Value).Project.Solution;
Shared\Utilities\ExtractTypeHelpers.cs (3)
75var rootNamespace = generateTypeService.GetRootNamespace(newDocument.Project.CompilationOptions); 86newDocument.Project.Solution, 129return Formatter.Format(syntaxGenerator.SyntaxGeneratorInternal.TypeParameterList(typeParameterNames), document.Project.Solution.Services, formattingOptions, cancellationToken).ToString();
SignatureHelp\AbstractSignatureHelpProvider.cs (4)
257var totalProjects = relatedDocuments.Select(d => d.Project.Id).Concat(document.Project.Id); 288invalidProjectsForCurrentSymbol.Add(relatedDocument.Project.Id); 292var platformData = new SupportedPlatformData(document.Project.Solution, invalidProjectsForCurrentSymbol, totalProjects);
Snippets\AbstractSnippetService.cs (1)
66foreach (var provider in _lazySnippetProviders.Where(p => p.Metadata.Language == document.Project.Language))
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (1)
141var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
SolutionCrawler\AbstractDocumentDifferenceService.cs (1)
22var syntaxFactsService = newDocument.Project.Services.GetService<ISyntaxFactsService>();
SolutionCrawler\WorkCoordinator.cs (6)
267() => EnqueueDocumentWorkItemAsync(e.Document.Project, e.Document.Id, e.Document, InvocationReasons.DocumentOpened), _shutdownToken); 273() => EnqueueDocumentWorkItemAsync(e.Document.Project, e.Document.Id, e.Document, InvocationReasons.DocumentClosed), _shutdownToken); 543await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, InvocationReasons.DocumentChanged).ConfigureAwait(false); 550await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, differenceResult.ChangeType, differenceResult.ChangedMember).ConfigureAwait(false); 577list.Add(new WorkItem(document.Id, document.Project.Language, InvocationReasons.DocumentAdded, isLowPriority: false, activeMember: null, EmptyAsyncToken.Instance)); 655pool.Object.Add(document.Project.Language);
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (2)
138EnqueueFullProjectDependency(document.Project, assembly); 175var solution = thisDocument.Project.Solution;
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (2)
121HideAdvancedMembers = context.Options.GetOptions(document.Project.Services).HideAdvancedMembers, 128var passThroughOptions = document.Project.Solution.Options;
SymbolMapping\SymbolMappingServiceFactory.cs (3)
26var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 30return new SymbolMappingResult(document.Project, symbol); 37=> Task.FromResult(new SymbolMappingResult(document.Project, symbol));
SyncNamespaces\AbstractSyncNamespacesService.cs (2)
124document.Project, 169var projectDiagnostics = await GetProjectDiagnosticsAsync(document.Project, cancellationToken).ConfigureAwait(false);
TaskList\AbstractTaskListService.cs (2)
33var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 37document.Project,
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (9)
75var solution = context.Document.Project.Solution; 86Debug.Assert(fieldDocument.Project == propertyDocument.Project); 87var project = fieldDocument.Project; 150Debug.Assert(fieldDocument.Project == propertyDocument.Project); 152compilation = await fieldDocument.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false); 209var editor = new SyntaxEditor(declaratorTreeRoot, fieldDocument.Project.Solution.Services); 288return Formatter.Format(newRoot, SpecializedFormattingAnnotation, document.Project.Solution.Services, options, formattingRules, cancellationToken);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
203if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
ValueTracking\ValueTracker.cs (3)
27var operationCollector = new OperationCollector(progressCollector, document.Project.Solution); 37var solution = document.Project.Solution; 69await progressCollector.TryReportAsync(document.Project.Solution, node.GetLocation(), symbol, cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTrackingService.cs (2)
34var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 37var solution = document.Project.Solution;
Workspace\CompileTimeSolutionProvider.cs (2)
183var designTimeProjectDirectoryName = PathUtilities.GetDirectoryName(designTimeDocument.Project.FilePath)!; 187var sourceGeneratedDocuments = await compileTimeSolution.GetRequiredProject(designTimeDocument.Project.Id).GetSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false);
Wrapping\AbstractWrappingCodeRefactoringProvider.cs (1)
49var options = GetWrappingOptions(configOptions, context.Options.GetOptions(document.Project.Services));
Microsoft.CodeAnalysis.LanguageServer.Protocol (157)
Extensions\Extensions.cs (4)
101return FindItemInProjectContext(documents, documentIdentifier, projectIdGetter: (item) => item.Project.Id, defaultGetter: () => 106var solution = documents.First().Project.Solution; 170switch (document.Project.Language) 181throw new ArgumentException(string.Format("Document project language {0} is not valid", document.Project.Language));
Extensions\ProtocolConversions.cs (1)
721=> GetDocumentationMarkupContent(tags, document.Project.Language, featureSupportsMarkdown);
Features\CodeCleanup\AbstractCodeCleanupService.cs (3)
185var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 246var solutionChanges = updatedDocument.Project.Solution.GetChanges(currentDocument.Project.Solution);
Features\CodeFixes\CodeFixService.cs (18)
106var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService<IBuildOnlyDiagnosticsService>(); 183var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService<IBuildOnlyDiagnosticsService>(); 207if (document.Project.Solution.WorkspaceKind != WorkspaceKind.Interactive && includeSuppressionFixes) 311var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 324var workspaceFixersMap = GetFixerPerLanguageMap(document.Project.Solution.Services); 328if (!_lazyWorkspaceFixersMap.TryGetValue(document.Project.Language, out var lazyFixerMap)) 350var fixersPriorityByLanguageMap = GetFixerPriorityPerLanguageMap(document.Project.Solution.Services); 354return _lazyFixerPriorityMap.TryGetValue(document.Project.Language, out fixersPriorityMap); 420var isInteractive = document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive; 460var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>(); 595fixes.Add(new CodeFix(document.Project, action, applicableDiagnostics)); 659if (!_configurationProvidersMap.TryGetValue(document.Project.Language, out var lazyConfigurationProviders) || 702.ToDiagnosticsAsync(textDocument.Project, cancellationToken).ConfigureAwait(false); 710var extensionManager = textDocument.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 740document.Project, 918return document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive 920: _projectFixersMap.GetValue(document.Project.AnalyzerReferences, _ => ComputeProjectFixers(document)); 925var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>();
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (3)
47var solution = document.Project.Solution; 50return await diagnostics.ToDiagnosticsAsync(document.Project, cancellationToken).ConfigureAwait(false); 58return await diagnostics.ToDiagnosticsAsync(document.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\DefaultDiagnosticAnalyzerService.cs (5)
92Debug.Assert(textDocument.Project.Solution.Workspace == _workspace); 105Debug.Assert(document.Project.Solution.Workspace == _workspace); 134_workspace, document.Project.Solution, document.Project.Id, document.Id, diagnosticData)); 156var project = document.Project;
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
80if (_map.TryGetValue(document.Project.Solution.Workspace, out var analyzer)) 108if (_map.TryGetValue(document.Project.Solution.Workspace, out var analyzer))
Features\Diagnostics\DocumentAnalysisExecutor.cs (7)
95var generatorDiagnostics = await textDocument.Project.GetSourceGeneratorDiagnosticsAsync(cancellationToken).ConfigureAwait(false); 123(r, d, a, k) => $"Driver: {r != null}, {d.Id}, {d.Project.Id}, {a}, {k}", _compilationWithAnalyzers, textDocument, analyzer, kind); 133var isEnabled = await textDocument.Project.HasSuccessfullyLoadedAsync(cancellationToken).ConfigureAwait(false); 135Logger.Log(FunctionId.Diagnostics_SemanticDiagnostic, (a, d, e) => $"{a}, ({d.Id}, {d.Project.Id}), Enabled:{e}", analyzer, textDocument, isEnabled); 170var diags = await diagnostics.ToDiagnosticsAsync(textDocument.Project, cancellationToken).ConfigureAwait(false); 378var diagnosticSpanMappingService = textDocument.Project.Solution.Services.GetService<IWorkspaceVenusSpanMappingService>(); 388var diagnostic = await diagnosticData.ToDiagnosticAsync(textDocument.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
252await VerifyDiagnosticLocationsAsync(diagnostics, document.Project, cancellationToken).ConfigureAwait(false); 410return targetTextDocument.Project.GetDocument(diagnostic.Location.SourceTree) == targetTextDocument; 416var documentIds = targetTextDocument.Project.Solution.GetDocumentIdsWithFilePath(lineSpan.Path);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (5)
194Contract.ThrowIfFalse(document.Project.Solution.Workspace == Workspace); 198document.Project.Solution.Workspace, 199document.Project.Solution, 200document.Project.Id, 249=> $"{title}: ({document.Id}, {document.Project.Id}), ({analyzer})";
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (2)
60isAnalyzerSuppressed = !DocumentAnalysisExecutor.IsAnalyzerEnabledForProject(stateSet.Analyzer, document.Project, GlobalOptions) || 152var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
76var oldDocumentVersion = await GetDiagnosticVersionAsync(oldDocument.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (1)
45=> AnalyzeAsync(documentAnalysisScope, documentAnalysisScope.TextDocument.Project, compilationWithAnalyzers,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (9)
117Contract.ThrowIfFalse(lastResult.ProjectId == document.Project.Id); 124var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); 138var builder = new Builder(document.Project, lastResult.Version); 250var project = document.Project; 259var simplifierOptions = globalOptions.GetSimplifierOptions(document.Project.Services); 323var project = document.Project; 352Contract.ThrowIfFalse(document == null || document.Project == project); 362var project = document.Project; 413Contract.ThrowIfFalse(document == null || document.Project == project);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (3)
134if (!TryGetProjectState(document.Project.Id, out var projectState) || 162var projectState = GetOrCreateProjectState(document.Project.Id); 178if (TryGetProjectState(document.Project.Id, out var projectState))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (6)
100.GetOrCreateStateSets(document.Project).Where(s => DocumentAnalysisExecutor.IsAnalyzerEnabledForProject(s.Analyzer, document.Project, owner.GlobalOptions)); 102var ideOptions = owner.AnalyzerService.GlobalOptions.GetIdeAnalyzerOptions(document.Project); 115var compilationWithAnalyzers = await GetOrCreateCompilationWithAnalyzersAsync(document.Project, ideOptions, stateSets, includeSuppressedDiagnostics, cancellationToken).ConfigureAwait(false); 294var version = await GetDiagnosticVersionAsync(_document.Project, cancellationToken).ConfigureAwait(false); 328var version = await GetDiagnosticVersionAsync(_document.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (11)
52var stateSets = _stateManager.GetOrUpdateStateSets(document.Project); 53var compilationWithAnalyzers = await GetOrCreateCompilationWithAnalyzersAsync(document.Project, stateSets, cancellationToken).ConfigureAwait(false); 54var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); 55var backgroundAnalysisScope = GlobalOptions.GetBackgroundAnalysisScope(document.Project.Language); 56var compilerDiagnosticsScope = GlobalOptions.GetBackgroundCompilerAnalysisScope(document.Project.Language); 122ClearCompilationsWithAnalyzersCache(document.Project); 193var stateSets = _stateManager.GetStateSets(document.Project); 214var stateSets = _stateManager.GetStateSets(document.Project); 238var stateSets = _stateManager.GetStateSets(document.Project); 263var _ = GlobalOptions.IsFullSolutionAnalysisEnabled(document.Project.Language, out var compilerFullAnalysisEnabled, out var analyzersFullAnalysisEnabled); 267var removeDiagnosticsOnDocumentClose = GlobalOptions.GetOption(SolutionCrawlerOptionsStorage.RemoveDocumentDiagnosticsOnDocumentClose, document.Project.Language);
Features\Options\AddImportPlacementOptionsStorage.cs (1)
15=> document.GetAddImportPlacementOptionsAsync(globalOptions.GetAddImportPlacementOptions(document.Project.Services), cancellationToken);
Features\Options\CodeCleanupOptionsStorage.cs (1)
15=> document.GetCodeCleanupOptionsAsync(globalOptions.GetCodeCleanupOptions(document.Project.Services), cancellationToken);
Features\Options\CodeGenerationOptionsStorage.cs (2)
15=> document.GetCodeGenerationOptionsAsync(globalOptions.GetCodeGenerationOptions(document.Project.Services), cancellationToken); 18=> document.GetCleanCodeGenerationOptionsAsync(globalOptions.GetCleanCodeGenerationOptions(document.Project.Services), cancellationToken);
Features\Options\ExtractMethodOptionsStorage.cs (1)
34=> document.GetExtractMethodGenerationOptionsAsync(globalOptions.GetExtractMethodGenerationOptions(document.Project.Services), cancellationToken);
Features\Options\IndentationOptionsStorage.cs (2)
20AutoFormattingOptions = globalOptions.GetAutoFormattingOptions(document.Project.Language), 21IndentStyle = globalOptions.GetOption(SmartIndent, document.Project.Language)
Features\Options\LineFormattingOptionsStorage.cs (1)
14=> document.GetLineFormattingOptionsAsync(globalOptions.GetLineFormattingOptions(document.Project.Language), cancellationToken);
Features\Options\OrganizeImportsOptionsStorage.cs (1)
14=> document.GetOrganizeImportsOptionsAsync(globalOptions.GetOrganizeImportsOptions(document.Project.Language), cancellationToken);
Features\Options\SimplifierOptionsStorage.cs (1)
15=> document.GetSimplifierOptionsAsync(globalOptions.GetSimplifierOptions(document.Project.Services), cancellationToken);
Features\Options\SyntaxFormattingOptionsStorage.cs (1)
15=> document.GetSyntaxFormattingOptionsAsync(globalOptions.GetSyntaxFormattingOptions(document.Project.Services), cancellationToken);
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (3)
45var originalSolution = document.Project.Solution; 519var originalSolution = document.Project.Solution; 609var originalSolution = document.Project.Solution;
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
41var breakpointService = document.Project.Services.GetRequiredService<IBreakpointResolutionService>();
Handler\CodeActions\CodeActionHelpers.cs (2)
244document.Project.Solution.Workspace, codeFixService, document, textSpan, 249document.Project.Solution.Workspace, codeRefactoringService, document, textSpan, CodeActionRequestPriority.None, fallbackOptions, isBlocking: false,
Handler\CodeActions\CodeActionResolveHandler.cs (1)
65var solution = document.Project.Solution;
Handler\CodeLens\CodeLensResolveHandler.cs (2)
54var codeLensReferencesService = document.Project.Solution.Services.GetRequiredService<ICodeLensReferencesService>(); 55var referenceCount = await codeLensReferencesService.GetReferenceCountAsync(document.Project.Solution, document.Id, memberToResolve.Node, maxSearchResults: 99, cancellationToken).ConfigureAwait(false);
Handler\Completion\CompletionHandler.cs (5)
155if (document.Project.Language == LanguageNames.CSharp) 159else if (document.Project.Language == LanguageNames.VisualBasic) 171var creationService = document.Project.Solution.Services.GetRequiredService<ILspCompletionResultCreationService>(); 351var completionList = await completionService.GetCompletionsAsync(document, position, completionOptions, document.Project.Solution.Options, completionTrigger, cancellationToken: cancellationToken).ConfigureAwait(false); 447return _globalOptions.GetCompletionOptions(document.Project.Language) with
Handler\Completion\CompletionResolveHandler.cs (3)
55var completionService = document.Project.Services.GetRequiredService<CompletionService>(); 74var completionOptions = _globalOptions.GetCompletionOptions(document.Project.Language); 75var displayOptions = _globalOptions.GetSymbolDescriptionOptions(document.Project.Language);
Handler\Definitions\AbstractGoToDefinitionHandler.cs (2)
74var options = _globalOptions.GetMetadataAsSourceOptions(document.Project.Services); 75var declarationFile = await _metadataAsSourceFileService.GetGeneratedFileAsync(workspace, document.Project, symbol, signaturesOnly: false, options, cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (3)
22public Project GetProject() => Document.Project; 26? new VSTextDocumentIdentifier { ProjectContext = ProtocolConversions.ProjectToProjectContext(Document.Project), Uri = Document.GetURI() } 29public string ToDisplayString() => $"{this.GetType().Name}: {Document.FilePath ?? Document.Name} in {Document.Project.Name}";
Handler\Diagnostics\DiagnosticSources\TaskListDiagnosticSource.cs (2)
62projectId: this.Document.Project.Id, 63language: this.Document.Project.Language,
Handler\Diagnostics\DiagnosticSources\WorkspaceDocumentDiagnosticSource.cs (2)
38Document.Project.Solution, Document.Project.Id, Document.Id, cancellationToken: cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (2)
111yield return activeDocument?.Project; 113yield return doc.Project;
Handler\FoldingRanges\FoldingRangesHandler.cs (1)
44var options = _globalOptions.GetBlockStructureOptions(document.Project);
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
44var services = document.Project.Solution.Services;
Handler\Formatting\FormatDocumentOnTypeHandler.cs (2)
58var formattingService = document.Project.Services.GetRequiredService<ISyntaxFormattingService>(); 70AutoFormattingOptions = _globalOptions.GetAutoFormattingOptions(document.Project.Language)
Handler\Highlights\DocumentHighlightHandler.cs (1)
87var options = _globalOptions.GetHighlightingOptions(document.Project.Language);
Handler\Hover\HoverHandler.cs (2)
48var options = _globalOptions.GetSymbolDescriptionOptions(document.Project.Language); 66var hoverService = document.Project.Solution.Services.GetRequiredService<ILspHoverResultCreationService>();
Handler\Hover\ILspHoverResultCreationService.cs (1)
46var language = document.Project.Language;
Handler\InlineCompletions\InlineCompletionsHandler.cs (3)
70var snippetInfoService = document.Project.GetRequiredLanguageService<ISnippetInfoService>(); 79var syntaxFactsService = document.Project.GetRequiredLanguageService<ISyntaxFactsService>(); 149var formattingChanges = Formatter.GetFormattedTextChanges(root, spanToFormat, originalDocument.Project.Solution.Services, formattingOptions, cancellationToken: cancellationToken)
Handler\InlineCompletions\XmlSnippetParser.ParsedXmlSnippet.cs (1)
46var snippetFunctionService = documentWithSnippet.Project.GetRequiredLanguageService<SnippetFunctionService>();
Handler\OnAutoInsert\OnAutoInsertHandler.cs (4)
69var docCommentOptions = _globalOptions.GetDocumentationCommentOptions(formattingOptions.LineFormatting, document.Project.Language); 86AutoFormattingOptions = _globalOptions.GetAutoFormattingOptions(document.Project.Language) 231var servicesForDocument = document.Project.Language switch 235_ => throw new ArgumentException($"Language {document.Project.Language} is not recognized for OnAutoInsert")
Handler\ProjectContext\GetTextDocumentWithContextHandler.cs (1)
50var project = document.Project;
Handler\PullHandlers\VersionedPullCache`1.cs (1)
36document.Project,
Handler\References\FindUsagesLSPContext.cs (3)
222var options = _globalOptions.GetMetadataAsSourceOptions(_document.Project.Services); 224_workspace, _document.Project, symbol, signaturesOnly: true, options, cancellationToken).ConfigureAwait(false); 259var options = await GetOptionsAsync(document.Project.Language, cancellationToken).ConfigureAwait(false);
Handler\Rename\RenameHandler.cs (1)
43var oldSolution = document.Project.Solution;
Handler\SemanticTokens\SemanticTokensRangeHandler.cs (1)
51var project = document.Project;
Handler\SignatureHelp\SignatureHelpHandler.cs (2)
52var providers = _allProviders.Where(p => p.Metadata.Language == document.Project.Language); 54var options = _globalOptions.GetSignatureHelpOptions(document.Project.Language);
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (1)
195var project = document.Project;
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (2)
49AddDocumentsFromProject(activeDocument?.Project, context.SupportedLanguages); 51AddDocumentsFromProject(doc.Project, context.SupportedLanguages);
Handler\Symbols\DocumentSymbolsHandler.cs (2)
46var navBarService = document.Project.Services.GetRequiredService<INavigationBarItemService>(); 86var service = document.Project.Solution.Services.GetRequiredService<ILspSymbolInformationCreationService>();
Workspaces\LspWorkspaceManager.cs (4)
191var workspaceKind = document.Project.Solution.WorkspaceKind; 201return (workspace, document.Project.Solution, document); 215return (_lspMiscellaneousFilesWorkspace, miscDocument.Project.Solution, miscDocument); 321_logger.LogWarning($"Text for {uriInWorkspace} did not match document text {firstDocument.Id} in workspace's {firstDocument.Project.Solution.WorkspaceKind} current solution");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (26)
Diagnostics\PullDiagnosticTests.cs (8)
255var solution = document.Project.Solution; 510Id = ProtocolConversions.ProjectIdToProjectContextId(document.Project.Id), 511Label = document.Project.Name 679document.Project.Id, 1006document.Project.Id, 1306await testLspServer.TestWorkspace.ChangeDocumentAsync(csproj2Document.Id, newCsProj2Document.Project.Solution); 1381await testLspServer.TestWorkspace.ChangeDocumentAsync(csproj3Document.Id, newCsProj3Document.Project.Solution).ConfigureAwait(false); 1448await testLspServer.TestWorkspace.ChangeDocumentAsync(csproj2Document.Id, newCsProj2Document.Project.Solution);
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (1)
106return lspDocument.Project.Solution;
SpellCheck\SpellCheckTests.cs (1)
87var solution = document.Project.Solution;
VSTypeScriptHandlerTests.cs (2)
50var request = new TSRequest(document.GetURI(), ProtocolConversions.ProjectIdToProjectContextId(document.Project.Id)); 76TextDocument = CreateTextDocumentIdentifier(document.GetURI(), document.Project.Id)
Workspaces\LspWorkspaceManagerTests.cs (14)
51Assert.Equal(testLspServer.GetCurrentSolution(), closedDocument!.Project.Solution); 131Assert.Equal("Test", openedDocument?.Project.AssemblyName); 132Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, openedDocument!.Project.Solution); 142Assert.Equal("NewCSProj1", openedDocument.Project.AssemblyName); 143Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, openedDocument.Project.Solution); 155Assert.Equal("Test", openedDocument?.Project.AssemblyName); 156Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution, openedDocument!.Project.Solution); 166Assert.Equal("NewCSProj1", openedDocument.Project.AssemblyName); 167Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution, openedDocument.Project.Solution); 190Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, lspDocument.Project.Solution); 409Assert.Equal("NewCSProj1", secondDocumentChangedProject.Project.AssemblyName); 459Assert.Equal(newAssemblyName, documentServerOne.Project.AssemblyName); 462Assert.Equal(newAssemblyName, documentServerTwo.Project.AssemblyName); 481Assert.Same(testLspServer.TestWorkspace.CurrentSolution, lspDocument.Project.Solution);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (1)
Generator.cs (1)
261var languageServices = document.Project.Services;
Microsoft.CodeAnalysis.Remote.ServiceHub (11)
CloudCachePersistentStorage.cs (1)
87? s_projectToContainerKeyCache.GetValue(document.Project.State, _projectToContainerKeyCacheCallback).GetDocumentContainerKey(document.State)
Host\RemoteWorkspace.SolutionCreator.cs (7)
90solution = solution.WithFrozenSourceGeneratedDocument(identity, sourceText).Project.Solution; 462TextDocumentKind.Document => document.Project.Solution.WithDocumentText(document.Id, sourceText).GetDocument(document.Id)!, 463TextDocumentKind.AnalyzerConfigDocument => document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, sourceText).GetAnalyzerConfigDocument(document.Id)!, 464TextDocumentKind.AdditionalDocument => document.Project.Solution.WithAdditionalDocumentText(document.Id, sourceText).GetAdditionalDocument(document.Id)!, 469return document.Project; 487document = document.Project.Solution.WithDocumentFolders(document.Id, newDocumentInfo.Folders).GetDocument(document.Id)!; 494document = document.Project.Solution.WithDocumentSourceCodeKind(document.Id, newDocumentInfo.SourceCodeKind).GetDocument(document.Id)!;
Services\EncapsulateField\RemoteEncapsulateFieldService.cs (1)
54var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
48var compilation = await document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
112var solution = document.Project.Solution;
Microsoft.CodeAnalysis.TestAnalyzerReference (2)
NonSourceFileRefactoring.cs (2)
32return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 33return document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, newText);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
103Dim innerEditor = New SyntaxEditor(root, document.Project.Solution.Services) 137Dim editor = New SyntaxEditor(root, document.Project.Solution.Services)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (18)
EndConstructGeneration\EndConstructCommandHandler.vb (1)
143Dim options = buffer.GetCodeCleanupOptions(_editorOptionsService, document.Project.Services, explicitFormat:=False, allowImportsInHiddenRegions:=document.AllowImportsInHiddenRegions())
LineCommit\CommitBufferManager.vb (1)
296Dim project = document.Project
LineCommit\CommitCommandHandler.vb (1)
243Dim formattingRuleService = document.Project.Solution.Services.GetService(Of IHostDependentFormattingRuleFactoryService)()
LineCommit\CommitFormatter.vb (3)
75Dim cleanupOptions = buffer.GetCodeCleanupOptions(_editorOptionsService, document.Project.Services, isExplicitFormat, allowImportsInHiddenRegions:=document.AllowImportsInHiddenRegions()) 78document.Project.Services, 108document.Project.Solution.Services,
NavigationBar\VisualBasicEditorNavigationBarItemService.vb (1)
52Dim destinationDocument = document.Project.Solution.GetDocument(navigationLocation.documentId)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (10)
41newDocument.Project.Solution.Workspace.ApplyDocumentChanges(newDocument, cancellationToken) 43Dim solution = newDocument.Project.Solution 117Dim compilation = Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False) 148document.Project.Solution, 163Dim compilation = Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False) 205document.Project.Solution, 220Dim compilation = Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False) 251document.Project.Solution, 266Dim compilation = Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False) 280document.Project.Solution,
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (1)
168Dim newDocument = TryGetNewDocument(document, _globalOptions.GetImplementTypeGenerationOptions(document.Project.Services), identifier, cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (18)
CaseCorrecting\CaseCorrectionServiceTests.vb (1)
37Dim options = CodeCleanupOptions.GetDefault(document.Project.Services)
CodeActions\Preview\PreviewTests.vb (4)
48Dim solution = _oldDocument.Project.Solution 51solution = solution.AddDocument(DocumentId.CreateNewId(_oldDocument.Project.Id, s_addedDocumentName), s_addedDocumentName, s_addedDocumentText) 54Dim removedReference = _oldDocument.Project.MetadataReferences.Last() 56solution = solution.RemoveMetadataReference(_oldDocument.Project.Id, removedReference)
Completion\CompletionProviders\AbstractVisualBasicCompletionProviderTests.vb (1)
121Dim service = GetCompletionService(document.Project)
Completion\CompletionProviders\CrefCompletionProviderTests.vb (1)
423Dim service = GetCompletionService(document.Project)
Completion\CompletionProviders\ImplementsClauseCompletionProviderTests.vb (1)
626Dim service = GetCompletionService(document.Project)
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.vb (1)
453Dim service = GetCompletionService(document.Project)
Completion\CompletionProviders\OverrideCompletionProviderTests.vb (1)
1855Dim service = GetCompletionService(document.Project)
Completion\CompletionProviders\SuggestionModeCompletionProviderTests.vb (1)
392Dim service = GetCompletionService(document.Project)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.vb (1)
28Projects.Single().AddAdditionalDocument(name:="dummy.txt", text:="", filePath:="dummy.txt").Project.Solution
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
36AddDocument("test.vb", SourceText.From(source, Encoding.UTF8), filePath:=Path.Combine(TempRoot.Root, "test.vb")).Project.Solution
ExtractMethod\ExtractMethodTests.vb (2)
106Dim cleanupOptions = CodeCleanupOptions.GetDefault(document.Project.Services) 120CodeGenerationOptions.GetDefault(document.Project.Services),
Formatting\CodeCleanUpTests.vb (3)
528project = project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From(editorconfigText), filePath:="z:\\.editorconfig").Project 652project = document.Project 697project = document.Project
Microsoft.CodeAnalysis.VisualBasic.Features (31)
AddImport\VisualBasicAddImportFeatureService.vb (1)
297Dim compilation = Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False)
ChangeSignature\VisualBasicChangeSignatureService.vb (3)
630Return GetPermutedDocCommentTrivia(node, permutedParamNodes, document.Project.Services, options) 705convertedType = If(Await SymbolFinder.FindSourceDefinitionAsync(convertedType, document.Project.Solution, cancellationToken).ConfigureAwait(False), convertedType) 724nodeType = If(Await SymbolFinder.FindSourceDefinitionAsync(nodeType, document.Project.Solution, cancellationToken).ConfigureAwait(False), nodeType)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (13)
108Dim sourceDefinition = Await SymbolFinder.FindSourceDefinitionAsync(targetType, document.Project.Solution, cancellationToken).ConfigureAwait(False) 128Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ICodeGenerationService) 129Dim syntaxFactService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ISyntaxFactsService) 133document.Project.Solution, eventHandlerName, Not syntaxFactService.IsCaseSensitive, SymbolFilter.Type, cancellationToken).ConfigureAwait(False) 158Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedEvent, codeGenService, fallbackOptions) 260Dim targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(semanticModel.GetSymbolInfo(node.Left, cancellationToken).Symbol, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 270Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ICodeGenerationService) 307Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedEvent, codeGenService, fallbackOptions) 311Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedMember, codeGenService, fallbackOptions) 351targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(withEventsProperty.Type, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 355targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(targetType, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 380Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(originalTargetType.Language).GetService(Of ICodeGenerationService) 407document.Project.Solution, originalTargetType, generatedEvent, codeGenService, fallbackOptions)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
77Dim services = document.Project.Solution.Services
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (2)
33If document.Project.Solution.WorkspaceKind = WorkspaceKind.MiscellaneousFiles Then 185Return Simplifier.Expand(DirectCast(n, StatementSyntax), semanticModel, document.Project.Solution.Services, cancellationToken:=cancellationToken)
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (1)
70Dim languageVersion = DirectCast(document.Project.ParseOptions, VisualBasicParseOptions).LanguageVersion
Debugging\LocationInfoGetter.vb (1)
33Dim compilation = Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False)
ExtractMethod\VisualBasicMethodExtractor.TriviaResult.vb (1)
16Dim preservationService = selectionResult.SemanticDocument.Document.Project.Services.GetService(Of ISyntaxTriviaService)()
ImplementInterface\VisualBasicImplementInterfaceCodeFixProvider.vb (1)
65context.Options.GetImplementTypeGenerationOptions(document.Project.Services),
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
100updatedDocument = updatedDocument.Project.Solution.GetDocument(currentDocument.Id).WithSyntaxRoot(newRoot)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
55document.Project.Solution, type, position, semanticModel, workspaceSupportsDocumentChanges, symbolDeclarationService, cancellationToken))
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (1)
31Dim services = context.Document.Project.Solution.Services
SignatureHelp\PredefinedCastExpressionSignatureHelpProvider.vb (1)
27Return SpecializedCollections.SingletonEnumerable(New PredefinedCastExpressionDocumentation(node.Keyword.Kind, Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False)))
UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (1)
49Dim generator = SyntaxGenerator.GetGenerator(propertyDocument.Project)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
103Dim innerEditor = New SyntaxEditor(root, document.Project.Solution.Services) 137Dim editor = New SyntaxEditor(root, document.Project.Solution.Services)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (6)
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (1)
37Dim newRoot = Await CleanupAsync(root, spans, options.FormattingOptions, document.Project.Solution.Services, cancellationToken).ConfigureAwait(False)
CodeCleanup\Providers\RemoveUnnecessaryLineContinuationCodeCleanupProvider.vb (2)
34Dim parseOptions = TryCast(document.Project.ParseOptions, VisualBasicParseOptions) 40Dim newRoot = Await CleanupAsync(root, spans, options.FormattingOptions, document.Project.Solution.Services, cancellationToken).ConfigureAwait(False)
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
125_simplificationService = parameters.Document.Project.Services.GetRequiredService(Of ISimplificationService)() 126_syntaxFactsService = parameters.Document.Project.Services.GetRequiredService(Of ISyntaxFactsService)() 127_semanticFactsService = parameters.Document.Project.Services.GetRequiredService(Of ISemanticFactsService)()
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
47Dim doc = extensionAttributeDoc.Project.AddDocument("test.vb", code)
Microsoft.CodeAnalysis.Workspaces (142)
AbstractGeneratedCodeRecognitionService.cs (1)
34return syntaxTree.IsGeneratedCode(document.Project.AnalyzerOptions, syntaxFacts, cancellationToken);
AbstractMoveDeclarationNearReferenceService.cs (1)
83var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractMoveDeclarationNearReferenceService.State.cs (1)
91var findReferencesResult = await SymbolFinder.FindReferencesAsync(LocalSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AddImportPlacementOptions.cs (2)
58return configOptions.GetAddImportPlacementOptions(document.Project.Services, document.AllowImportsInHiddenRegions(), fallbackOptions); 68=> await GetAddImportPlacementOptionsAsync(document, await fallbackOptionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
Classification\AbstractClassificationService.cs (6)
67var client = await RemoteHostClient.TryGetClientAsync(document.Project, cancellationToken).ConfigureAwait(false); 81document.Project, 99var workspaceStatusService = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>(); 128document.Project, 154var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 188AddSyntacticClassifications(document.Project.Solution.Services, root, textSpan, result, cancellationToken);
Classification\Classifier.cs (2)
31return GetClassifiedSpans(document.Project.Solution.Services, document.Project, semanticModel, textSpan, ClassificationOptions.Default, cancellationToken);
Classification\SemanticClassificationCacheUtilities.cs (1)
16var project = document.Project;
CleanCodeGenerationOptions.cs (1)
84=> await document.GetCleanCodeGenerationOptionsAsync(await ((OptionsProvider<CleanCodeGenerationOptions>)fallbackOptionsProvider).GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
CodeActions\CodeAction.cs (4)
222return changedDocument.Project.Solution; 322processedSolution = processedDocument.Project.Solution; 335processedSolution = processedDocument.Project.Solution; 355var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService>();
CodeCleanupOptions.cs (2)
99return configOptions.GetCodeCleanupOptions(document.Project.Services, document.AllowImportsInHiddenRegions(), fallbackOptions); 103=> await document.GetCodeCleanupOptionsAsync(await ((OptionsProvider<CodeCleanupOptions>)fallbackOptionsProvider).GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
97if (kvp.Key.Project != fixAllContext.Project)
CodeFixes\FixAllOccurrences\FixAllContext.cs (3)
161document.Project, 233if (this.Project.Language != document.Project.Language) 270if (this.Project.Language != document.Project.Language)
CodeFixes\FixAllOccurrences\FixAllState.cs (1)
80triggerDocument.Project,
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (1)
36_differenceService = document.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
CodeFixesAndRefactorings\CommonFixAllState.cs (1)
36Debug.Assert(document == null || document.Project == project);
CodeFixOptionsProvider.cs (1)
91return new CodeFixOptionsProvider(configOptions.GetOptionsReader(), fallbackOptions, document.Project.GetExtendedLanguageServices());
CodeGenerationOptions.cs (5)
130return configOptions.GetCodeGenerationOptions(document.Project.Services, fallbackOptions); 134=> await GetCodeGenerationOptionsAsync(document, await ((OptionsProvider<CodeGenerationOptions>)fallbackOptionsProvider).GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false); 138Contract.ThrowIfNull(document.Project.ParseOptions); 141var service = document.Project.Services.GetRequiredService<ICodeGenerationService>(); 142return service.GetInfo(context, options, document.Project.ParseOptions);
CodeRefactorings\FixAllOccurences\FixAllState.cs (1)
43: this(fixAllProvider, document ?? throw new ArgumentNullException(nameof(document)), document.Project, selectionSpan, codeRefactoringProvider,
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
75var editor = new SyntaxEditor(root, document.Project.Solution.Services);
Diagnostics\DiagnosticData.cs (6)
201var diagnosticSpanMappingService = document?.Project.Solution.Services.GetService<IWorkspaceVenusSpanMappingService>(); 221var project = document.Project; 275var service = document.Project.GetLanguageService<IDiagnosticPropertiesService>(); 291builder.AddIfNotNull(CreateLocation(document.Project.Solution.GetDocument(location.SourceTree), location)); 295var textDocumentId = document.Project.GetDocumentForExternalLocation(location); 296builder.AddIfNotNull(CreateLocation(document.Project.GetTextDocument(textDocumentId), location));
Diagnostics\DocumentAnalysisScope.cs (1)
54return TextDocument.Project.AnalyzerOptions.AdditionalFiles.First(a => PathUtilities.Comparer.Equals(a.Path, filePath));
DocumentExtensions.cs (5)
29=> document?.Project?.GetLanguageService<TLanguageService>(); 32=> document.Project.GetRequiredLanguageService<TLanguageService>(); 79var workspace = document.Project.Solution.Workspace; 144var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>(); 200var solution = document.Project.Solution;
DocumentFormattingOptions.cs (1)
53=> await document.GetDocumentFormattingOptionsAsync(await fallbackOptionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
Editing\DocumentEditor.cs (1)
22: base(root, document.Project.Solution.Services)
Editing\SolutionEditor.cs (1)
56changedSolution = newDoc.Project.Solution;
Editing\SymbolEditor.cs (2)
54return new SymbolEditor(document.Project.Solution); 292_currentSolution = newDoc.Project.Solution;
Editing\SyntaxGenerator.cs (1)
65=> GetGenerator(document.Project);
ExtractMethod\ExtractMethodOptions.cs (2)
56fallbackOptions ??= ExtractMethodGenerationOptions.GetDefault(document.Project.Services); 68=> document.GetExtractMethodGenerationOptionsAsync(fallbackOptions.GetExtractMethodGenerationOptions(document.Project.Services), cancellationToken);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
95if (document.Project == project)
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
42else if (document.Project.Language == LanguageNames.VisualBasic && index.ProbablyContainsIdentifier("New"))
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
39Solution = document.Project.Solution;
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
181? _documents.Select(d => d.Project).ToImmutableHashSet()
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (2)
47var projectsToSearch = documents.Select(d => d.Project).Where(p => p.SupportsCompilation).ToImmutableHashSet(); 69if (document.Project == project)
FindSymbols\ReferenceLocationExtensions.cs (1)
21var projectGroups = documentGroups.GroupBy(g => g.Key.Project);
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (5)
38var storageService = document.Project.Solution.Services.GetPersistentStorageService(); 40var stringTable = SyntaxTreeIndex.GetStringTable(document.Project); 111var project = document.Project; 128var solution = document.Project.Solution; 136var solution = document.Project.Solution;
FindSymbols\SymbolFinder.cs (1)
114return await FindSymbolAtPositionAsync(semanticModel, position, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false);
Formatting\Formatter.cs (6)
37=> GetDefaultFormattingRules(document.Project.Services); 96var services = document.Project.Solution.Services; 117var services = document.Project.Solution.Services; 134var services = document.Project.Solution.Services; 342lineFormattingOptions = optionSet.GetLineFormattingOptions(document.Project.Language, fallbackOptions: null); 371return optionSet.GetOrganizeImportsOptions(document.Project.Language, fallbackOptions: null);
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (1)
159var project = document.Project;
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (1)
53var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree);
LineFormattingOptions.cs (2)
51return configOptions.GetLineFormattingOptions(document.Project.Language, fallbackOptions); 55=> await GetLineFormattingOptionsAsync(document, await fallbackOptionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (1)
216oldDocument.Project.Name,
NamingStyleOptions.cs (1)
54return await fallbackOptionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false);
OrganizeImports\OrganizeImportsOptions.cs (2)
51return configOptions.GetOrganizeImportsOptions(document.Project.Language, fallbackOptions); 55=> await GetOrganizeImportsOptionsAsync(document, await fallbackOptionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
ParsedDocument.cs (2)
38return new ParsedDocument(document.Id, text, root, document.Project.GetExtendedLanguageServices()); 46return new ParsedDocument(document.Id, text, root, document.Project.GetExtendedLanguageServices());
Recommendations\Recommender.cs (2)
31return languageRecommender.GetRecommendedSymbolsInContext(context, GetOptions(options, document.Project), cancellationToken).NamedSymbols; 54return languageRecommender.GetRecommendedSymbolsInContext(context, GetOptions(options, document.Project), cancellationToken).NamedSymbols;
Remote\RemoteArguments.cs (1)
62: Dehydrate(document.Project.Solution, alias, cancellationToken);
Rename\ConflictEngine\ConflictResolver.cs (2)
204foreach (var implicitReferenceLocationsPerLanguage in implicitReferenceLocations.GroupBy(loc => loc.Document.Project.Language)) 208var renameRewriterService = implicitReferenceLocationsPerLanguage.First().Document.Project.Services.GetRequiredService<IRenameRewriterLanguageService>();
Rename\ConflictEngine\ConflictResolver.Session.cs (3)
355var syntaxFactsService = newDocument.Project.Services.GetRequiredService<ISyntaxFactsService>(); 649var newReferencedSymbols = RenameUtilities.GetSymbolsTouchingPosition(tokenOrNode.Span.Start, newDocumentSemanticModel, newDocument.Project.Solution.Services, _cancellationToken); 708foreach (var language in documentsFromAffectedProjects.Select(d => d.Project.Language).Distinct())
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
224solution = document.Project.Solution;
Rename\Renamer.cs (1)
78=> RenameDocumentAsync(document, GetDocumentRenameOptions(optionSet ?? document.Project.Solution.Options), newDocumentName, newDocumentFolders, cancellationToken);
Rename\Renamer.RenameSymbolDocumentAction.cs (1)
40var solution = document.Project.Solution;
Rename\Renamer.SyncNamespaceDocumentAction.cs (3)
53return solution ?? document.Project.Solution; 72if (document.Project.Language == LanguageNames.CSharp) 75var targetNamespace = PathMetadataUtilities.TryBuildNamespaceFromFolders(newFolders, syntaxFacts, document.Project.DefaultNamespace);
Rename\RenameUtilities.cs (1)
306var definitionSymbol = await FindDefinitionSymbolAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
328foreach (var documentsGroupedByLanguage in RenameUtilities.GetDocumentsAffectedByRename(originalSymbol, solution, renameLocations).GroupBy(d => d.Project.Language))
SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
144var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false);
Shared\Extensions\DocumentExtensions.cs (2)
32if (document.Project.TryGetCompilation(out var compilation)) 49=> document.Project.Solution.WithOptions(options).GetRequiredDocument(document.Id);
Shared\Extensions\SyntaxGeneratorExtensions.cs (5)
326var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); 332else if (overriddenProperty.IsIndexer() && document.Project.Language == LanguageNames.CSharp) 352if (document.Project.Language == LanguageNames.CSharp 353&& await SymbolFinder.FindSourceDefinitionAsync(overriddenProperty, document.Project.Solution, cancellationToken).ConfigureAwait(false) is { Language: LanguageNames.VisualBasic }) 516var compilation = await newDocument.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
Simplification\AbstractSimplificationService.cs (1)
205rewriter.Initialize(document.Project.ParseOptions, options, cancellationToken);
Simplification\Simplifier.cs (4)
75return Expand(node, semanticModel, document.Project.Solution.Services, expandInsideNode, expandParameter, cancellationToken); 120return Expand(token, semanticModel, document.Project.Solution.Services, expandInsideNode, cancellationToken); 257var simplificationService = document.Project.Solution.Services.GetRequiredLanguageService<ISimplificationService>(document.Project.Language);
SimplifierOptions.cs (2)
84return configOptions.GetSimplifierOptions(document.Project.Services, fallbackOptions); 88=> await document.GetSimplifierOptionsAsync(await fallbackOptionsProvider.GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
SyntacticDocument.cs (1)
25public Project Project => Document.Project;
SyntaxEditorBasedCodeFixProvider.cs (1)
82var editor = new SyntaxEditor(root, document.Project.Solution.Services);
SyntaxFormattingOptions.cs (2)
69return configOptions.GetSyntaxFormattingOptions(document.Project.Services, fallbackOptions); 73=> await GetSyntaxFormattingOptionsAsync(document, await ((OptionsProvider<SyntaxFormattingOptions>)fallbackOptionsProvider).GetOptionsAsync(document.Project.Services, cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
TextDocumentExtensions.cs (2)
39return textDocument.Project.Solution.WithAdditionalDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!; 48return textDocument.Project.Solution.WithAnalyzerConfigDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!;
Workspace\Host\PersistentStorage\DocumentKey.cs (1)
42=> ToDocumentKey(ProjectKey.ToProjectKey(document.Project), document.State);
Workspace\Solution\Document.cs (17)
111var projectVersion = this.Project.Version; 128var projectVersion = this.Project.Version; 150return this.SupportsSyntaxTree && this.Project.SupportsCompilation; 288var compilation = (await this.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false))!; 325=> this.Project.Solution.WithDocumentSourceCodeKind(this.Id, kind).GetDocument(this.Id)!; 331=> this.Project.Solution.WithDocumentText(this.Id, text, PreservationMode.PreserveIdentity).GetDocument(this.Id)!; 337=> this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity).GetDocument(this.Id)!; 343=> this.Project.Solution.WithDocumentName(this.Id, name).GetDocument(this.Id)!; 349=> this.Project.Solution.WithDocumentFolders(this.Id, folders).GetDocument(this.Id)!; 359=> this.Project.Solution.WithDocumentFilePath(this.Id, filePath).GetDocument(this.Id)!; 433var filteredDocumentIds = this.Project.Solution.GetRelatedDocumentIds(this.Id); 446var solution = this.Project.Solution; 453this.Project.SupportsCompilation) 455var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken); 482InitializeCachedOptions(Project.Solution.Options); 494return new DocumentOptionSet(options, solutionOptions, Project.Language); 503var provider = (ProjectState.ProjectAnalyzerConfigOptionsProvider)Project.State.AnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Workspace_Editor.cs (2)
757newSolution = document.WithText(this.GetOpenDocumentText(oldSolution, docId)).Project.Solution; 775newSolution = document.WithText(this.GetOpenDocumentText(oldSolution, docId)).Project.Solution;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
VisualStudioMSBuildWorkspaceTests.cs (8)
329p1 = newDoc.Project; 389Assert.Equal(project.Version, document1.Project.Version); // updating doc should not have changed project version 390var latestDV1 = await document1.Project.GetLatestDocumentVersionAsync(); 400Assert.NotEqual(document1.Project.Version, document2.Project.Version); // project did change, so project versions should be different 401Assert.True(document2.Project.Version.GetTestAccessor().IsNewerThan(document1.Project.Version)); 2877var noEncodingSolution = noEncodingDoc.Project.Solution;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
WorkspaceExtensions.cs (1)
19var newSolution = oldSolution.AddDocument(id, name, initialText, folders).GetDocument(id)!.WithSourceCodeKind(sourceCodeKind).Project.Solution;
Microsoft.CodeAnalysis.Workspaces.UnitTests (172)
CodeCleanup\AddMissingTokensTests.cs (1)
2722var cleanDocument = await CodeCleaner.CleanupAsync(document, textSpans[0], CodeCleanupOptions.GetDefault(document.Project.Services), codeCleanups);
CodeCleanup\CodeCleanupTests.cs (12)
44var cleanDocument = await CodeCleaner.CleanupAsync(document, ImmutableArray<TextSpan>.Empty, CodeCleanupOptions.GetDefault(document.Project.Services)); 53var cleanDocument = await CodeCleaner.CleanupAsync(document, CodeCleanupOptions.GetDefault(document.Project.Services)); 63var cleanDocument = await CodeCleaner.CleanupAsync(document, root.FullSpan, CodeCleanupOptions.GetDefault(document.Project.Services)); 73var cleanDocument = await CodeCleaner.CleanupAsync(document, ImmutableArray.Create(root.FullSpan), CodeCleanupOptions.GetDefault(document.Project.Services)); 96var cleanDocument = await CodeCleaner.CleanupAsync(document, ImmutableArray<TextSpan>.Empty, CodeCleanupOptions.GetDefault(document.Project.Services)); 106var cleanDocument = await CodeCleaner.CleanupAsync(document, CodeCleanupOptions.GetDefault(document.Project.Services)); 117var cleanDocument = await CodeCleaner.CleanupAsync(document, root.FullSpan, CodeCleanupOptions.GetDefault(document.Project.Services)); 128var cleanDocument = await CodeCleaner.CleanupAsync(document, ImmutableArray.Create(root.FullSpan), CodeCleanupOptions.GetDefault(document.Project.Services)); 140var cleanDocument = await CodeCleaner.CleanupAsync(document, annotation, CodeCleanupOptions.GetDefault(document.Project.Services)); 153var cleanDocument = await CodeCleaner.CleanupAsync(document, annotation, CodeCleanupOptions.GetDefault(document.Project.Services)); 324var cleanDocument = await CodeCleaner.CleanupAsync(document, CodeCleanupOptions.GetDefault(document.Project.Services)); 408CodeCleaner.CleanupAsync(document, spans, CodeCleanupOptions.GetDefault(document.Project.Services), codeCleanups.Concat(spanCodeCleanup)).Wait();
CodeCleanup\FixIncorrectTokenTests.cs (1)
747var cleanDocument = await CodeCleaner.CleanupAsync(document, textSpans[0], CodeCleanupOptions.GetDefault(document.Project.Services), codeCleanups);
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
1023var cleanDocument = await CodeCleaner.CleanupAsync(document, textSpans[0], CodeCleanupOptions.GetDefault(document.Project.Services), codeCleanups);
CodeCleanup\ReduceTokenTests.cs (1)
2011var cleanDocument = await CodeCleaner.CleanupAsync(document, textSpans[0], CodeCleanupOptions.GetDefault(document.Project.Services), codeCleanups);
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (1)
1380var cleanDocument = await CodeCleaner.CleanupAsync(document, textSpans[0], CodeCleanupOptions.GetDefault(document.Project.Services), codeCleanups);
Formatter\FormatterTests.cs (1)
79document = document.Project.Solution.WithOptions(solutionOptions).GetRequiredDocument(document.Id);
GeneratedCodeRecognitionTests.cs (2)
63"), filePath: @"z:\.editorconfig").Project; 69"), filePath: @"z:\.editorconfig").Project;
SolutionTests\ProjectSemanticVersionTests.cs (34)
24await AssertSemanticVersionChangedAsync(project, project.AddDocument("Hello.cs", "class C { }").Project); 32.AddDocument("Hello.cs", "class C { }").Project; 47document.Project, 48document.WithText(text.Replace(position, length: 0, "public async Task M() { }")).Project); 61document.Project, 62document.WithText(text.Replace(position, length: 0, "int x = 10;")).Project); 75document.Project, 76document.WithText(text.Replace(position, length: 0, "int x = 10")).Project); 89document.Project, 90document.WithText(text.Replace(position, length: 0, " \r\n")).Project); 103document.Project, 104document.WithText(text.Replace(position, length: 0, "public int X = 20;")).Project); 117document.Project, 118document.WithText(text.Replace(span, "100")).Project); 131document.Project, 132document.WithText(text.Replace(position, length: 0, "public const int X = 20;")).Project); 145document.Project, 146document.WithText(text.Replace(span, "100")).Project); 159document.Project, 160document.WithText(text.Replace(position, length: 0, "Public Sub M()\r\nEnd Sub")).Project); 173document.Project, 174document.WithText(text.Replace(position, length: 0, "Dim x As Integer = 10")).Project); 187document.Project, 188document.WithText(text.Replace(position, length: 0, "Optional x As Integer = 10")).Project); 201document.Project, 202document.WithText(text.Replace(position, length: 0, " \r\n")).Project); 215document.Project, 216document.WithText(text.Replace(position, length: 0, "Public X As Integer = 20")).Project); 229document.Project, 230document.WithText(text.Replace(span, "100")).Project); 243document.Project, 244document.WithText(text.Replace(position, length: 0, "Public Const X As Integer = 20")).Project); 257document.Project, 258document.WithText(text.Replace(span, "100")).Project);
SolutionTests\SolutionTests.cs (63)
1157var compilation = await document.Project.GetRequiredCompilationAsync(default); 1288Assert.Equal(document.Project.ParseOptions, oldTree.Options); 1290document = document.Project.WithParseOptions(new CSharpParseOptions(languageVersion: CS.LanguageVersion.CSharp1)).GetRequiredDocument(documentId); 1294Assert.Equal(document.Project.ParseOptions, newTree.Options); 1327Assert.Equal(document.Project.ParseOptions, oldTree.Options); 1333document = document.Project.WithParseOptions(newOptions).GetRequiredDocument(documentId); 1337Assert.Equal(document.Project.ParseOptions, newTree.Options); 2004Assert.NotSame(document1.Project, document2.Project); 2143.Project.Solution; 3056var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 3059var observed2 = GetObservedSyntaxTreeRootAsync(doc2.Project.Solution, did); 3285var compilation = await solution.State.GetCompilationAsync(doc.Project.State, CancellationToken.None).ConfigureAwait(false); 3435project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project; 3442var tree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 3447await documentToFreeze.Project.GetDependentSemanticVersionAsync(), 3448await frozenDocument.Project.GetDependentSemanticVersionAsync()); 3451await documentToFreeze.Project.GetSemanticVersionAsync(), 3452await frozenDocument.Project.GetSemanticVersionAsync()); 3460project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project; 3463project = documentToFreezeOriginal.Project; 3484await documentToFreezeOriginal.Project.GetDependentSemanticVersionAsync(), 3485await frozenDocument.Project.GetDependentSemanticVersionAsync()); 3488await documentToFreezeChanged.Project.GetDependentSemanticVersionAsync(), 3489await frozenDocument.Project.GetDependentSemanticVersionAsync()); 3492await documentToFreezeOriginal.Project.GetSemanticVersionAsync(), 3493await frozenDocument.Project.GetSemanticVersionAsync()); 3496await documentToFreezeChanged.Project.GetSemanticVersionAsync(), 3497await frozenDocument.Project.GetSemanticVersionAsync()); 3505project = project.AddDocument("Extra.cs", SourceText.From("class Extra { }")).Project; 3508project = documentToFreezeOriginal.Project; 3530await documentToFreezeOriginal.Project.GetDependentSemanticVersionAsync(), 3531await frozenDocument.Project.GetDependentSemanticVersionAsync()); 3534await documentToFreezeChanged.Project.GetDependentSemanticVersionAsync(), 3535await frozenDocument.Project.GetDependentSemanticVersionAsync()); 3538await documentToFreezeOriginal.Project.GetSemanticVersionAsync(), 3539await frozenDocument.Project.GetSemanticVersionAsync()); 3542await documentToFreezeChanged.Project.GetSemanticVersionAsync(), 3543await frozenDocument.Project.GetSemanticVersionAsync()); 3572var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 3583.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project; 3587project = project.AddAdditionalDocument("Test.txt", "").Project; 3593Assert.Empty(frozenDocument.Project.AdditionalDocuments); 3601.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project 3602.AddDocument("RegularDocument2.cs", "// Source File", filePath: "RegularDocument2.cs").Project; 3607Assert.Single(frozenDocument.Project.Documents); 3608var singleTree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 3618.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project; 3623.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project; 3629Assert.Single(frozenDocument.Project.Documents); 3630var singleTree = Assert.Single((await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 3640.AddDocument("RegularDocument.cs", "// Source File", filePath: null).Project; 3645.AddDocument("RegularDocument2.cs", "// Source File", filePath: null).Project; 3651Assert.Equal(2, frozenDocument.Project.Documents.Count()); 3652var treesInCompilation = (await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees; 3655foreach (var document in frozenDocument.Project.Documents) 3667var originalCompilation = await document.Project.GetCompilationAsync(); 3672Assert.Contains(await frozenDocument.GetSyntaxTreeAsync(), (await frozenDocument.Project.GetCompilationAsync()).SyntaxTrees); 3707Assert.Contains(tree, (await frozen.Project.GetCompilationAsync()).SyntaxTrees); 4310var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id); 4342static (sourceText, document) => document.Project.Solution.WithDocumentText(document.Id, sourceText, PreservationMode.PreserveIdentity), 4399var documentOptionsViaSyntaxTree = document.Project.State.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(syntaxTree); 4402var projectOptions = document.Project.GetAnalyzerConfigOptions();
SolutionTests\SolutionWithSourceGeneratorTests.cs (38)
51project = project.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 174.AddAdditionalDocument("Test.txt", "Hello, world!").Project 175.AddAdditionalDocument("Test2.txt", "Hello, world!").Project; 196project = project.AdditionalDocuments.First().WithAdditionalDocumentText(SourceText.From("Changed text!")).Project; 220project = project.AddDocument("Source.cs", SourceText.From("")).Project; 246.AddDocument("Hello.cs", "// Source File").Project 247.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 290project = project.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 329.AddDocument("Hello.cs", "// Source File").Project 330.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 336var partialProject = project.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None).Project; 350.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 389project = project.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 402.AddAdditionalDocument("Test.txt", "Hello, world!").Project.Solution; 427.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 441.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project 442.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 448project = project.Documents.Single(d => d.Name == "RegularDocument.cs").WithFrozenPartialSemantics(CancellationToken.None).Project; 464.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project 465.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 470project = project.Documents.Single().WithText(SourceText.From("// Change")).Project; 484.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project 485.AddAdditionalDocument("Test.txt", "Hello, world!").Project; 511.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project; 548project = project.Documents.Single().WithText(newText).Project; 582Assert.NotSame(workspace.CurrentSolution, generatedDocument.Project.Solution); 585var compilation = await generatedDocument.Project.GetRequiredCompilationAsync(CancellationToken.None); 605Assert.Same(workspace.CurrentSolution, generatedDocument!.Project.Solution); 617Assert.True(workspace.SetCurrentSolution(_ => originalAdditionalFile.Project.Solution, WorkspaceChangeKind.SolutionChanged)); 619var generatedDocument = Assert.Single(await originalAdditionalFile.Project.GetSourceGeneratedDocumentsAsync()); 632var compilation = await generatedDocument.Project.GetRequiredCompilationAsync(CancellationToken.None); 660var projectWithReference = generatedDocument.Project.Solution.Projects.Single(p => p.Id != projectIdWithGenerator); 702.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project; 733.AddDocument("RegularDocument.cs", "// Source File", filePath: "RegularDocument.cs").Project; 746var compilation = await document.Project.GetRequiredCompilationAsync(CancellationToken.None); 765var originalDocument2 = AddEmptyProject(originalDocument1.Project.Solution, name: "Project2") 769var frozenSolution = originalDocument2.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 778var compilation = await document.Project.GetRequiredCompilationAsync(CancellationToken.None);
SolutionTests\TryApplyChangesTests.cs (1)
166Assert.True(workspace.TryApplyChanges(project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From("")).Project.Solution));
SymbolKeyTests.cs (2)
804workspace.TryApplyChanges(document.WithText(updated).Project.Solution); 851workspace.TryApplyChanges(document.WithText(updated).Project.Solution);
WorkspaceTests\AdhocWorkspaceTests.cs (5)
456Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 489Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 523Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 554Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 584Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution));
WorkspaceTests\WorkspaceReferenceTests.cs (4)
40var compilation2 = await document.Project.GetCompilationAsync(); 80var compilation2 = await document.Project.GetCompilationAsync(); 120var compilation2 = await document.Project.GetCompilationAsync(); 164var compilation2 = await document.Project.GetCompilationAsync();
WorkspaceTests\WorkspaceTests.cs (5)
33Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 49Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 67Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 84Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 100Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message);
Microsoft.VisualStudio.LanguageServices (122)
CallHierarchy\CallHierarchyCommandHandler.cs (3)
92semanticModel, caretPosition, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false); 97var mappingService = document.Project.Solution.Services.GetService<ISymbolMappingService>(); 117var notificationService = document.Project.Solution.Services.GetService<INotificationService>();
CallHierarchy\Finders\ImplementerFinder.cs (1)
48var item = await Provider.CreateItemAsync(implementation, bestLocation.Project, ImmutableArray<Location>.Empty, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\OverridingMemberFinder.cs (1)
44var item = await Provider.CreateItemAsync(@override, bestLocation.Project, ImmutableArray<Location>.Empty, cancellationToken).ConfigureAwait(false);
ChangeSignature\AddParameterDialogViewModel.cs (1)
28_notificationService = document.Project.Solution.Services.GetService<INotificationService>();
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
64_notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
CodeCleanup\AbstractCodeCleanUpFixer.cs (6)
139var options = _globalOptions.GetCodeActionOptions(document.Project.Services); 172return FixAsync(document.Project.Solution.Workspace, ApplyFixAsync, context); 178return newDocument.Project.Solution; 208var options = _globalOptions.GetCodeActionOptions(document.Project.Services); 210return newDoc.Project.Solution; 309project = fixedDocument.Project;
CodeLens\RemoteCodeLensReferencesService.cs (1)
183var classificationOptions = _globalOptions.GetClassificationOptions(document.Project.Language);
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (2)
137var solution = document.Project.Solution; 190document.Project.GetCompilationAsync(System.Threading.CancellationToken.None);
ExtractClass\VisualStudioExtractClassOptionsService.cs (3)
54var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>(); 70var memberToDependentsMap = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, document.Project, cancellationToken); 91document.Project.Language,
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (1)
361var options = _globalOptions.GetClassificationOptions(document.Project.Language);
FindReferences\Entries\DocumentSpanEntry.cs (6)
196var controlService = _excerptResult.Document.Project.Solution.Services.GetRequiredService<IContentControlService>(); 225var controlService = document.Project.Solution.Services.GetRequiredService<IContentControlService>(); 231var classificationOptions = Presenter._globalOptions.GetClassificationOptions(document.Project.Language); 236var clonedBuffer = excerpt.Value.Content.CreateTextBufferWithRoslynContentType(document.Project.Solution.Workspace); 290var workspace = _excerptResult.Document.Project.Solution.Workspace; 307var workspace = _excerptResult.Document.Project.Solution.Workspace;
FindReferences\StreamingFindUsagesPresenter.cs (4)
286var vsWorkspace = document.Project.Solution.Workspace as VisualStudioWorkspace; 288var (projectName, projectFlavor) = document.Project.State.NameAndFlavor; 289projectName ??= document.Project.Name; 291var guid = vsWorkspace?.GetProjectGuid(document.Project.Id) ?? Guid.Empty;
GenerateType\GenerateTypeDialogViewModel.cs (12)
270if (isRootOfTheProject || this.SelectedProject != _document.Project) 423if (_selectedProject != _document.Project) 512if (_selectedProject == _document.Project) 521_previouslyPopulatedDocumentList.AddRange(_document.Project.Documents 728var dependencyGraph = document.Project.Solution.GetProjectDependencyGraph(); 735projectListing.Add(new ProjectSelectItem(document.Project)); 739projectListing.AddRange(document.Project.Solution.Projects 740.Where(p => p != document.Project && !dependencyGraph.GetProjectsThatThisProjectTransitivelyDependsOn(p.Id).Contains(document.Project.Id)) 750this.SelectedProject = document.Project; 754this.AccessList = document.Project.Language == LanguageNames.CSharp 761this.KindList = document.Project.Language == LanguageNames.CSharp
GenerateType\VisualStudioGenerateTypeOptionsServiceFactory.cs (1)
54document.Project.Language == LanguageNames.CSharp ? ".cs" : ".vb",
Implementation\AbstractEditorFactory.cs (1)
413return project.AddAnalyzerConfigDocument(EditorConfigFileName, text, filePath: editorConfigFile).Project;
Implementation\AbstractVsTextViewFilter.cs (2)
117var languageDebugInfo = document.Project.Services.GetService<ILanguageDebugInfoService>(); 202var options = globalOptions.GetBraceMatchingOptions(document.Project.Language);
Implementation\VisualStudioSupportsFeatureService.cs (1)
100=> SupportsRenameWorker(document.Project.Solution.GetRelatedDocumentIds(document.Id));
InheritanceMargin\InheritanceMarginTaggerProvider.cs (3)
99if (document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive) 106if (GlobalOptions.GetOption(InheritanceMarginOptionsStorage.ShowInheritanceMargin, document.Project.Language) == false) 109var includeGlobalImports = GlobalOptions.GetOption(InheritanceMarginOptionsStorage.InheritanceMarginIncludeGlobalImports, document.Project.Language);
InheritanceMargin\InheritanceMarginViewMarginProvider.cs (1)
95document.Project.Language);
Interactive\VsResetInteractive.cs (1)
309var compilation = await document.Project.GetCompilationAsync().ConfigureAwait(true);
LanguageService\AbstractCreateServicesOnTextViewConnection.cs (2)
101if (e.Document.Project.Language == _languageName) 102_workQueue.AddWork(e.Document.Project.Id);
LanguageService\AbstractLanguageService`2.cs (2)
197if (openDocument?.Project.Solution.Workspace is MetadataAsSourceWorkspace masWorkspace) 204var options = BlockStructureOptionsStorage.GetBlockStructureOptions(globalOptions, openDocument.Project.Language, isMetadataAsSource: masWorkspace is not null);
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (2)
59var formattingOptions = textBuffer.GetSyntaxFormattingOptions(EditorOptionsService, document.Project.Services, explicitFormat: true); 69var rules = ruleFactory.CreateRule(documentSyntax, start).Concat(Formatter.GetDefaultFormattingRules(document.Project.Services));
LanguageService\AbstractLanguageService`2.VsCodeWindowManager.cs (1)
86if (textBuffer?.IsInLspEditorContext() == true && document!.Project!.Language != InternalLanguageNames.TypeScript)
Library\ClassView\AbstractSyncClassViewCommandHandler.cs (2)
96navInfo = libraryService.NavInfoFactory.CreateForSymbol(symbol, document.Project, semanticModel.Compilation, useExpandedHierarchy: true); 99navInfo ??= libraryService.NavInfoFactory.CreateForProject(document.Project);
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (2)
59return GenerateOptions(document.Project.Language, viewModel, result.GetValueOrDefault()); 114var memberToDependentsMap = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, document.Project, cancellationTokenSource.Token);
NavigateTo\RoslynSearchResultViewFactory.cs (1)
69var projectGuid = _provider._workspace.GetProjectGuid(document.Project.Id);
Preview\FileChange.cs (3)
83left.Project.Services.GetService<IContentTypeLanguageService>().GetDefaultContentType()); 220var workspace = document.Project.Solution.Workspace; 231= document.Project.Language == LanguageNames.CSharp ? (ushort)StandardGlyphGroup.GlyphCSharpFile :
Preview\PreviewUpdater.cs (2)
75_previewWorkspace ??= new PreviewDialogWorkspace(document.Project.Solution); 84var contentTypeService = document.Project.Services.GetRequiredService<IContentTypeLanguageService>();
Preview\TopLevelChange.cs (1)
88var oldLinkedDocument = oldDocument.Project.Solution.GetDocument(linkedDocumentId);
Progression\GraphBuilder.cs (2)
692_nodeToContextProjectMap[node] = document.Project; 703var project = document.Project;
Progression\GraphNavigatorExtension.cs (1)
97var editorWorkspace = document.Project.Solution.Workspace;
Progression\GraphNodeIdCreation.cs (1)
33GraphNodeId.GetPartial(CodeGraphNodeIdName.Assembly, new Uri(document.Project.FilePath, UriKind.RelativeOrAbsolute)),
ProjectSystem\VisualStudioWorkspaceImpl.AddAdditionalDocumentUndoUnit.cs (1)
24=> fromProject.AddAdditionalDocument(DocumentInfo.Name, Text, DocumentInfo.Folders, DocumentInfo.FilePath).Project;
ProjectSystem\VisualStudioWorkspaceImpl.AddAnalyzerConfigDocumentUndoUnit.cs (1)
23=> fromProject.AddAnalyzerConfigDocument(DocumentInfo.Name, Text, DocumentInfo.Folders, DocumentInfo.FilePath).Project;
ProjectSystem\VisualStudioWorkspaceImpl.AddDocumentUndoUnit.cs (1)
23=> fromProject.AddDocument(DocumentInfo.Name, Text, DocumentInfo.Folders, DocumentInfo.FilePath).Project;
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
1037OpenDocumentFromPath(document.FilePath, document.Project.Id, activate);
PullMemberUp\VisualStudioPullMemberUpService.cs (2)
60document.Project.Solution, 63var memberToDependentsMap = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, document.Project, cancellationTokenSource.Token);
Snippets\AbstractSnippetExpansionClient.cs (6)
544if (!(EditorOptionsService.GlobalOptions.GetOption(CompletionViewOptionsStorage.EnableArgumentCompletionSnippets, document.Project.Language) ?? false)) 744var compilation = ThreadingContext.JoinableTaskFactory.Run(() => document.Project.GetRequiredCompilationAsync(CancellationToken.None)); 767var semanticInfo = semanticModel.GetSemanticInfo(token, document.Project.Solution.Services, cancellationToken); 905foreach (var provider in GetArgumentProviders(document.Project.Solution.Workspace)) 1067var languageServices = documentWithImports.Project.Services; 1072AddReferences(documentWithImports.Project, snippetNode);
Snippets\SnippetFunctions\SnippetFunctionClassName.cs (1)
47var snippetFunctionService = document.Project.GetRequiredLanguageService<SnippetFunctionService>();
Snippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
52var snippetFunctionService = document.Project.GetRequiredLanguageService<SnippetFunctionService>();
Storage\CloudCachePersistentStorage.cs (1)
87? s_projectToContainerKeyCache.GetValue(document.Project.State, _projectToContainerKeyCacheCallback).GetDocumentContainerKey(document.State)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
306var languageServices = projectDiagnosticsToFixMap.Select(p => p.Key.Services).Concat(documentDiagnosticsToFixMap.Select(kvp => kvp.Key.Project.Services)).ToHashSet(); 473if (oldDocument.Project.Language != language)
ValueTracking\ValueTrackedTreeItemViewModel.cs (1)
107var options = globalOptions.GetClassificationOptions(document.Project.Language);
ValueTracking\ValueTrackingCommandHandler.cs (2)
103var service = document.Project.Solution.Services.GetRequiredService<IValueTrackingService>(); 125var solution = document.Project.Solution;
Venus\ContainedDocument.cs (2)
776var formattingOptions = subjectBuffer.GetSyntaxFormattingOptions(editorOptionsService, document.Project.Services, explicitFormat: false); 812var services = document.Project.Solution.Services;
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (2)
51var targetDocument = thisDocument.Project.Solution.GetDocument(targetDocumentId); 77additionalFormattingRule: targetDocument.Project.Services.GetService<IAdditionalFormattingRuleLanguageService>().GetAdditionalCodeGenerationRule(),
Venus\ContainedLanguageCodeSupport.cs (20)
47var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 60var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 90var compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 159var thisCompilation = thisDocument.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 195returnType: targetDocument.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetSpecialType(SpecialType.System_Void), 206var codeModel = targetDocument.Project.Services.GetRequiredService<ICodeModelNavigationPointService>(); 207var syntaxFacts = targetDocument.Project.Services.GetRequiredService<ISyntaxFactsService>(); 221var fallbackOptions = globalOptions.GetCleanCodeGenerationOptions(targetDocument.Project.Services); 236targetDocument.Project.Solution.Services, 266var type = thisDocument.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 274var codeModel = thisDocument.Project.Services.GetService<ICodeModelNavigationPointService>(); 278var memberNodeDocument = thisDocument.Project.Solution.GetDocument(memberNode.SyntaxTree); 299var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(className); 301var compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken); 335var newSolution = Renamer.RenameSymbolAsync(document.Project.Solution, symbol, options, newName, cancellationToken).WaitAndGetResult_Venus(cancellationToken); 336var changedDocuments = newSolution.GetChangedDocuments(document.Project.Solution); 422return document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(fullyQualifiedName); 428var type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetTypeByMetadataName(typeName); 434var ns = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken).GlobalNamespace; 486var compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult_Venus(cancellationToken);
Workspace\VisualStudioDocumentNavigationService.cs (1)
353vsWorkspace.OpenDocumentFromPath(mappedSpanResult.FilePath, generatedDocument.Project.Id);
Workspace\VisualStudioSymbolNavigationService.cs (3)
172var editorWorkspace = openedDocument.Project.Solution.Workspace; 296if (document.Project.Solution.Workspace is VisualStudioWorkspace visualStudioWorkspace 299hierarchy = visualStudioWorkspace.GetHierarchy(document.Project.Id);
Microsoft.VisualStudio.LanguageServices.CSharp (3)
LanguageService\CSharpHelpContextService.cs (1)
173symbol = semanticModel.GetSemanticInfo(token, document.Project.Solution.Services, cancellationToken)
Snippets\SnippetExpansionClient.cs (2)
123var compilation = document.Project.GetRequiredCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken); 129document.Project.Solution.Workspace.ApplyDocumentChanges(formattedDocument, cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
89var compilation = await document.Project.GetRequiredCompilationAsync(CancellationToken.None);
Microsoft.VisualStudio.LanguageServices.Implementation (12)
CodeModel\FileCodeModel.cs (6)
345var workspace = document.Project.Solution.Workspace; 369var workspace = document.Project.Solution.Workspace; 387var applied = workspace.TryApplyChanges(document.Project.Solution); 457return GetDocument().Project 712_batchDocument.Project.Solution.Workspace.TryApplyChanges(newDocument.Project.Solution);
CodeModel\FileCodeModel_Events.cs (1)
58var projectCodeModel = this.State.ProjectCodeModelFactory.GetProjectCodeModel(document.Project.Id);
CodeModel\ProjectCodeModelFactory.cs (1)
227=> GetProjectCodeModel(sourceGeneratedDocument.Project.Id).CreateFileCodeModel(sourceGeneratedDocument);
CodeModel\TextManagerAdapter.cs (1)
22var hierarchyOpt = fileCodeModel.Workspace.GetHierarchy(document.Project.Id);
Options\AbstractOptionPreviewViewModel.cs (2)
138var fallbackFormattingOptions = OptionStore.GlobalOptions.GetSyntaxFormattingOptions(document.Project.Services); 158workspace.TryApplyChanges(document.Project.Solution);
SolutionExplorer\SourceGeneratedFileItems\SourceGeneratedFileItemSource.cs (1)
148_threadingContext, document.Id, document.HintName, document.Project.Language, _workspace));
Microsoft.VisualStudio.LanguageServices.UnitTests (38)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
466Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
CodeModel\CSharp\CodeClassTests.vb (1)
3911Dim result = state.VisualStudioWorkspace.TryApplyChanges(document.Project.Solution)
CodeModel\VisualBasic\CodeClassTests.vb (1)
3170Dim result = state.VisualStudioWorkspace.TryApplyChanges(document.Project.Solution)
CommonControls\MemberSelectionViewModelTests.vb (2)
183Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None) 188Dim memberToDependents = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, workspaceDoc.Project, CancellationToken.None)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
236Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
Diagnostics\DefaultDiagnosticUpdateSourceTests.vb (5)
107workspace, document.Project.Id, document.Id, Nothing, includeSuppressedDiagnostics:=False, CancellationToken.None) 145workspace, document.Project.Id, document.Id, Nothing, includeSuppressedDiagnostics:=False, CancellationToken.None) 184workspace, document.Project.Id, document.Id, Nothing, includeSuppressedDiagnostics:=False, CancellationToken.None) 226workspace, document.Project.Id, document.Id, Nothing, includeSuppressedDiagnostics:=False, CancellationToken.None) 329workspace, document.Project.Id, document.Id, Nothing, includeSuppressedDiagnostics:=False, CancellationToken.None)
Diagnostics\DiagnosticTableDataSourceTests.vb (2)
685document1.Project.Id, 709document2.Project.Id,
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (1)
565oldSolution:=workspace.CurrentSolution, newSolution:=document.Project.Solution, project.Id, document.Id))
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)(),
GenerateType\GenerateTypeViewModelTests.vb (1)
862If(document.Project.Language = LanguageNames.CSharp, ".cs", ".vb"),
GoToDefinition\GoToDefinitionApiTests.vb (2)
37Dim project = document.Project 48symbolInfo.Symbol, document.Project.Solution,
MoveStaticMembers\MoveStaticMembersViewModelTest.vb (1)
33Dim syntaxFacts = workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)()
Preview\PreviewChangesTests.vb (5)
50forkedDocument.Project.Solution, 98Dim newSolution = forkedDocument.Project.Solution 147forkedDocument.Project.Solution, 195Dim newSolution = forkedDocument.Project.Solution 285Dim updatedSolution = document1.Project.Solution _
Progression\ProgressionTestState.vb (1)
45Await graphBuilder.AddNodeAsync(symbol, document.Project, document, CancellationToken.None)
PullMemberUp\PullMemberUpViewModelTest.vb (3)
255Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None) 257Dim baseTypeTree = BaseTypeTreeNodeViewModel.CreateBaseTypeTree(glyphService:=Nothing, workspaceDoc.Project.Solution, memberSymbol.ContainingType, CancellationToken.None) 261Dim memberToDependents = SymbolDependentsBuilder.FindMemberToDependentsMap(membersInType, workspaceDoc.Project, CancellationToken.None)
RQName\RQNameTests.vb (1)
247Dim token = Await tree.GetTouchingWordAsync(doc.CursorPosition.Value, workspaceDoc.Project.Services.GetService(Of ISyntaxFactsService)(), CancellationToken.None)
Venus\DocumentService_IntegrationTests.vb (4)
197Assert.True(workspace.TryApplyChanges(newDocument.Project.Solution)) 204Assert.Throws(Of NotSupportedException)(Sub() workspace.TryApplyChanges(newDocument.Project.Solution)) 271Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, TestWorkspace) 309Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, TestWorkspace)
VsNavInfo\VsNavInfoTests.vb (4)
837Dim project = document.Project 839Dim navInfo = libraryService.NavInfoFactory.CreateForSymbol(symbol, document.Project, compilation, useExpandedHierarchy) 875Dim project = document.Project 877Dim navInfo = libraryService.NavInfoFactory.CreateForSymbol(symbol, document.Project, compilation, useExpandedHierarchy)
Microsoft.VisualStudio.LanguageServices.VisualBasic (11)
Help\VisualBasicHelpContextService.vb (1)
48Dim visitor = New Visitor(token.Span, Await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(False), document.Project.Solution.WorkspaceKind <> WorkspaceKind.MetadataAsSource, Me, cancellationToken)
Snippets\SnippetExpansionClient.vb (2)
140document.Project.Solution.Workspace.ApplyDocumentChanges(formattedDocument, cancellationToken) 148Dim compilation = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken)
Venus\ContainedLanguageStaticEventBinding.vb (7)
27Dim type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken).GetTypeByMetadataName(className) 64Dim type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken).GetTypeByMetadataName(className) 66Dim targetDocument = document.Project.Solution.GetDocument(memberSymbol.Locations.First().SourceTree) 80Dim codeModel = targetDocument.Project.Services.GetService(Of ICodeModelService)() 92Dim type = document.Project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken).GetTypeByMetadataName(className) 94Dim targetDocument = document.Project.Solution.GetDocument(memberSymbol.Locations.First().SourceTree) 108Dim codeModel = targetDocument.Project.Services.GetService(Of ICodeModelService)()
Venus\VisualBasicContainedLanguage.vb (1)
87Dim targetDocument = thisDocument.Project.Solution.GetDocument(targetDocumentId)
Microsoft.VisualStudio.LanguageServices.Xaml (19)
Extensions.cs (4)
33if (document.Project.SupportsCompilation) 35return document.Project; 39return document.Project.Solution.Projects.Single(p => p.SupportsCompilation && p.FilePath == document.Project.FilePath);
Features\InlineRename\XamlEditorInlineRenameService.cs (1)
84_renameInfo, _document.Project.Solution,
Implementation\LanguageServer\Handler\Commands\CreateEventCommandHandler.cs (1)
55var commandService = document.Project.Services.GetService<IXamlCommandService>();
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
64var completionService = document.Project.Services.GetRequiredService<IXamlCompletionService>();
Implementation\LanguageServer\Handler\Completion\CompletionResolveHandler.cs (2)
74var completionService = document.Project.Services.GetRequiredService<IXamlCompletionService>(); 81var options = _globalOptions.GetSymbolDescriptionOptions(document.Project.Language);
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
61var xamlGoToDefinitionService = document.Project.Services.GetService<IXamlGoToDefinitionService>();
Implementation\LanguageServer\Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
127var project = document.Project;
Implementation\LanguageServer\Handler\FoldingRanges\FoldingRangesHandler.cs (1)
44var xamlStructureService = document.Project.Services.GetService<IXamlStructureService>();
Implementation\LanguageServer\Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
32var formattingService = document?.Project.Services.GetService<IXamlFormattingService>();
Implementation\LanguageServer\Handler\Formatting\FormatDocumentOnTypeHandler.cs (1)
46var formattingService = document?.Project.Services.GetService<IXamlFormattingService>();
Implementation\LanguageServer\Handler\Hover\HoverHandler.cs (2)
54var quickInfoService = document.Project.Services.GetService<IXamlQuickInfoService>(); 69var options = _globalOptions.GetSymbolDescriptionOptions(document.Project.Language);
Implementation\LanguageServer\Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
42var insertService = document.Project.Services.GetService<IXamlAutoInsertService>();
Implementation\LanguageServer\Handler\OnTypeRename\OnTypeRenameHandler.cs (1)
74var renameService = document.Project.Services.GetService<IXamlTypeRenameService>();
Implementation\XamlProjectService.cs (1)
204var project = _xamlProjects.Values.SingleOrDefault(p => p.Id == document.Project.Id);
Roslyn.VisualStudio.Next.UnitTests (16)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
57var newSolution = document.Project.Solution.WithDocumentText(document.Id, newText, PreservationMode.PreserveIdentity);
Remote\SnapshotSerializationTests.cs (7)
62var project2 = document1.Project.Solution.AddProject("Project2", "Project2.dll", LanguageNames.VisualBasic); 65solution = document2.Project.Solution.GetRequiredProject(project1.Id) 69.AddAdditionalDocument("Additional", SourceText.From("hello"), ImmutableArray.Create("test"), @".\Add").Project.Solution; 163using var scope = await validator.AssetStorage.StoreAssetsAsync(document.Project.Solution, CancellationToken.None).ConfigureAwait(false); 186using var scope = await validator.AssetStorage.StoreAssetsAsync(document.Project.Solution, CancellationToken.None).ConfigureAwait(false); 187await validator.VerifySolutionStateSerializationAsync(document.Project.Solution, scope.SolutionChecksum).ConfigureAwait(false); 532var serializer = document.Project.Solution.Services.GetService<ISerializerService>();
Services\ServiceHubServicesTests.cs (4)
435return document.WithText(GetNewText(document, csAddition, vbAddition)).Project.Solution; 440if (document.Project.Language == LanguageNames.CSharp) 552solution = current.AddDocument($"Document{i}", SourceText.From(documents[i])).Project.Solution; 558solution = current.AddAdditionalDocument($"AdditionalDocument{i}", SourceText.From(additionalDocuments[i])).Project.Solution;
Services\SolutionServiceTests.cs (4)
227project = project.AddDocument("newDocument", SourceText.From("// new text")).Project; 233return document.Project.Solution; 501var frozenSolution1 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, frozenText1).Project.Solution; 510var frozenSolution2 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, frozenText2).Project.Solution;