src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (12)
51private async Task<Solution> FixNodeAsync(
73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
77var solution = document.Project.Solution;
83var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false);
96private async Task<Solution> RemoveAsyncTokenAsync(
110var newSolution = newDocument.Project.Solution;
119private static async Task<Solution> RemoveAwaitFromCallersAsync(
154private static async Task<Solution> RemoveAwaitFromCallersAsync(
155Solution solution, ImmutableArray<ReferenceLocation> locations, CancellationToken cancellationToken)
157var currentSolution = solution;
170private static async Task<Solution> RemoveAwaitFromCallersAsync(
171Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (12)
85var solution = context.Document.Project.Solution;
104private async Task<Solution> ProcessResultAsync(
105Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
117private async Task<Solution> ProcessResultWorkerAsync(
118Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
273var updatedSolution = currentSolution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot);
280private static async Task<Solution> UpdateReferencesAsync(
281Solution solution,
361Solution originalSolution,
362Solution currentSolution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
133Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
NavigationBar\CSharpNavigationBarItemService.cs (4)
63Solution solution, SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken)
189Solution solution, ISymbol member, SemanticModel semanticModel, CancellationToken cancellationToken)
217Solution solution, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
253Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
EditAndContinue\ActiveStatementTrackingService.cs (7)
55public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
69public void StartTracking(Solution solution, IActiveStatementSpanFactory spanProvider)
93public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
172var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution);
192internal async Task TrackActiveSpansAsync(Solution solution)
315public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
356var solution = document.Project.Solution;
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (9)
86var solutionWithOriginalName = await CreateSolutionWithOriginalNameAsync(
93var renamedSolution = await Renamer.RenameSymbolAsync(solutionWithOriginalName, symbol, options, newName, cancellationToken).ConfigureAwait(false);
154var finalSolution = workspace.CurrentSolution;
182private async Task<Solution> CreateSolutionWithOriginalNameAsync(
198var solution = document.Project.Solution;
199var finalSolution = solution.WithDocumentTexts(
205private async Task<ISymbol> TryGetSymbolAsync(Solution solutionWithOriginalName, DocumentId documentId, CancellationToken cancellationToken)
223private (NotificationSeverity, string)? TryUpdateWorkspaceForResetOfTypedIdentifier(Workspace workspace, Solution newSolution, int trackingSessionId)
256Solution newSolution,
CodeLens\CodeLensReferencesService.cs (8)
42private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
84public async ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
89public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken)
101private static async Task<ReferenceLocationDescriptor> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken)
202public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
245private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
259public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
275public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensReferencesService.cs (5)
14ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken);
23Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken);
28Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
33Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
38Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (23)
42public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken);
44public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
126public override async Task<Solution?> TryChangeTopLevelNamespacesAsync(
144var solution = document.Project.Solution;
182public override async Task<Solution> ChangeNamespaceAsync(
201var solution = document.Project.Solution;
213var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false);
224var solutionAfterNamespaceChange = annotatedSolution;
235var solutionAfterFirstMerge = await MergeDiffAsync(solution, solutionAfterNamespaceChange, cancellationToken).ConfigureAwait(false);
254var solutionAfterImportsRemoved = await RemoveUnnecessaryImportsAsync(
270Solution solution,
312protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken)
349var solution = document.Project.Solution;
428private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync(
429Solution solution,
471var solutionWithChangedNamespace = documentWithNewNamespace.Project.Solution;
502var solutionWithFixedReferences = solutionWithChangedNamespace.WithDocumentSyntaxRoots(fixedDocuments);
800private static async Task<Solution> RemoveUnnecessaryImportsAsync(
801Solution solution,
890private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
Diagnostics\IDiagnosticAnalyzerService.cs (4)
86Solution solution, ProjectId projectId, AnalyzerReference analyzerReference, string language, CancellationToken cancellationToken);
96Solution solution, ProjectId projectId, AnalyzerReference analyzerReference, CancellationToken cancellationToken);
102Solution solution, ImmutableArray<string> diagnosticIds, CancellationToken cancellationToken);
106Solution solution, CancellationToken cancellationToken);
Diagnostics\Service\DiagnosticAnalyzerService.cs (4)
143Solution solution, ProjectId projectId, AnalyzerReference analyzerReference, string language, CancellationToken cancellationToken)
167Solution solution, ProjectId projectId, AnalyzerReference analyzerReference, CancellationToken cancellationToken)
207Solution solution, ImmutableArray<string> diagnosticIds, CancellationToken cancellationToken)
235public async Task<ImmutableDictionary<string, ImmutableArray<DiagnosticDescriptor>>> GetDiagnosticDescriptorsPerReferenceAsync(Solution solution, CancellationToken cancellationToken)
EditAndContinue\IEditAndContinueService.cs (3)
22ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ImmutableDictionary<ProjectId, RunningProjectOptions> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
27ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken);
31ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EncapsulateField\AbstractEncapsulateFieldService.cs (14)
110public async Task<Solution> EncapsulateFieldsAsync(
118var solution = document.Project.Solution;
141private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken)
146var currentSolution = document.Project.Solution;
157var nextSolution = await EncapsulateFieldAsync(document, currentField, updateReferences, cancellationToken).ConfigureAwait(false);
167private async Task<Solution?> EncapsulateFieldAsync(
182var solution = document.Project.Solution;
193var solutionNeedingProperty = await UpdateReferencesAsync(
230private async Task<Solution> UpdateReferencesAsync(
231bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken)
275private static async Task<Solution> RenameAsync(
276Solution solution,
311private ISet<(DocumentId documentId, TextSpan span)> GetConstructorLocations(Solution solution, INamedTypeSymbol containingType)
318Solution destinationSolution,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (15)
106var solution = Registration.GetSolutionToAnalyze();
218private void EnqueueSolutionChangedEvent(Solution oldSolution, Solution newSolution)
243private void EnqueueFullSolutionEvent(Solution solution, UnitTestingInvocationReasons invocationReasons)
255private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId)
267private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons)
273private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons)
283private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId)
388var solution = Registration.GetSolutionToAnalyze();
494var solution = _workCoordinator.Registration.GetSolutionToAnalyze();
545public string GetLanguagesStringForTelemetry(Solution solution)
591public int GetDocumentCount(Solution solution)
634public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution)
ExtractInterface\AbstractExtractInterfaceService.cs (17)
35protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync(
36Solution unformattedSolution,
138var solution = refactoringResult.DocumentToExtractFrom.Project.Solution;
174Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol,
194var completedUnformattedSolution = await GetSolutionWithOriginalTypeUpdatedAsync(
204var completedSolution = await GetFormattedSolutionAsync(
216Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol,
234var unformattedSolution = documentWithInterface.Project.Solution;
237var unformattedSolutionWithUpdatedType = await GetSolutionWithOriginalTypeUpdatedAsync(
243var completedSolution = await GetFormattedSolutionAsync(
277private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken)
282var formattedSolution = unformattedSolution;
307private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync(
308Solution solution,
325var unformattedSolution = solution;
352var updatedUnformattedSolution = await UpdateMembersWithExplicitImplementationsAsync(
FindUsages\DefinitionItemFactory.cs (9)
31Solution solution,
37Solution solution,
45Solution solution,
64Solution solution,
78Solution solution,
97Solution solution,
154internal static AssemblyLocation GetMetadataLocation(IAssemblySymbol assembly, Solution solution, out ProjectId originatingProjectId)
164internal static ImmutableArray<AssemblyLocation> GetMetadataLocations(ISymbol definition, Solution solution, out ProjectId? originatingProjectId)
224private static ImmutableArray<DocumentSpan> GetSourceLocations(ISymbol definition, ImmutableArray<Location> locations, Solution solution, bool includeHiddenLocations)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (11)
58var solution = project.Solution;
282Solution solution,
342Solution solution,
400Solution solution,
439Solution solution,
465Solution solution,
506Solution solution,
557Solution solution,
625Solution solution,
679Solution solution,
714private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (10)
68var fixedSolution = await RefactorAndMoveAsync(
120var solutionWithFixedReferences = await RefactorReferencesAsync(projectToLocations, newDoc.Project.Solution, newType, typeArgIndices, cancellationToken).ConfigureAwait(false);
133var movedSolution = await MembersPuller.PullMembersUpAsync(sourceDoc, pullMembersUpOptions, cancellationToken).ConfigureAwait(false);
159private static async Task<Solution> RefactorAndMoveAsync(
162Solution oldSolution,
195var solutionWithFixedReferences = await RefactorReferencesAsync(projectToLocations, oldSolution, newType, typeArgIndices, cancellationToken).ConfigureAwait(false);
216private static async Task<Solution> RefactorReferencesAsync(
218Solution solution,
224var updatedSolution = solution;
345Solution solution,
NavigateTo\NavigateToSearcher.cs (5)
46private readonly Solution _solution;
59Solution solution,
94Solution solution,
106Solution solution,
535public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
NavigationBar\AbstractNavigationBarItemService.cs (3)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan)
50Solution solution, ISymbol symbol, SyntaxTree tree,
91Solution solution, ISymbol symbol, SyntaxTree tree, ISymbolDeclarationService symbolDeclarationService)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (14)
151private static async Task<Solution> ReplaceMethodsWithPropertyAsync(
162var originalSolution = project.Solution;
180var updatedSolution = originalSolution;
188private static async Task<Solution> UpdateReferencesAsync(Solution updatedSolution, string propertyName, bool nameChanged, ILookup<Document, ReferenceLocation> getReferencesByDocument, ILookup<Document, ReferenceLocation> setReferencesByDocument, CancellationToken cancellationToken)
205private static async Task<Solution> UpdateReferencesInDocumentAsync(
208Solution updatedSolution,
311private static async Task<Solution> ReplaceGetMethodsAndRemoveSetMethodsAsync(
312Solution originalSolution,
313Solution updatedSolution,
339private static async Task<Solution> ReplaceGetMethodsAndRemoveSetMethodsAsync(
342Solution updatedSolution,
398Solution updatedSolution,
446Solution originalSolution,
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (12)
51private async Task<Solution> FixNodeAsync(
73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
77var solution = document.Project.Solution;
83var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false);
96private async Task<Solution> RemoveAsyncTokenAsync(
110var newSolution = newDocument.Project.Solution;
119private static async Task<Solution> RemoveAwaitFromCallersAsync(
154private static async Task<Solution> RemoveAwaitFromCallersAsync(
155Solution solution, ImmutableArray<ReferenceLocation> locations, CancellationToken cancellationToken)
157var currentSolution = solution;
170private static async Task<Solution> RemoveAwaitFromCallersAsync(
171Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (7)
22public abstract Solution UpgradeProject(Project project, string version);
44var solution = project.Solution;
76public Solution UpgradeAllProjects(Solution solution, string language, string version, CancellationToken cancellationToken)
78var currentSolution = solution;
127private ProjectOptionsChangeAction(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution)
132public static ProjectOptionsChangeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution)
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (12)
85var solution = context.Document.Project.Solution;
104private async Task<Solution> ProcessResultAsync(
105Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
117private async Task<Solution> ProcessResultWorkerAsync(
118Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
273var updatedSolution = currentSolution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot);
280private static async Task<Solution> UpdateReferencesAsync(
281Solution solution,
361Solution originalSolution,
362Solution currentSolution,
CodeActions\CodeAction.cs (32)
131static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction));
239Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
245Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
264Solution originalSolution, CancellationToken cancellationToken)
284var changedSolution = await GetChangedSolutionAsync(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false);
310var changedSolution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false);
332protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
344protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
361internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
363var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false);
402internal async Task<Solution?> GetChangedSolutionInternalAsync(
403Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
405var solution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false);
427Solution? originalSolution, IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken)
453protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken)
513/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>.
517/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param>
520public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey)
524/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>.
528/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param>
531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
534/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/>
536public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
540string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey, CodeActionPriority priority, CodeActionCleanup cleanup)
699private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution;
705Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
718Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
728Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
734protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
755protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
756=> SpecializedTasks.Null<Solution>();
CodeActions\CodeAction_Cleanup.cs (15)
75Solution originalSolution,
76Solution changedSolution)
88internal static async Task<Solution> PostProcessChangesAsync(
89Solution? originalSolution,
90Solution changedSolution,
110private static async Task<Solution> CleanSyntaxAndSemanticsAsync(
111Solution originalSolution,
112Solution changedSolution,
121var cleanedSolution = await RunCleanupPassesInOrderAsync(
153var cleanedSolution = await RunCleanupPassesInOrderAsync(
163private static async Task<Solution> RunCleanupPassesInOrderAsync(
164Solution solution,
173var currentSolution = solution;
179async Task<Solution> RunParallelCleanupPassAsync(
180Solution solution, Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> cleanupDocumentAsync)
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (4)
26Solution solution, string name, bool ignoreCase, SymbolFilter criteria, CancellationToken cancellationToken)
102Solution solution, string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
176Solution solution, string name, bool ignoreCase, SymbolFilter criteria, CancellationToken cancellationToken)
238Solution solution, string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
FindSymbols\FindReferences\DependentProjectsFinder.cs (8)
34Solution,
41Solution solution, ImmutableArray<ISymbol> symbols, IImmutableSet<Project> projects, CancellationToken cancellationToken)
74Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken)
105Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken)
135Solution solution,
163Solution solution,
193Solution solution, Project? sourceProject, HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, CancellationToken cancellationToken)
258Solution solution,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
22Solution solution,
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
21Solution solution,
FindSymbols\SymbolFinder_Declarations_CustomQueries.cs (3)
28public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, CancellationToken cancellationToken = default)
34public static async Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, Func<string, bool> predicate, SymbolFilter filter, CancellationToken cancellationToken = default)
44Solution solution, SearchQuery query, SymbolFilter filter, CancellationToken cancellationToken)
FindSymbols\SymbolFinder_Declarations_SourceDeclarations.cs (4)
20public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsAsync(Solution solution, string name, bool ignoreCase, CancellationToken cancellationToken = default)
27Solution solution, string name, bool ignoreCase, SymbolFilter filter, CancellationToken cancellationToken = default)
67public static Task<IEnumerable<ISymbol>> FindSourceDeclarationsWithPatternAsync(Solution solution, string pattern, CancellationToken cancellationToken = default)
78Solution solution, string pattern, SymbolFilter filter, CancellationToken cancellationToken = default)
FindSymbols\SymbolFinder_Hierarchy.cs (21)
27ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
37ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
76internal static bool IsOverride(Solution solution, ISymbol member, ISymbol symbol, bool allowLooseMatch)
93ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
102ISymbol symbol, Solution solution, CancellationToken cancellationToken)
115Solution solution,
203/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution,
213INamedTypeSymbol type, Solution solution, IImmutableSet<Project>? projects, CancellationToken cancellationToken)
220/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution,
231INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
243/// <inheritdoc cref="FindDerivedClassesArrayAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/>
246INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
267INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
279/// <inheritdoc cref="FindDerivedInterfacesAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/>
282INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
303INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
315/// <inheritdoc cref="FindImplementationsAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/>
318INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
332ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
351/// <inheritdoc cref="FindImplementationsAsync(ISymbol, Solution, IImmutableSet{Project}, CancellationToken)"/>
356ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
Remote\RemoteArguments.cs (6)
60Solution solution, ISymbol symbol, CancellationToken cancellationToken)
72ISymbol symbol, Solution solution, CancellationToken cancellationToken,
100Solution solution, CancellationToken cancellationToken)
173Solution solution, CancellationToken cancellationToken)
190Solution solution, CancellationToken cancellationToken)
235public static SerializableSymbolGroup Dehydrate(Solution solution, SymbolGroup group, CancellationToken cancellationToken)
Remote\RemoteHostClient.cs (10)
103Solution solution,
122Solution solution,
134/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, CancellationToken, ValueTask}, CancellationToken)"/>
161/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, CancellationToken, ValueTask}, CancellationToken)"/>
179Solution solution,
190Solution solution,
203/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, RemoteServiceCallbackId, CancellationToken, ValueTask}, object, CancellationToken)"/>
220/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, RemoteServiceCallbackId, CancellationToken, ValueTask}, object, CancellationToken)"/>
239Solution solution1,
240Solution solution2,
Rename\IRenameRewriterLanguageService.cs (4)
57Solution baseSolution,
58Solution newSolution,
124public abstract Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(string replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable<ISymbol> referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary<Location, Location> reverseMappedLocations, CancellationToken cancellationToken);
Rename\Renamer.cs (7)
38public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default)
41public static async Task<Solution> RenameSymbolAsync(
42Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default)
139internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CancellationToken cancellationToken)
143Solution solution,
185Solution solution,
Rename\Renamer.RenameDocumentActionSet.cs (11)
19/// document metadata will still be updated by calling <see cref="UpdateSolutionAsync(Solution, ImmutableArray{RenameDocumentAction}, CancellationToken)"/>
21/// To apply all actions use <see cref="UpdateSolutionAsync(Solution, CancellationToken)"/>, or use a subset
22/// of the actions by calling <see cref="UpdateSolutionAsync(Solution, ImmutableArray{RenameDocumentAction}, CancellationToken)"/>.
49/// contents rather than metadata. Document metadata will still not be updated unless <see cref="UpdateSolutionAsync(Solution, ImmutableArray{RenameDocumentAction}, CancellationToken)" />
55/// Same as calling <see cref="UpdateSolutionAsync(Solution, ImmutableArray{RenameDocumentAction}, CancellationToken)"/> with
58public Task<Solution> UpdateSolutionAsync(Solution solution, CancellationToken cancellationToken)
70/// immediately call <see cref="UpdateSolutionAsync(Solution, ImmutableArray{RenameDocumentAction}, CancellationToken)"/> without
73public async Task<Solution> UpdateSolutionAsync(Solution solution, ImmutableArray<RenameDocumentAction> actions, CancellationToken cancellationToken)
113private Document GetDocument(Solution solution)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (5)
32ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, bool considerSymbolReferences, CancellationToken cancellationToken)
137ISymbol symbol, Solution solution, CancellationToken cancellationToken)
162ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, CancellationToken cancellationToken)
246ISymbol referencedSymbol, ISymbol originalSymbol, ReferenceLocation location, Solution solution, CancellationToken cancellationToken)
327Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
133Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (16)
17public static IEnumerable<DocumentId> GetChangedDocuments(this Solution? newSolution, Solution oldSolution)
33public static TextDocument? GetTextDocument(this Solution solution, DocumentId? documentId)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
39public static Project GetRequiredProject(this Solution solution, ProjectId projectId)
50public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
77public static SourceGeneratedDocument GetRequiredSourceGeneratedDocumentForAlreadyGeneratedId(this Solution solution, DocumentId documentId)
90public static ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken)
93public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated, CancellationToken cancellationToken)
96public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default)
100public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId)
103public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId)
106public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
113public static Solution WithUpToDateSourceGeneratorDocuments(this Solution solution, IEnumerable<ProjectId> projectIds)
136public static TextDocument? GetTextDocumentForLocation(this Solution solution, Location location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (14)
66private readonly Func<Solution, DocumentId, bool> _documentAlreadyInWorkspace;
69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction;
85Func<Solution, DocumentId, bool> documentAlreadyInWorkspace,
88Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction,
565Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments,
567Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
580Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments,
582Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
Workspace\ProjectSystem\ProjectSystemProject.cs (8)
220private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false)
306Solution solution, ProjectId projectId)
335private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue)
783public static (Solution newSolution, ProjectUpdateState newProjectUpdateState) UpdateProjectAnalyzerReferences(
784Solution solution,
840var newSolution = solution.WithProjectAnalyzerReferences(project.Id, isolatedReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (14)
156var newSolution = w.CreateSolution(solutionInfo);
269public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation)
545Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")]
573var newSolution = solutionChanges.Solution
594Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")]
595private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectState projectWithMetadataReference, ProjectState candidateProjectToReference)
670var newSolution = solutionChanges.Solution.RemoveProjectReference(projectIdToRetarget, convertedReference.ProjectReference)
702Solution currentSolution,
832var newSolution = solution
872Func<Solution, ProjectId, ProjectUpdateState, TReference, TReference, (Solution newSolution, ProjectUpdateState newProjectUpdateState)> update,
878var initialSolution = solutionChanges.Solution;
893var newSolution = solutionChanges.Solution;
Workspace\Solution\Solution.cs (111)
37private readonly AsyncLazy<Solution> _cachedFrozenSolution;
43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = [];
47AsyncLazy<Solution>? cachedFrozenSolution = null)
163private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject;
164private static Project CreateProject(ProjectId projectId, Solution solution)
350private Solution WithCompilationState(SolutionCompilationState compilationState)
366public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language)
370public Solution AddProject(ProjectInfo projectInfo)
378internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos)
382public Solution RemoveProject(ProjectId projectId)
390internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds)
397public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName)
412public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath)
422public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath)
432public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info)
442public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace)
452internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm)
462public Solution WithProjectName(ProjectId projectId, string name)
477public Solution WithProjectFilePath(ProjectId projectId, string? filePath)
488public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options)
504public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options)
519internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
527internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation)
539internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers)
550internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers)
566public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds)
581internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes)
590internal Solution WithProjectInfo(ProjectInfo info)
604public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference)
620public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences)
650public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
681public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences)
702public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference)
717public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
744public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference)
766public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
782public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
797public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
831public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
860public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
873public Solution AddAnalyzerReference(AnalyzerReference analyzerReference)
885public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
909public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference)
925public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
939public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
957public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false)
976public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue)
996private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
1010public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null)
1035public Solution AddDocument(DocumentInfo documentInfo)
1039/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include
1042/// <returns>A new <see cref="Solution"/> with the documents added.</returns>
1043public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1050public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
1057public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1078public Solution AddAdditionalDocument(DocumentInfo documentInfo)
1081public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1088public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1133public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
1139public Solution RemoveDocument(DocumentId documentId)
1148public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds)
1154private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1160public Solution RemoveAdditionalDocument(DocumentId documentId)
1169public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
1175private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1181public Solution RemoveAnalyzerConfigDocument(DocumentId documentId)
1190public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
1196private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1202public Solution WithDocumentName(DocumentId documentId, string name)
1221public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders)
1236public Solution WithDocumentFilePath(DocumentId documentId, string? filePath)
1250public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1253internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue)
1273public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1294public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1315public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1336public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1357public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1378public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue)
1382internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue)
1398internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState)
1401internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates)
1412public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
1435public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1456public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1477public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1498internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken)
1502internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken)
1505private Solution ComputeFrozenSolution(CancellationToken cancellationToken)
1513var frozenSolution = new Solution(
1528internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken)
1532AsyncLazy<Solution> GetLazySolution()
1547static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId)
1552static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken)
1555var solution = new Solution(newCompilationState);
1566internal async Task<Solution> WithMergedLinkedFileChangesAsync(
1567Solution oldSolution,
1590internal Solution WithNewWorkspaceFrom(Solution oldSolution)
1598public Solution GetIsolatedSolution()
1607public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1637var newSolution = WithCompilationState(newCompilationState);
1646internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents)
1650internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap)
1657internal Solution WithoutFrozenSourceGeneratedDocuments()
1668internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
1675public SolutionChanges GetChanges(Solution oldSolution)
1686/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a
1703/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/>
1724public Solution WithOptions(OptionSet options)
1737internal Solution WithOptions(SolutionOptionSet options)
Workspace\Workspace.cs (146)
35/// workspace's <see cref="TryApplyChanges(Solution)"/> method.
56private Solution _latestSolution;
60/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>.
127protected internal Solution CreateSolution(SolutionInfo solutionInfo)
136private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions)
142protected internal Solution CreateSolution(SolutionId id)
152/// after <see cref="TryApplyChanges(Solution)"/> is called.
154public Solution CurrentSolution
169protected Solution SetCurrentSolution(Solution solution)
181private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution)
188var oldSolution = this.CurrentSolution;
200/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/>
202Func<Solution, Solution> transformation,
206Action<Solution, Solution>? onBeforeUpdate = null,
207Action<Solution, Solution>? onAfterUpdate = null)
230internal (bool updated, Solution newSolution) SetCurrentSolution(
231Func<Solution, Solution> transformation,
232Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
233Action<Solution, Solution>? onBeforeUpdate = null,
234Action<Solution, Solution>? onAfterUpdate = null)
249internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync(
251Func<Solution, Solution> transformation,
252Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
253Action<Solution, Solution>? onBeforeUpdate,
254Action<Solution, Solution>? onAfterUpdate,
262var newSolution = data.transformation(oldSolution);
288static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution)
328static Solution UpdateAddedDocumentToExistingContentsInSolution(
329Solution solution, ArrayBuilder<DocumentId> addedDocumentIds)
369static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
407/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language.
409/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>.
416/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/>
417/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>.
419private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution)
469/// name="transformation"/> as it may its <see cref="Solution.SolutionStateContentVersion"/> updated
474/// name="transformation"/> as it may have its <see cref="Solution.SolutionStateContentVersion"/> updated
476private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>(
478Func<Solution, TData, Solution> transformation,
480Action<Solution, Solution, TData>? onBeforeUpdate = null,
481Action<Solution, Solution, TData>? onAfterUpdate = null)
497/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/>
498private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>(
501Func<Solution, TData, Solution> transformation,
503Action<Solution, Solution, TData>? onBeforeUpdate,
504Action<Solution, Solution, TData>? onAfterUpdate,
511var oldSolution = Volatile.Read(ref _latestSolution);
523var newSolution = transformation(oldSolution, data);
561/// Gets or sets the set of all global options and <see cref="Solution.Options"/>.
562/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>.
772private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects)
784private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project)
800var newSolution = this.CreateSolution(solutionInfo);
816var newSolution = this.CreateSolution(reloadedSolutionInfo);
1046/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment.
1139var newSolution = oldSolution;
1283Func<Solution, DocumentId, TextDocument?> getDocumentInSolution,
1284Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText,
1319var newSolution = oldSolution;
1320var previousSolution = newSolution;
1474static Solution UpdateReferencesAfterAdd(Solution solution)
1531/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method.
1553public virtual bool TryApplyChanges(Solution newSolution)
1556internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker)
1567var oldSolution = this.CurrentSolution;
1588var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result;
1856/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed.
1863/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1864/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1869/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed.
1876/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1877/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1882/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project
2085/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution.
2096/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution.
2107/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options.
2125/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options.
2142/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project.
2153/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project.
2164/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project.
2175/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project.
2186/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project.
2197/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project.
2208/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution.
2219/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution.
2230/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project.
2241/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project.
2274/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project.
2285/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project.
2307/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project.
2318/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
2348private static void CheckSolutionIsEmpty(Solution solution)
2362private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId)
2378private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId)
2475internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2486internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2500private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId)
2516private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId)
2532private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId)
2561private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId)
2577private static void CheckAnalyzerConfigDocumentIsNotInSolution(Solution solution, DocumentId documentId)
Workspace\Workspace_Editor.cs (15)
555Action<Solution, DocumentId> checkTextDocumentIsInSolution,
556Func<Solution, DocumentId, SourceText, PreservationMode, Solution> withDocumentText,
557Func<Solution, DocumentId, TextAndVersion, PreservationMode, Solution> withDocumentTextAndVersion,
749Action<Solution, DocumentId> checkTextDocumentIsInSolution,
750Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader)
850private SourceText GetOpenDocumentText(Solution solution, DocumentId documentId)
863protected virtual Solution AdjustReloadedSolution(Solution oldSolution, Solution reloadedSolution)
865var newSolution = reloadedSolution;
882var oldSolution = oldProject.Solution;
883var newSolution = reloadedProject.Solution;
CodeLens\RemoteCodeLensReferencesService.cs (7)
36public ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
42public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults,
67public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
88public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
113public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
139Solution solution, ImmutableArray<ReferenceLocationDescriptor> descriptors, CancellationToken cancellationToken)
277private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
Preview\PreviewEngine.cs (8)
29private readonly Solution _newSolution;
30private readonly Solution _oldSolution;
42public Solution FinalSolution { get; private set; }
45public PreviewEngine(string title, string helpString, string description, string topLevelItemName, Glyph topLevelGlyph, Solution newSolution, Solution oldSolution, IComponentModel componentModel, bool showCheckBoxes = true)
56Solution newSolution,
57Solution oldSolution,
214var updatedSolution = _topLevelChange.GetUpdatedSolution(applyingChanges: false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
133Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
133Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;