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)
172var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution);
192internal async Task TrackActiveSpansAsync(Solution solution)
315public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
356var solution = document.Project.Solution;
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (9)
86var solutionWithOriginalName = await CreateSolutionWithOriginalNameAsync(
93var renamedSolution = await Renamer.RenameSymbolAsync(solutionWithOriginalName, symbol, options, newName, cancellationToken).ConfigureAwait(false);
154var finalSolution = workspace.CurrentSolution;
182private async Task<Solution> CreateSolutionWithOriginalNameAsync(
198var solution = document.Project.Solution;
199var finalSolution = solution.WithDocumentTexts(
205private async Task<ISymbol> TryGetSymbolAsync(Solution solutionWithOriginalName, DocumentId documentId, CancellationToken cancellationToken)
223private (NotificationSeverity, string)? TryUpdateWorkspaceForResetOfTypedIdentifier(Workspace workspace, Solution newSolution, int trackingSessionId)
256Solution newSolution,
CodeLens\CodeLensReferencesService.cs (8)
42private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
84public async ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
89public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken)
101private static async Task<ReferenceLocationDescriptor> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken)
202public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
245private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
259public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
275public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensReferencesService.cs (5)
14ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken);
23Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken);
28Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
33Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
38Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (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)
EditAndContinue\IEditAndContinueService.cs (4)
22ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
26void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects);
28ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken);
32ValueTask<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)
217private void EnqueueSolutionChangedEvent(Solution oldSolution, Solution newSolution)
242private void EnqueueFullSolutionEvent(Solution solution, UnitTestingInvocationReasons invocationReasons)
254private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId)
266private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons)
272private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons)
282private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId)
544public string GetLanguagesStringForTelemetry(Solution solution)
590public int GetDocumentCount(Solution solution)
633public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution)
ExtractInterface\AbstractExtractInterfaceService.cs (12)
35protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync(
36Solution unformattedSolution,
138var solution = refactoringResult.DocumentToExtractFrom.Project.Solution;
174Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol,
216Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol,
277private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken)
282var formattedSolution = unformattedSolution;
307private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync(
308Solution solution,
325var unformattedSolution = solution;
352var updatedUnformattedSolution = await UpdateMembersWithExplicitImplementationsAsync(
FindUsages\DefinitionItemFactory.cs (9)
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,
439Solution solution,
465Solution solution,
506Solution solution,
557Solution solution,
625Solution solution,
679Solution solution,
714private 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)
127static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction));
235Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
241Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
260Solution originalSolution, CancellationToken cancellationToken)
280var changedSolution = await GetChangedSolutionAsync(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false);
306var changedSolution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false);
328protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
340protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
357internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
359var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false);
398internal async Task<Solution?> GetChangedSolutionInternalAsync(
399Solution originalSolution, IProgress<CodeAnalysisProgress> progress, bool postProcessChanges = true, CancellationToken cancellationToken = default)
401var solution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false);
425Solution? originalSolution, IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken)
450protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken)
454private static async Task<Solution> PostProcessChangesAsync(
455Solution? originalSolution,
456Solution changedSolution,
524/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>.
528/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param>
531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey)
535/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>.
539/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param>
542public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
545/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/>
547public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default)
706private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution;
710Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
721Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
730Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution,
735protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
756protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
757=> 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)
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)
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)
38public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default)
41public static async Task<Solution> RenameSymbolAsync(
42Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default)
139internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CancellationToken cancellationToken)
143Solution solution,
188Solution 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 (14)
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)
76public static SourceGeneratedDocument GetRequiredSourceGeneratedDocumentForAlreadyGeneratedId(this Solution solution, DocumentId documentId)
89public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default)
92public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default)
96public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId)
99public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId)
102public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
109public 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)
233private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false)
319Solution solution, ProjectId projectId)
348private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue)
793public static (Solution newSolution, ProjectUpdateState newProjectUpdateState) UpdateProjectAnalyzerReferences(
794Solution solution,
850var newSolution = solution.WithProjectAnalyzerReferences(project.Id, isolatedReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (10)
155var newSolution = w.CreateSolution(solutionInfo);
268public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation)
544Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")]
587Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")]
588private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectId projectIdWithMetadataReference, ProjectId referencedProjectId)
703Solution currentSolution,
833var newSolution = solution
873Func<Solution, ProjectId, ProjectUpdateState, TReference, TReference, (Solution newSolution, ProjectUpdateState newProjectUpdateState)> update,
Workspace\Solution\Solution.cs (110)
38private readonly AsyncLazy<Solution> _cachedFrozenSolution;
44private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = [];
48AsyncLazy<Solution>? cachedFrozenSolution = null)
164private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject;
165private static Project CreateProject(ProjectId projectId, Solution solution)
351private Solution WithCompilationState(SolutionCompilationState compilationState)
367public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language)
371public Solution AddProject(ProjectInfo projectInfo)
379internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos)
383public Solution RemoveProject(ProjectId projectId)
391internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds)
398public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName)
413public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath)
423public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath)
433public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info)
443public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace)
453internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm)
463public Solution WithProjectName(ProjectId projectId, string name)
478public Solution WithProjectFilePath(ProjectId projectId, string? filePath)
489public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options)
505public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options)
520internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
528internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation)
540internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers)
551internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers)
567public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds)
582internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes)
591internal Solution WithProjectInfo(ProjectInfo info)
605public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference)
621public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences)
651public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
682public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences)
703public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference)
718public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
745public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference)
767public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
783public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
798public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
832public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
861public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
874public Solution AddAnalyzerReference(AnalyzerReference analyzerReference)
886public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
910public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference)
926public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
940public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
958public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false)
977public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue)
995private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
1009public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null)
1034public Solution AddDocument(DocumentInfo documentInfo)
1038/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include
1041/// <returns>A new <see cref="Solution"/> with the documents added.</returns>
1042public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1049public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
1056public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1077public Solution AddAdditionalDocument(DocumentInfo documentInfo)
1080public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1087public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1132public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
1138public Solution RemoveDocument(DocumentId documentId)
1147public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds)
1153private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1159public Solution RemoveAdditionalDocument(DocumentId documentId)
1168public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
1174private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1180public Solution RemoveAnalyzerConfigDocument(DocumentId documentId)
1189public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
1195private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1201public Solution WithDocumentName(DocumentId documentId, string name)
1220public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders)
1235public Solution WithDocumentFilePath(DocumentId documentId, string? filePath)
1249public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1252internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue)
1272public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1293public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1314public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1335public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1356public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1377public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue)
1381internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue)
1397internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState)
1400internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates)
1411public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
1434public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1455public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1476public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1497internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken)
1501internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken)
1504private Solution ComputeFrozenSolution(CancellationToken cancellationToken)
1512var frozenSolution = new Solution(
1527internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken)
1531AsyncLazy<Solution> GetLazySolution()
1546static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId)
1551static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken)
1554var solution = new Solution(newCompilationState);
1565internal async Task<Solution> WithMergedLinkedFileChangesAsync(
1566Solution oldSolution,
1589internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services)
1597public Solution GetIsolatedSolution()
1606public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1636var newSolution = WithCompilationState(newCompilationState);
1645internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents)
1649internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap)
1656internal Solution WithoutFrozenSourceGeneratedDocuments()
1667internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
1674public SolutionChanges GetChanges(Solution oldSolution)
1685/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a
1702/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/>
1723public Solution WithOptions(OptionSet options)
1736internal Solution WithOptions(SolutionOptionSet options)
Workspace\Workspace.cs (145)
35/// workspace's <see cref="TryApplyChanges(Solution)"/> method.
56private Solution _latestSolution;
60/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>.
127protected internal Solution CreateSolution(SolutionInfo solutionInfo)
136private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions)
142protected internal Solution CreateSolution(SolutionId id)
152/// after <see cref="TryApplyChanges(Solution)"/> is called.
154public Solution CurrentSolution
169protected Solution SetCurrentSolution(Solution solution)
181private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution)
188var oldSolution = this.CurrentSolution;
200/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/>
202Func<Solution, Solution> transformation,
206Action<Solution, Solution>? onBeforeUpdate = null,
207Action<Solution, Solution>? onAfterUpdate = null)
230internal (bool updated, Solution newSolution) SetCurrentSolution(
231Func<Solution, Solution> transformation,
232Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
233Action<Solution, Solution>? onBeforeUpdate = null,
234Action<Solution, Solution>? onAfterUpdate = null)
249internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync(
251Func<Solution, Solution> transformation,
252Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
253Action<Solution, Solution>? onBeforeUpdate,
254Action<Solution, Solution>? onAfterUpdate,
262var newSolution = data.transformation(oldSolution);
288static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution)
328static Solution UpdateAddedDocumentToExistingContentsInSolution(
329Solution solution, ArrayBuilder<DocumentId> addedDocumentIds)
369static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
404/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language.
406/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>.
413/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/>
414/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>.
416private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution)
466/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
471/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
473private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>(
475Func<Solution, TData, Solution> transformation,
477Action<Solution, Solution, TData>? onBeforeUpdate = null,
478Action<Solution, Solution, TData>? onAfterUpdate = null)
494/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/>
495private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>(
498Func<Solution, TData, Solution> transformation,
500Action<Solution, Solution, TData>? onBeforeUpdate,
501Action<Solution, Solution, TData>? onAfterUpdate,
508var oldSolution = Volatile.Read(ref _latestSolution);
520var newSolution = transformation(oldSolution, data);
558/// Gets or sets the set of all global options and <see cref="Solution.Options"/>.
559/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>.
769private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects)
781private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project)
797var newSolution = this.CreateSolution(solutionInfo);
813var newSolution = this.CreateSolution(reloadedSolutionInfo);
1043/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment.
1136var newSolution = oldSolution;
1280Func<Solution, DocumentId, TextDocument?> getDocumentInSolution,
1281Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText,
1316var newSolution = oldSolution;
1317var previousSolution = newSolution;
1471static Solution UpdateReferencesAfterAdd(Solution solution)
1528/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method.
1550public virtual bool TryApplyChanges(Solution newSolution)
1553internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker)
1587var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result;
1855/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed.
1862/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1863/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1868/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed.
1875/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1876/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1881/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project
2084/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution.
2095/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution.
2106/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options.
2124/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options.
2141/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project.
2152/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project.
2163/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project.
2174/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project.
2185/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project.
2196/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project.
2207/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution.
2218/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution.
2229/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project.
2240/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project.
2273/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project.
2284/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project.
2306/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project.
2317/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
2347private static void CheckSolutionIsEmpty(Solution solution)
2361private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId)
2377private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId)
2474internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2485internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2499private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId)
2515private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId)
2531private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId)
2560private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId)
2576private 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)
35public ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
41public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults,
66public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
87public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
112public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode,
138Solution solution, ImmutableArray<ReferenceLocationDescriptor> descriptors, CancellationToken cancellationToken)
252private 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)