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\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
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)
170var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution);
190internal async Task TrackActiveSpansAsync(Solution solution)
313public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
354var 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 (19)
41public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken);
43public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
114public override async Task<Solution?> TryChangeTopLevelNamespacesAsync(
134var solution = document.Project.Solution;
174public override async Task<Solution> ChangeNamespaceAsync(
193var solution = document.Project.Solution;
209var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false);
220var solutionAfterNamespaceChange = annotatedSolution;
267Solution solution,
309protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken)
346var solution = document.Project.Solution;
425private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync(
426Solution solution,
758private static async Task<Solution> RemoveUnnecessaryImportsAsync(
759Solution solution,
848private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
Diagnostics\ICodeAnalysisDiagnosticAnalyzerService.cs (4)
23Task RunAnalysisAsync(Solution solution, ProjectId? projectId, Action<Project> onAfterProjectAnalyzed, CancellationToken cancellationToken);
26/// Returns true if <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> was invoked
36/// <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> invocation on the containing project or solution.
46/// <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> invocation on the given project or solution.
Diagnostics\IDiagnosticAnalyzerService.cs (4)
58/// diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution,
78Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
96Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
154this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
EditAndContinue\IEditAndContinueService.cs (4)
23ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, IImmutableSet<ProjectId> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
27void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects);
29ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken);
33ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EncapsulateField\AbstractEncapsulateFieldService.cs (14)
109public async Task<Solution> EncapsulateFieldsAsync(
117var solution = document.Project.Solution;
140private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken)
145var currentSolution = document.Project.Solution;
156var nextSolution = await EncapsulateFieldAsync(document, currentField, updateReferences, cancellationToken).ConfigureAwait(false);
166private async Task<Solution?> EncapsulateFieldAsync(
181var solution = document.Project.Solution;
192var solutionNeedingProperty = await UpdateReferencesAsync(
229private async Task<Solution> UpdateReferencesAsync(
230bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken)
274private static async Task<Solution> RenameAsync(
275Solution solution,
310private ISet<(DocumentId documentId, TextSpan span)> GetConstructorLocations(Solution solution, INamedTypeSymbol containingType)
317Solution destinationSolution,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (12)
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)
550public string GetLanguagesStringForTelemetry(Solution solution)
596public int GetDocumentCount(Solution solution)
639public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution)
ExtractInterface\AbstractExtractInterfaceService.cs (12)
37protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync(
38Solution unformattedSolution,
140var solution = refactoringResult.DocumentToExtractFrom.Project.Solution;
176Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol,
218Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol,
280private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken)
285var formattedSolution = unformattedSolution;
310private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync(
311Solution solution,
328var unformattedSolution = solution;
355var updatedUnformattedSolution = await UpdateMembersWithExplicitImplementationsAsync(
FindUsages\DefinitionItemFactory.cs (9)
30Solution solution,
36Solution solution,
44Solution solution,
63Solution solution,
77Solution solution,
96Solution solution,
153internal static AssemblyLocation GetMetadataLocation(IAssemblySymbol assembly, Solution solution, out ProjectId originatingProjectId)
163internal static ImmutableArray<AssemblyLocation> GetMetadataLocations(ISymbol definition, Solution solution, out ProjectId? originatingProjectId)
223private 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,
437Solution solution,
462Solution solution,
501Solution solution,
549Solution solution,
617Solution solution,
671Solution solution,
706private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
NavigateTo\NavigateToSearcher.cs (5)
45private readonly Solution _solution;
58Solution solution,
93Solution solution,
105Solution solution,
534public 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)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (12)
69var solution = context.Document.Project.Solution;
88private async Task<Solution> ProcessResultAsync(
89Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
101private async Task<Solution> ProcessResultWorkerAsync(
102Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
283var updatedSolution = currentSolution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot);
292Solution originalSolution,
293Solution currentSolution,
355Solution solution,
408Solution solution,
CodeActions\CodeAction.cs (34)
128static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction));
236Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
242Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
261Solution originalSolution, CancellationToken cancellationToken)
281var changedSolution = await GetChangedSolutionAsync(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false);
307var changedSolution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false);
329protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
341protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
358internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
360var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false);
399internal async Task<Solution?> GetChangedSolutionInternalAsync(
400Solution originalSolution, IProgress<CodeAnalysisProgress> progress, bool postProcessChanges = true, CancellationToken cancellationToken = default)
402var solution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false);
426Solution? originalSolution, IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken)
451protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken)
455private static async Task<Solution> PostProcessChangesAsync(
456Solution? originalSolution,
457Solution changedSolution,
525/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>.
529/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param>
532public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey)
536/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>.
540/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param>
543public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
546/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/>
548public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
695private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution;
699Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
710Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
719Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
724protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
745protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
746=> SpecializedTasks.Null<Solution>();
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\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)
40public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default)
43public static async Task<Solution> RenameSymbolAsync(
44Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default)
141internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CancellationToken cancellationToken)
145Solution solution,
190Solution 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)
31ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, bool considerSymbolReferences, CancellationToken cancellationToken)
136ISymbol symbol, Solution solution, CancellationToken cancellationToken)
161ISymbol referencedSymbol, ISymbol originalSymbol, Solution solution, CancellationToken cancellationToken)
244internal static async Task<IEnumerable<RenameLocation>> GetRenamableReferenceLocationsAsync(ISymbol referencedSymbol, ISymbol originalSymbol, ReferenceLocation location, Solution solution, CancellationToken cancellationToken)
321Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (13)
16public static IEnumerable<DocumentId> GetChangedDocuments(this Solution? newSolution, Solution oldSolution)
32public static TextDocument? GetTextDocument(this Solution solution, DocumentId? documentId)
35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree)
38public static Project GetRequiredProject(this Solution solution, ProjectId projectId)
49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
66public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default)
69public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default)
73public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId)
76public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId)
79public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
86public static Solution WithUpToDateSourceGeneratorDocuments(this Solution solution, IEnumerable<ProjectId> projectIds)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (14)
66private readonly Func<Solution, DocumentId, bool> _documentAlreadyInWorkspace;
69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction;
73Func<Solution, DocumentId, bool> documentAlreadyInWorkspace,
76Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction,
541Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments,
543Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
556Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments,
558Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
Workspace\ProjectSystem\ProjectSystemProject.cs (8)
232private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false)
299Solution solution, ProjectId projectId)
328private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue)
765public static (Solution newSolution, ProjectUpdateState newProjectUpdateState) UpdateProjectAnalyzerReferences(
766Solution solution,
822var newSolution = solution.WithProjectAnalyzerReferences(project.Id, isolatedReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (10)
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.")]
588Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")]
589private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectId projectIdWithMetadataReference, ProjectId referencedProjectId)
697Solution currentSolution,
827var newSolution = solution
867Func<Solution, ProjectId, ProjectUpdateState, TReference, TReference, (Solution newSolution, ProjectUpdateState newProjectUpdateState)> update,
Workspace\Solution\Solution.cs (110)
37private readonly AsyncLazy<Solution> _cachedFrozenSolution;
43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = [];
47AsyncLazy<Solution>? cachedFrozenSolution = null)
153private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject;
154private static Project CreateProject(ProjectId projectId, Solution solution)
340private Solution WithCompilationState(SolutionCompilationState compilationState)
356public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language)
360public Solution AddProject(ProjectInfo projectInfo)
368internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos)
372public Solution RemoveProject(ProjectId projectId)
380internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds)
387public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName)
402public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath)
412public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath)
422public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info)
432public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace)
442internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm)
452public Solution WithProjectName(ProjectId projectId, string name)
467public Solution WithProjectFilePath(ProjectId projectId, string? filePath)
478public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options)
494public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options)
509internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
517internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation)
529internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers)
540internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers)
556public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds)
571internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes)
580internal Solution WithProjectInfo(ProjectInfo info)
594public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference)
610public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences)
640public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
671public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences)
692public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference)
707public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
734public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference)
756public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
772public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
787public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
821public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
850public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
863public Solution AddAnalyzerReference(AnalyzerReference analyzerReference)
875public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
899public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference)
915public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
929public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
947public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false)
966public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue)
984private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
998public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null)
1023public Solution AddDocument(DocumentInfo documentInfo)
1027/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include
1030/// <returns>A new <see cref="Solution"/> with the documents added.</returns>
1031public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1038public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
1045public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1066public Solution AddAdditionalDocument(DocumentInfo documentInfo)
1069public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1076public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1121public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
1127public Solution RemoveDocument(DocumentId documentId)
1136public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds)
1142private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1148public Solution RemoveAdditionalDocument(DocumentId documentId)
1157public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
1163private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1169public Solution RemoveAnalyzerConfigDocument(DocumentId documentId)
1178public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
1184private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1190public Solution WithDocumentName(DocumentId documentId, string name)
1209public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders)
1224public Solution WithDocumentFilePath(DocumentId documentId, string? filePath)
1238public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1241internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue)
1261public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1282public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1303public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1324public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1345public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1366public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue)
1370internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue)
1386internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer)
1389internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer)
1396public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
1419public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1440public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1461public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1482internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken)
1486internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken)
1489private Solution ComputeFrozenSolution(CancellationToken cancellationToken)
1497var frozenSolution = new Solution(
1512internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken)
1516AsyncLazy<Solution> GetLazySolution()
1531static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId)
1536static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken)
1539var solution = new Solution(newCompilationState);
1550internal async Task<Solution> WithMergedLinkedFileChangesAsync(
1551Solution oldSolution,
1574internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services)
1582public Solution GetIsolatedSolution()
1591public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1620var newSolution = WithCompilationState(newCompilationState);
1629internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents)
1633internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap)
1640internal Solution WithoutFrozenSourceGeneratedDocuments()
1651internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
1658public SolutionChanges GetChanges(Solution oldSolution)
1669/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a
1686/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/>
1707public Solution WithOptions(OptionSet options)
1720internal Solution WithOptions(SolutionOptionSet options)
Workspace\Workspace.cs (145)
33/// workspace's <see cref="TryApplyChanges(Solution)"/> method.
54private Solution _latestSolution;
61/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>.
128protected internal Solution CreateSolution(SolutionInfo solutionInfo)
137private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions)
143protected internal Solution CreateSolution(SolutionId id)
153/// after <see cref="TryApplyChanges(Solution)"/> is called.
155public Solution CurrentSolution
170protected Solution SetCurrentSolution(Solution solution)
182private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution)
189var oldSolution = this.CurrentSolution;
201/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/>
203Func<Solution, Solution> transformation,
207Action<Solution, Solution>? onBeforeUpdate = null,
208Action<Solution, Solution>? onAfterUpdate = null)
231internal (bool updated, Solution newSolution) SetCurrentSolution(
232Func<Solution, Solution> transformation,
233Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
234Action<Solution, Solution>? onBeforeUpdate = null,
235Action<Solution, Solution>? onAfterUpdate = null)
250internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync(
252Func<Solution, Solution> transformation,
253Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
254Action<Solution, Solution>? onBeforeUpdate,
255Action<Solution, Solution>? onAfterUpdate,
263var newSolution = data.transformation(oldSolution);
289static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution)
329static Solution UpdateAddedDocumentToExistingContentsInSolution(
330Solution solution, ArrayBuilder<DocumentId> addedDocumentIds)
370static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
405/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language.
407/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>.
414/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/>
415/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>.
417private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution)
467/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
472/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
474private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>(
476Func<Solution, TData, Solution> transformation,
478Action<Solution, Solution, TData>? onBeforeUpdate = null,
479Action<Solution, Solution, TData>? onAfterUpdate = null)
495/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/>
496private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>(
499Func<Solution, TData, Solution> transformation,
501Action<Solution, Solution, TData>? onBeforeUpdate,
502Action<Solution, Solution, TData>? onAfterUpdate,
509var oldSolution = Volatile.Read(ref _latestSolution);
521var newSolution = transformation(oldSolution, data);
559/// Gets or sets the set of all global options and <see cref="Solution.Options"/>.
560/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>.
744private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects)
756private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project)
772var newSolution = this.CreateSolution(solutionInfo);
788var newSolution = this.CreateSolution(reloadedSolutionInfo);
1018/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment.
1111var newSolution = oldSolution;
1255Func<Solution, DocumentId, TextDocument?> getDocumentInSolution,
1256Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText,
1291var newSolution = oldSolution;
1292var previousSolution = newSolution;
1446static Solution UpdateReferencesAfterAdd(Solution solution)
1503/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method.
1525public virtual bool TryApplyChanges(Solution newSolution)
1528internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker)
1562var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result;
1830/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed.
1837/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1838/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1843/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed.
1850/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1851/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1856/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project
2059/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution.
2070/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution.
2081/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options.
2099/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options.
2116/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project.
2127/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project.
2138/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project.
2149/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project.
2160/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project.
2171/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project.
2182/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution.
2193/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution.
2204/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project.
2215/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project.
2248/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project.
2259/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project.
2281/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project.
2292/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
2322private static void CheckSolutionIsEmpty(Solution solution)
2336private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId)
2352private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId)
2449internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2460internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2474private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId)
2490private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId)
2506private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId)
2535private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId)
2551private static void CheckAnalyzerConfigDocumentIsNotInSolution(Solution solution, DocumentId documentId)
Workspace\Workspace_Editor.cs (15)
554Action<Solution, DocumentId> checkTextDocumentIsInSolution,
555Func<Solution, DocumentId, SourceText, PreservationMode, Solution> withDocumentText,
556Func<Solution, DocumentId, TextAndVersion, PreservationMode, Solution> withDocumentTextAndVersion,
748Action<Solution, DocumentId> checkTextDocumentIsInSolution,
749Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader)
849private SourceText GetOpenDocumentText(Solution solution, DocumentId documentId)
862protected virtual Solution AdjustReloadedSolution(Solution oldSolution, Solution reloadedSolution)
864var newSolution = reloadedSolution;
881var oldSolution = oldProject.Solution;
882var 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)
253private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
Preview\PreviewEngine.cs (8)
28private readonly Solution _newSolution;
29private readonly Solution _oldSolution;
41public Solution FinalSolution { get; private set; }
44public PreviewEngine(string title, string helpString, string description, string topLevelItemName, Glyph topLevelGlyph, Solution newSolution, Solution oldSolution, IComponentModel componentModel, bool showCheckBoxes = true)
55Solution newSolution,
56Solution oldSolution,
213var updatedSolution = _topLevelChange.GetUpdatedSolution(applyingChanges: false);
Progression\GraphBuilder.cs (15)
43private readonly Solution _solution;
45public GraphBuilder(Solution solution)
51Solution solution, IEnumerable<GraphNode> inputNodes, CancellationToken cancellationToken)
256internal static async Task<GraphNode> GetOrCreateNodeAsync(Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken)
310private static async Task<GraphNode> GetOrCreateNodeForParameterAsync(Graph graph, IParameterSymbol parameterSymbol, Solution solution, CancellationToken cancellationToken)
323private static async Task<GraphNode> GetOrCreateNodeForLocalVariableAsync(Graph graph, ISymbol localSymbol, Solution solution, CancellationToken cancellationToken)
332private static async Task<GraphNode> GetOrCreateNodeAssemblyAsync(Graph graph, IAssemblySymbol assemblySymbol, Solution solution, CancellationToken cancellationToken)
341private static void UpdateLabelsForNode(ISymbol symbol, Solution solution, GraphNode node)
555private static async Task<GraphNode> GetOrCreateNodeForNamespaceAsync(Graph graph, INamespaceSymbol symbol, Solution solution, CancellationToken cancellationToken)
564private static async Task<GraphNode> GetOrCreateNodeForNamedTypeAsync(Graph graph, INamedTypeSymbol namedType, Solution solution, CancellationToken cancellationToken)
617private static async Task<GraphNode> GetOrCreateNodeForMethodAsync(Graph graph, IMethodSymbol method, Solution solution, CancellationToken cancellationToken)
635private static async Task<GraphNode> GetOrCreateNodeForFieldAsync(Graph graph, IFieldSymbol field, Solution solution, CancellationToken cancellationToken)
654private static async Task<GraphNode> GetOrCreateNodeForPropertyAsync(Graph graph, IPropertySymbol property, Solution solution, CancellationToken cancellationToken)
667private static async Task<GraphNode> GetOrCreateNodeForEventAsync(Graph graph, IEventSymbol eventSymbol, Solution solution, CancellationToken cancellationToken)
714public async Task<GraphNode?> CreateNodeAsync(Solution solution, INavigateToSearchResult result, CancellationToken cancellationToken)
Progression\GraphNodeIdCreation.cs (15)
36internal static async Task<GraphNodeId> GetIdForNamespaceAsync(INamespaceSymbol symbol, Solution solution, CancellationToken cancellationToken)
51internal static async Task<GraphNodeId> GetIdForTypeAsync(ITypeSymbol symbol, Solution solution, CancellationToken cancellationToken)
66private static async Task<IEnumerable<GraphNodeId>> GetPartialsForNamespaceAndTypeAsync(ITypeSymbol symbol, bool includeNamespace, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false)
121private static async Task<GraphNodeId> GetPartialForTypeAsync(ITypeSymbol symbol, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false)
153private static async Task<GraphNodeId> GetPartialForNamedTypeAsync(INamedTypeSymbol namedType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false)
212private static async Task<GraphNodeId> GetPartialForPointerTypeAsync(IPointerTypeSymbol pointerType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken)
236private static async Task<GraphNodeId> GetPartialForArrayTypeAsync(IArrayTypeSymbol arrayType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken)
257private static async Task<GraphNodeId> GetPartialForTypeParameterSymbolAsync(ITypeParameterSymbol typeParameterSymbol, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken)
288public static async Task<GraphNodeId> GetIdForMemberAsync(ISymbol member, Solution solution, CancellationToken cancellationToken)
392private static async Task<Uri> GetAssemblyFullPathAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken)
398private static async Task<Uri> GetAssemblyFullPathAsync(IAssemblySymbol containingAssembly, Solution solution, CancellationToken cancellationToken)
446internal static async Task<GraphNodeId> GetIdForAssemblyAsync(IAssemblySymbol assemblySymbol, Solution solution, CancellationToken cancellationToken)
459internal static async Task<GraphNodeId> GetIdForParameterAsync(IParameterSymbol symbol, Solution solution, CancellationToken cancellationToken)
487internal static async Task<GraphNodeId> GetIdForLocalVariableAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken)
517private static async Task<int> GetLocalVariableIndexAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken)