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;
175public override async Task<Solution> ChangeNamespaceAsync(
194var solution = document.Project.Solution;
210var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false);
221var solutionAfterNamespaceChange = annotatedSolution;
268Solution solution,
310protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken)
347var solution = document.Project.Solution;
426private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync(
427Solution solution,
755private static async Task<Solution> RemoveUnnecessaryImportsAsync(
756Solution solution,
845private 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/// Note that for project case, this method returns diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution, ProjectId?, ImmutableHashSet{string}?, Func{DiagnosticAnalyzer, bool}?, bool, bool, CancellationToken)"/>
79Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
98Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
167this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
EditAndContinue\IEditAndContinueService.cs (3)
22ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, 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)
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)
202private void EnqueueSolutionChangedEvent(Solution oldSolution, Solution newSolution, string eventName)
229private void EnqueueFullSolutionEvent(Solution solution, UnitTestingInvocationReasons invocationReasons, string eventName)
243private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId, string eventName)
257private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons, string eventName)
263private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons, string eventName)
275private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId, string eventName)
544public string GetLanguagesStringForTelemetry(Solution solution)
590public int GetDocumentCount(Solution solution)
633public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution)
ExtractInterface\AbstractExtractInterfaceService.cs (12)
38protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync(
39Solution unformattedSolution,
139var solution = refactoringResult.DocumentToExtractFrom.Project.Solution;
175Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol,
217Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol,
283private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken)
288var formattedSolution = unformattedSolution;
313private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync(
314Solution solution,
331var unformattedSolution = solution;
358var 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,
399Solution solution,
437Solution solution,
462Solution solution,
501Solution solution,
549Solution solution,
619Solution solution,
677Solution solution,
712private 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)
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)
72Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken)
103Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken)
133Solution solution,
161Solution solution,
191Solution solution, Project? sourceProject, HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, CancellationToken cancellationToken)
256Solution solution,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
21Solution 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)
66internal static bool IsOverride(Solution solution, ISymbol member, ISymbol symbol)
81ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
90ISymbol symbol, Solution solution, CancellationToken cancellationToken)
103Solution solution,
191/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution,
201INamedTypeSymbol type, Solution solution, IImmutableSet<Project>? projects, CancellationToken cancellationToken)
208/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution,
219INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
231/// <inheritdoc cref="FindDerivedClassesArrayAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/>
234INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
255INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
267/// <inheritdoc cref="FindDerivedInterfacesAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/>
270INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
291INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
303/// <inheritdoc cref="FindImplementationsAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/>
306INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
320ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
339/// <inheritdoc cref="FindImplementationsAsync(ISymbol, Solution, IImmutableSet{Project}, CancellationToken)"/>
344ISymbol 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,
126public 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)
152private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject;
153private static Project CreateProject(ProjectId projectId, Solution solution)
339private Solution WithCompilationState(SolutionCompilationState compilationState)
355public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language)
359public Solution AddProject(ProjectInfo projectInfo)
367internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos)
371public Solution RemoveProject(ProjectId projectId)
379internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds)
386public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName)
401public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath)
411public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath)
421public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info)
431public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace)
441internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm)
451public Solution WithProjectName(ProjectId projectId, string name)
466public Solution WithProjectFilePath(ProjectId projectId, string? filePath)
477public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options)
493public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options)
508internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
516internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation)
528internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers)
539internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers)
555public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds)
570internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes)
579internal Solution WithProjectInfo(ProjectInfo info)
593public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference)
609public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences)
639public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
670public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences)
691public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference)
706public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
733public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference)
755public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
771public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
786public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
818public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
840public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
853public Solution AddAnalyzerReference(AnalyzerReference analyzerReference)
865public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
889public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference)
905public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
919public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
937public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false)
956public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue)
974private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
988public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null)
1013public Solution AddDocument(DocumentInfo documentInfo)
1017/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include
1020/// <returns>A new <see cref="Solution"/> with the documents added.</returns>
1021public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1028public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
1035public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1056public Solution AddAdditionalDocument(DocumentInfo documentInfo)
1059public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1066public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1111public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
1117public Solution RemoveDocument(DocumentId documentId)
1126public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds)
1132private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1138public Solution RemoveAdditionalDocument(DocumentId documentId)
1147public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
1153private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1159public Solution RemoveAnalyzerConfigDocument(DocumentId documentId)
1168public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
1174private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1180public Solution WithDocumentName(DocumentId documentId, string name)
1199public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders)
1214public Solution WithDocumentFilePath(DocumentId documentId, string? filePath)
1228public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1231internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue)
1251public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1272public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1293public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1314public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1335public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1356public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue)
1360internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue)
1376internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer)
1379internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer)
1386public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
1409public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1430public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1451public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1472internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken)
1476internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken)
1479private Solution ComputeFrozenSolution(CancellationToken cancellationToken)
1487var frozenSolution = new Solution(
1502internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken)
1506AsyncLazy<Solution> GetLazySolution()
1521static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId)
1526static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken)
1529var solution = new Solution(newCompilationState);
1540internal async Task<Solution> WithMergedLinkedFileChangesAsync(
1541Solution oldSolution,
1565internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services)
1573public Solution GetIsolatedSolution()
1582public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1611var newSolution = WithCompilationState(newCompilationState);
1620internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents)
1624internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap)
1631internal Solution WithoutFrozenSourceGeneratedDocuments()
1642internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
1649public SolutionChanges GetChanges(Solution oldSolution)
1660/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a
1677/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/>
1698public Solution WithOptions(OptionSet options)
1711internal Solution WithOptions(SolutionOptionSet options)
Workspace\Workspace.cs (147)
33/// workspace's <see cref="TryApplyChanges(Solution)"/> method.
48private Solution _latestSolution;
57/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>.
118protected internal Solution CreateSolution(SolutionInfo solutionInfo)
127private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions)
133protected internal Solution CreateSolution(SolutionId id)
143/// after <see cref="TryApplyChanges(Solution)"/> is called.
145public Solution CurrentSolution
160protected Solution SetCurrentSolution(Solution solution)
172private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution)
179var oldSolution = this.CurrentSolution;
191/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/>
193Func<Solution, Solution> transformation,
197Action<Solution, Solution>? onBeforeUpdate = null,
198Action<Solution, Solution>? onAfterUpdate = null)
221internal (bool updated, Solution newSolution) SetCurrentSolution(
222Func<Solution, Solution> transformation,
223Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
224Action<Solution, Solution>? onBeforeUpdate = null,
225Action<Solution, Solution>? onAfterUpdate = null)
240internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync(
242Func<Solution, Solution> transformation,
243Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
244Action<Solution, Solution>? onBeforeUpdate,
245Action<Solution, Solution>? onAfterUpdate,
253var newSolution = data.transformation(oldSolution);
279static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution)
319static Solution UpdateAddedDocumentToExistingContentsInSolution(
320Solution solution, ArrayBuilder<DocumentId> addedDocumentIds)
360static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
395/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language.
397/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>.
404/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/>
405/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>.
407private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution)
457/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
462/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
464private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>(
466Func<Solution, TData, Solution> transformation,
468Action<Solution, Solution, TData>? onBeforeUpdate = null,
469Action<Solution, Solution, TData>? onAfterUpdate = null)
485/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/>
486private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>(
489Func<Solution, TData, Solution> transformation,
491Action<Solution, Solution, TData>? onBeforeUpdate,
492Action<Solution, Solution, TData>? onAfterUpdate,
499var oldSolution = Volatile.Read(ref _latestSolution);
511var newSolution = transformation(oldSolution, data);
549/// Gets or sets the set of all global options and <see cref="Solution.Options"/>.
550/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>.
702private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects)
714private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project)
730var newSolution = this.CreateSolution(solutionInfo);
746var newSolution = this.CreateSolution(reloadedSolutionInfo);
976/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment.
1069var newSolution = oldSolution;
1213Func<Solution, DocumentId, TextDocument?> getDocumentInSolution,
1214Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText,
1249var newSolution = oldSolution;
1250var previousSolution = newSolution;
1404static Solution UpdateReferencesAfterAdd(Solution solution)
1461/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method.
1483public virtual bool TryApplyChanges(Solution newSolution)
1486internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker)
1520var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result;
1788/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed.
1795/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1796/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1801/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed.
1808/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1809/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1814/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project
1987private static void CheckNoChanges(Solution oldSolution, Solution newSolution)
2026/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution.
2037/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution.
2048/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options.
2066/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options.
2083/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project.
2094/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project.
2105/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project.
2116/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project.
2127/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project.
2138/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project.
2149/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution.
2160/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution.
2171/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project.
2182/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project.
2215/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project.
2226/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project.
2248/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project.
2259/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
2289private static void CheckSolutionIsEmpty(Solution solution)
2303private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId)
2319private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId)
2416internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2427internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2441private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId)
2457private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId)
2473private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId)
2502private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId)
2518private 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)