src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (12)
51private async Task<Solution> FixNodeAsync(
73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
77var solution = document.Project.Solution;
83var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false);
96private async Task<Solution> RemoveAsyncTokenAsync(
110var newSolution = newDocument.Project.Solution;
119private static async Task<Solution> RemoveAwaitFromCallersAsync(
154private static async Task<Solution> RemoveAwaitFromCallersAsync(
155Solution solution, ImmutableArray<ReferenceLocation> locations, CancellationToken cancellationToken)
157var currentSolution = solution;
170private static async Task<Solution> RemoveAwaitFromCallersAsync(
171Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
EditAndContinue\ActiveStatementTrackingService.cs (7)
55public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
69public void StartTracking(Solution solution, IActiveStatementSpanFactory spanProvider)
93public ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
170var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution);
190internal async Task TrackActiveSpansAsync(Solution solution)
313public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken)
354var solution = document.Project.Solution;
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (9)
86var solutionWithOriginalName = await CreateSolutionWithOriginalNameAsync(
93var renamedSolution = await Renamer.RenameSymbolAsync(solutionWithOriginalName, symbol, options, newName, cancellationToken).ConfigureAwait(false);
154var finalSolution = workspace.CurrentSolution;
182private async Task<Solution> CreateSolutionWithOriginalNameAsync(
198var solution = document.Project.Solution;
199var finalSolution = solution.WithDocumentTexts(
205private async Task<ISymbol> TryGetSymbolAsync(Solution solutionWithOriginalName, DocumentId documentId, CancellationToken cancellationToken)
223private (NotificationSeverity, string)? TryUpdateWorkspaceForResetOfTypedIdentifier(Workspace workspace, Solution newSolution, int trackingSessionId)
256Solution newSolution,
CodeLens\CodeLensReferencesService.cs (8)
42private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
84public async ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
89public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken)
101private static async Task<ReferenceLocationDescriptor> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken)
202public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
245private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
259public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken)
275public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensReferencesService.cs (5)
14ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken);
23Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken);
28Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
33Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
38Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (19)
41public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken);
43public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
114public override async Task<Solution?> TryChangeTopLevelNamespacesAsync(
134var solution = document.Project.Solution;
174public override async Task<Solution> ChangeNamespaceAsync(
193var solution = document.Project.Solution;
209var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false);
220var solutionAfterNamespaceChange = annotatedSolution;
267Solution solution,
309protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken)
346var solution = document.Project.Solution;
425private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync(
426Solution solution,
758private static async Task<Solution> RemoveUnnecessaryImportsAsync(
759Solution solution,
848private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
EditAndContinue\IEditAndContinueService.cs (4)
22ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, IImmutableSet<ProjectId> 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,
437Solution solution,
462Solution solution,
501Solution solution,
549Solution solution,
617Solution solution,
671Solution solution,
706private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
NavigateTo\NavigateToSearcher.cs (5)
45private readonly Solution _solution;
58Solution solution,
93Solution solution,
105Solution solution,
534public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
NavigationBar\AbstractNavigationBarItemService.cs (3)
44Solution solution, ISymbol symbol, SyntaxTree tree, Func<SyntaxReference, TextSpan> computeFullSpan)
50Solution solution, ISymbol symbol, SyntaxTree tree,
91Solution solution, ISymbol symbol, SyntaxTree tree, ISymbolDeclarationService symbolDeclarationService)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (14)
151private static async Task<Solution> ReplaceMethodsWithPropertyAsync(
162var originalSolution = project.Solution;
180var updatedSolution = originalSolution;
188private static async Task<Solution> UpdateReferencesAsync(Solution updatedSolution, string propertyName, bool nameChanged, ILookup<Document, ReferenceLocation> getReferencesByDocument, ILookup<Document, ReferenceLocation> setReferencesByDocument, CancellationToken cancellationToken)
205private static async Task<Solution> UpdateReferencesInDocumentAsync(
208Solution updatedSolution,
311private static async Task<Solution> ReplaceGetMethodsAndRemoveSetMethodsAsync(
312Solution originalSolution,
313Solution updatedSolution,
339private static async Task<Solution> ReplaceGetMethodsAndRemoveSetMethodsAsync(
342Solution updatedSolution,
398Solution updatedSolution,
446Solution originalSolution,
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (12)
51private async Task<Solution> FixNodeAsync(
73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
77var solution = document.Project.Solution;
83var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false);
96private async Task<Solution> RemoveAsyncTokenAsync(
110var newSolution = newDocument.Project.Solution;
119private static async Task<Solution> RemoveAwaitFromCallersAsync(
154private static async Task<Solution> RemoveAwaitFromCallersAsync(
155Solution solution, ImmutableArray<ReferenceLocation> locations, CancellationToken cancellationToken)
157var currentSolution = solution;
170private static async Task<Solution> RemoveAwaitFromCallersAsync(
171Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (7)
22public abstract Solution UpgradeProject(Project project, string version);
44var solution = project.Solution;
76public Solution UpgradeAllProjects(Solution solution, string language, string version, CancellationToken cancellationToken)
78var currentSolution = solution;
127private ProjectOptionsChangeAction(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution)
132public static ProjectOptionsChangeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (12)
69var solution = context.Document.Project.Solution;
88private async Task<Solution> ProcessResultAsync(
89Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
101private async Task<Solution> ProcessResultWorkerAsync(
102Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken)
283var updatedSolution = currentSolution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot);
292Solution originalSolution,
293Solution currentSolution,
355Solution solution,
408Solution solution,
CodeActions\CodeAction.cs (34)
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)
234private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false)
301Solution solution, ProjectId projectId)
330private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue)
767public static (Solution newSolution, ProjectUpdateState newProjectUpdateState) UpdateProjectAnalyzerReferences(
768Solution solution,
824var 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)
37private readonly AsyncLazy<Solution> _cachedFrozenSolution;
43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = [];
47AsyncLazy<Solution>? cachedFrozenSolution = null)
161private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject;
162private static Project CreateProject(ProjectId projectId, Solution solution)
348private Solution WithCompilationState(SolutionCompilationState compilationState)
364public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language)
368public Solution AddProject(ProjectInfo projectInfo)
376internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos)
380public Solution RemoveProject(ProjectId projectId)
388internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds)
395public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName)
410public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath)
420public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath)
430public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info)
440public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace)
450internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm)
460public Solution WithProjectName(ProjectId projectId, string name)
475public Solution WithProjectFilePath(ProjectId projectId, string? filePath)
486public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options)
502public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options)
517internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options)
525internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation)
537internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers)
548internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers)
564public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds)
579internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes)
588internal Solution WithProjectInfo(ProjectInfo info)
602public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference)
618public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences)
648public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference)
679public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences)
700public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference)
715public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
742public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference)
764public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences)
780public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
795public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
829public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference)
858public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences)
871public Solution AddAnalyzerReference(AnalyzerReference analyzerReference)
883public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
907public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference)
923public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
937public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
955public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false)
974public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue)
992private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
1006public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null)
1031public Solution AddDocument(DocumentInfo documentInfo)
1035/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include
1038/// <returns>A new <see cref="Solution"/> with the documents added.</returns>
1039public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1046public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null)
1053public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1074public Solution AddAdditionalDocument(DocumentInfo documentInfo)
1077public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1084public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null)
1129public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
1135public Solution RemoveDocument(DocumentId documentId)
1144public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds)
1150private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1156public Solution RemoveAdditionalDocument(DocumentId documentId)
1165public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
1171private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1177public Solution RemoveAnalyzerConfigDocument(DocumentId documentId)
1186public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
1192private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds)
1198public Solution WithDocumentName(DocumentId documentId, string name)
1217public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders)
1232public Solution WithDocumentFilePath(DocumentId documentId, string? filePath)
1246public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1249internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue)
1269public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1290public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1311public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1332public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1353public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
1374public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue)
1378internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue)
1394internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer)
1397internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer)
1404public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
1427public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1448public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1469public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
1490internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken)
1494internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken)
1497private Solution ComputeFrozenSolution(CancellationToken cancellationToken)
1505var frozenSolution = new Solution(
1520internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken)
1524AsyncLazy<Solution> GetLazySolution()
1539static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId)
1544static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken)
1547var solution = new Solution(newCompilationState);
1558internal async Task<Solution> WithMergedLinkedFileChangesAsync(
1559Solution oldSolution,
1582internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services)
1590public Solution GetIsolatedSolution()
1599public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue)
1629var newSolution = WithCompilationState(newCompilationState);
1638internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents)
1642internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap)
1649internal Solution WithoutFrozenSourceGeneratedDocuments()
1660internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState)
1667public SolutionChanges GetChanges(Solution oldSolution)
1678/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a
1695/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/>
1716public Solution WithOptions(OptionSet options)
1729internal Solution WithOptions(SolutionOptionSet options)
Workspace\Workspace.cs (145)
34/// workspace's <see cref="TryApplyChanges(Solution)"/> method.
55private Solution _latestSolution;
59/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>.
126protected internal Solution CreateSolution(SolutionInfo solutionInfo)
135private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions)
141protected internal Solution CreateSolution(SolutionId id)
151/// after <see cref="TryApplyChanges(Solution)"/> is called.
153public Solution CurrentSolution
168protected Solution SetCurrentSolution(Solution solution)
180private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution)
187var oldSolution = this.CurrentSolution;
199/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/>
201Func<Solution, Solution> transformation,
205Action<Solution, Solution>? onBeforeUpdate = null,
206Action<Solution, Solution>? onAfterUpdate = null)
229internal (bool updated, Solution newSolution) SetCurrentSolution(
230Func<Solution, Solution> transformation,
231Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
232Action<Solution, Solution>? onBeforeUpdate = null,
233Action<Solution, Solution>? onAfterUpdate = null)
248internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync(
250Func<Solution, Solution> transformation,
251Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind,
252Action<Solution, Solution>? onBeforeUpdate,
253Action<Solution, Solution>? onAfterUpdate,
261var newSolution = data.transformation(oldSolution);
287static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution)
327static Solution UpdateAddedDocumentToExistingContentsInSolution(
328Solution solution, ArrayBuilder<DocumentId> addedDocumentIds)
368static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
403/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language.
405/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>.
412/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/>
413/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>.
415private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution)
465/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
470/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated
472private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>(
474Func<Solution, TData, Solution> transformation,
476Action<Solution, Solution, TData>? onBeforeUpdate = null,
477Action<Solution, Solution, TData>? onAfterUpdate = null)
493/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/>
494private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>(
497Func<Solution, TData, Solution> transformation,
499Action<Solution, Solution, TData>? onBeforeUpdate,
500Action<Solution, Solution, TData>? onAfterUpdate,
507var oldSolution = Volatile.Read(ref _latestSolution);
519var newSolution = transformation(oldSolution, data);
557/// Gets or sets the set of all global options and <see cref="Solution.Options"/>.
558/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>.
742private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects)
754private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project)
770var newSolution = this.CreateSolution(solutionInfo);
786var newSolution = this.CreateSolution(reloadedSolutionInfo);
1016/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment.
1109var newSolution = oldSolution;
1253Func<Solution, DocumentId, TextDocument?> getDocumentInSolution,
1254Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText,
1289var newSolution = oldSolution;
1290var previousSolution = newSolution;
1444static Solution UpdateReferencesAfterAdd(Solution solution)
1501/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method.
1523public virtual bool TryApplyChanges(Solution newSolution)
1526internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker)
1560var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result;
1828/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed.
1835/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1836/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1841/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed.
1848/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1849/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param>
1854/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project
2057/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution.
2068/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution.
2079/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options.
2097/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options.
2114/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project.
2125/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project.
2136/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project.
2147/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project.
2158/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project.
2169/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project.
2180/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution.
2191/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution.
2202/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project.
2213/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project.
2246/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project.
2257/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project.
2279/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project.
2290/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
2320private static void CheckSolutionIsEmpty(Solution solution)
2334private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId)
2350private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId)
2447internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2458internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference)
2472private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId)
2488private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId)
2504private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId)
2533private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId)
2549private 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)