4 instantiations of Solution
Microsoft.CodeAnalysis.Workspaces (4)
Workspace\Solution\Solution.cs (3)
352=> compilationState == CompilationState ? this : new Solution(compilationState); 1514var frozenSolution = new Solution( 1556var solution = new Solution(newCompilationState);
Workspace\Workspace.cs (1)
137=> new(this, solutionInfo.Attributes, options, analyzerReferences, fallbackAnalyzerOptions);
3597 references to Solution
AnalyzerRunner (9)
CodeRefactoringRunner.cs (2)
52var solution = _workspace.CurrentSolution; 53var updatedSolution = solution;
DiagnosticAnalyzerRunner.cs (5)
40private static Solution SetOptions(Solution solution) 66var solution = _workspace.CurrentSolution; 80var solution = _workspace.CurrentSolution; 315Solution solution,
Program.cs (2)
136private static async Task ShowCompilerDiagnosticsAsync(Solution solution, CancellationToken cancellationToken) 174private static void ShowSolutionStatistics(Solution solution, CancellationToken cancellationToken)
GenerateDocumentationAndConfigFiles (30)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
IdeBenchmarks (3)
InheritanceMargin\BenchmarksHelpers.cs (1)
18Solution solution,
InheritanceMargin\InheritanceMarginServiceBenchmarks.cs (1)
23private Solution _solution;
SQLitePersistentStorageBenchmark.cs (1)
67var solution = _workspace.CurrentSolution;
IdeCoreBenchmarks (13)
ClassificationBenchmarks.cs (1)
31Solution _solution;
FindReferencesBenchmarks.cs (1)
29Solution _solution;
FormatterBenchmarks.cs (1)
48var solution = new AdhocWorkspace().CurrentSolution
IncrementalSourceGeneratorBenchmarks.cs (1)
81var solution = _workspace.OpenSolutionAsync(_solutionPath, progress: null, CancellationToken.None).Result;
NavigateToBenchmarks.cs (3)
82var solution = _workspace.OpenSolutionAsync(_solutionPath, progress: null, CancellationToken.None).Result; 213var solution = _workspace.CurrentSolution; 224private async Task<int> SearchAsync(Solution solution, IGrouping<INavigateToSearchService, Project> grouping, ImmutableArray<Document> priorityDocuments)
ProjectOperationBenchmarks.cs (4)
58var solution = _workspace.CurrentSolution; 63static Project CreateProject(ref Solution solution, string name, int documentCount) 107var solution = Project.Solution; 111var _ = solution.WithDocumentText(documentId, s_newText);
RenameBenchmarks.cs (1)
20private Solution _solution;
SwitchStatementBenchmarks.cs (1)
67var solution = workspace.CurrentSolution
Metrics (1)
Program.cs (1)
332var solution = await workspace.OpenSolutionAsync(solutionFile, cancellationToken: CancellationToken.None).ConfigureAwait(false);
Metrics.Legacy (1)
src\RoslynAnalyzers\Tools\Metrics\Program.cs (1)
332var solution = await workspace.OpenSolutionAsync(solutionFile, cancellationToken: CancellationToken.None).ConfigureAwait(false);
Microsoft.Analyzers.Extra (6)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (6)
263private static async Task<(Solution solution, ClassDeclarationSyntax declarationSyntax, Document document)> 321RemapAsync(Solution sol, DocumentId docId, ExpressionSyntax invocationExpression) 463private static async Task<Solution> RewriteLoggingCallAsync( 535private async Task<Solution> ApplyFixAsync(Document invocationDoc, ExpressionSyntax invocationExpression, FixDetails details, CancellationToken cancellationToken) 539Solution sol; 569private async Task<Solution> InsertLoggingMethodSignatureAsync(
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
362var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution; 456var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
363var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution; 457var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.AspNetCore.Analyzer.Testing (6)
CodeFixRunner.cs (2)
34var updatedSolution = await ApplyFixAsync(actions[codeFixIndex]); 61private static async Task<Solution> ApplyFixAsync(CodeAction codeAction)
DiagnosticProject.cs (3)
29private static readonly Dictionary<Assembly, Solution> _solutionCache = new Dictionary<Assembly, Solution>(); 33Solution solution;
DiagnosticVerifier.cs (1)
49protected Solution Solution { get; set; }
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
29var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Helpers\DiagnosticVerifier.Helper.cs (1)
151var solution = new AdhocWorkspace()
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
29var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Helpers\DiagnosticVerifier.Helper.cs (1)
151var solution = new AdhocWorkspace()
Microsoft.CodeAnalysis.Analyzers (46)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (3)
105private static Task<Solution> AddAnalyzerReleaseTrackingFilesAsync(Project project) 169private static async Task<Solution> AddEntryToUnshippedFileAsync(Project project, string entryToAdd, CancellationToken cancellationToken) 187private static async Task<Solution> UpdateEntryInUnshippedFileAsync(Project project, string ruleId, string entryToUpdate, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (8)
76private readonly Solution _solution; 78public FixAllAdditionalDocumentChangeAction(FixAllScope fixAllScope, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, string? equivalenceKey) 89protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 120Solution newSolution = _solution; 162private readonly Solution _solution; 164public FixAllAddAdditionalDocumentsAction(ImmutableArray<ProjectId> projectIds, Solution solution) 173protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 175var newSolution = _solution;
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
159private static async Task<Solution> ApplyFixAsync(Document document, SyntaxNode root, FixInfo fixInfo, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (4)
84private readonly Solution _solution; 86public FixAllAdditionalDocumentChangeAction(FixAllScope fixAllScope, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, string equivalenceKey) 97protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 125var newSolution = _solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Microsoft.CodeAnalysis.Analyzers.UnitTests (4)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzerTests.cs (2)
4673private static Solution WithoutEnableReleaseTrackingWarning(Solution solution, ProjectId projectId)
MetaAnalyzers\ReleaseTrackingAnalyzerTests.cs (2)
1024private static Solution DisableNonReleaseTrackingWarnings(Solution solution, ProjectId projectId)
Microsoft.CodeAnalysis.BannedApiAnalyzers (30)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests (2)
RestrictedInternalsVisibleToAnalyzerTests.cs (2)
127private static Solution ApplySolutionTransforms(Solution solution, ProjectId apiConsumerProjectId)
Microsoft.CodeAnalysis.CodeStyle.Fixes (83)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
346? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken)) 374private async Task<Solution> FixAsync(
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (7)
77public static async Task<Solution> AddParameterAsync<TExpressionSyntax>( 89var solution = invocationDocument.Project.Solution; 158async Task<Solution> AddConstructorAssignmentsAsync(Solution rewrittenSolution) 160var finalSolution = await TryAddConstructorAssignmentsAsync(rewrittenSolution).ConfigureAwait(false); 164async Task<Solution?> TryAddConstructorAssignmentsAsync(Solution rewrittenSolution)
src\Analyzers\Core\CodeFixes\AddParameter\CodeFixData.cs (4)
13Func<CancellationToken, Task<Solution>> createChangedSolutionNonCascading, 14Func<CancellationToken, Task<Solution>>? createChangedSolutionCascading) 25public Func<CancellationToken, Task<Solution>> CreateChangedSolutionNonCascading { get; } = createChangedSolutionNonCascading ?? throw new ArgumentNullException(nameof(createChangedSolutionNonCascading)); 30public Func<CancellationToken, Task<Solution>>? CreateChangedSolutionCascading { get; } = createChangedSolutionCascading;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
88var solution = _project.Solution; 126var solution = _project.Solution;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
42protected override Task<Solution?> GetChangedSolutionAsync(
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (5)
101private async Task<Solution> FixNodeAsync( 153private async Task<Solution> RenameThenAddAsyncTokenAsync( 163var solution = document.Project.Solution; 169var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false); 183private async Task<Solution> AddAsyncTokenAsync(
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\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 63var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (3)
65private static async Task<Solution> FixAllByDocumentAsync( 66Solution solution, 82var newSolution = solution;
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (4)
103private static async Task<Solution> FixAsync( 120private readonly Func<CancellationToken, Task<Solution>> _createChangedSolutionAsync; 137Func<CancellationToken, Task<Solution>> createChangedSolutionAsync, 155var newSolution = await _createChangedSolutionAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (2)
57private static async Task<Solution> UnsealDeclarationsAsync( 58Solution solution, ImmutableArray<SyntaxReference> declarationReferences, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (9)
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; 103private readonly Func<CancellationToken, Task<Solution>> _createChangedSolution; 105private ProjectOptionsChangeAction(string title, Func<CancellationToken, Task<Solution>> createChangedSolution) 111public static ProjectOptionsChangeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution) 117protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (3)
src\Features\DiagnosticsTestUtilities\CodeActions\SharedVerifierState.cs (3)
31private Func<Solution, ProjectId, Solution>? _remainingOptionsSolutionTransform; 43/// Gets a collection of options to apply to <see cref="Solution.Options"/> for testing. Values may be added
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (11)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
79private static async Task<Solution> ConvertToPositionalRecordAsync(
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
38private static Solution AllowUnsafeOnProject(Project project)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
87public override Solution UpgradeProject(Project project, string newVersion)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
95private static async Task<Solution> UsePrimaryConstructorAsync( 118var solution = document.Project.Solution;
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
61private static async Task<Solution> UseSystemThreadingLockAsync( 82var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
33public static async Task<Solution> AddAssignmentForPrimaryConstructorAsync( 40var solution = project.Solution; 101var solution = solutionEditor.OriginalSolution;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (2)
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (2)
44var oldSolution = appliedChanges.Item1; 45var newSolution = appliedChanges.Item2;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
189private static async Task<(Solution solution, TextSpan renameSpan)?> TryGetNewSolutionWithAddedMethodAsync( 223var newSolution = document.Project.Solution.WithDocumentText(formattedDocument.Id, newText);
GoToBase\CSharpGoToBaseService.cs (1)
27Solution solution, IMethodSymbol constructor, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (130)
CodeActions\AddUsing\AddUsingNuGetTests.cs (4)
225installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "1.0")).Returns([]); 226installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "2.0")).Returns([]); 312installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "1.0")).Returns([]); 349installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "1.0")).Returns([]);
CodeActions\ApplyChangesOperationTests.cs (24)
23=> new MyCodeRefactoringProvider((Func<Solution, Solution>)parameters.fixProviderData); 27private readonly Func<Solution, Solution> _changeSolution; 29public MyCodeRefactoringProvider(Func<Solution, Solution> changeSolution) 43private readonly Solution _changedSolution; 45public TestCodeAction(Solution changedSolution) 52protected override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 53=> Task.FromResult<Solution?>(_changedSolution); 209Func<Solution, Solution> codeActionTransform, 210Func<Solution, Solution> intermediaryTransform) 215Func<Solution, Solution> codeActionTransform, 216Func<Solution, Solution> intermediaryTransform) 221Func<Solution, Solution> codeActionTransform, 222Func<Solution, Solution> intermediaryTransform, 228var originalSolution = workspace.CurrentSolution; 243var changedSolution = intermediaryTransform(originalSolution);
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
889var modifiedSolution = await moveTypeService.GetModifiedSolutionAsync(documentToModify, textSpan, MoveTypeOperationKind.MoveTypeNamespaceScope, CancellationToken.None).ConfigureAwait(false);
CodeActions\Preview\ErrorCases\ExceptionInCodeAction.cs (1)
51protected override Task<Solution> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
CodeActions\PreviewTests.cs (2)
67protected override Task<Solution> GetChangedSolutionAsync( 70var solution = _oldDocument.Project.Solution;
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (10)
79var oldSolution = result.Item1; 80var newSolution = result.Item2; 105async Task<List<Tuple<Solution, Solution>>> TestOperationAsync( 110var results = new List<Tuple<Solution, Solution>>(); 161var oldSolution = oldAndNewSolution.Item1; 162var newSolution = oldAndNewSolution.Item2; 219async Task<Tuple<Solution, Solution>> TestOperationAsync(TestParameters parameters, EditorTestWorkspace workspace)
CodeGeneration\SyntaxGeneratorTests.cs (2)
35var solution = workspace.CurrentSolution; 69var solution = workspace.CurrentSolution;
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (3)
2588var solution = testWorkspace.CurrentSolution; 3014var solution = testWorkspace.CurrentSolution; 3072var solution = testWorkspace.CurrentSolution;
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
61var newSolution = workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])
EditAndContinue\ActiveStatementTrackingServiceTests.cs (1)
66var solution = workspace.CurrentSolution;
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (4)
53var solution = workspace.CurrentSolution; 56var newSolution1 = solution.WithAnalyzerConfigDocumentText(documentId, text, PreservationMode.PreserveIdentity); 347var solution = workspace.CurrentSolution; 351var newSolution = solution.WithAnalyzerConfigDocumentText(editorconfig.Id, text);
ExtractMethod\ExtractMethodTests.cs (1)
10050var solution = new AdhocWorkspace().CurrentSolution;
Formatting\CodeCleanupTests.cs (1)
835var solution = workspace.CurrentSolution.WithAnalyzerReferences(
Formatting\CodeCleanupTests.TestFixers.cs (2)
87var solution = fixAllContext.Solution; 143var solution = fixAllContext.Solution;
NavigateTo\NavigateToSearcherTests.cs (9)
41It.IsAny<Solution>(), 50(Solution solution, 65It.IsAny<Solution>(), 73(Solution solution, 91It.IsAny<Solution>(), 100(Solution solution, 515public Task SearchCachedDocumentsAsync(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) 527public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 533public 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)
OnTheFlyDocs\OnTheFlyDocsUtilitiesTests.cs (3)
32var solution = workspace.CurrentSolution; 68var solution = workspace.CurrentSolution; 114var solution = workspace.CurrentSolution;
SymbolKey\SymbolKeyTests.cs (6)
43var solution = workspace.CurrentSolution; 78var solution = workspace.CurrentSolution; 117var solution = workspace.CurrentSolution; 163var solution = workspace.CurrentSolution; 194var solution = workspace.CurrentSolution; 304(ProjectId bodyLocalProjectId, ProjectId referenceAssemblyProjectId) GetOriginatingProjectIds(Solution solution, ISymbol bodyLocalSymbol, ISymbol referenceAssemblySymbol)
Workspaces\WorkspaceTests_EditorFeatures.cs (55)
62var solution = workspace.CurrentSolution; 84var solution = workspace.CurrentSolution; 100var solution = workspace.CurrentSolution; 115var solution = workspace.CurrentSolution; 131var solution = workspace.CurrentSolution; 142var solution = workspace.CurrentSolution; 156var solution = workspace.CurrentSolution; 183var solution = workspace.CurrentSolution; 241var currentSnapshot = workspaceSnapshotBuilder.CurrentSolution; 247private static async Task<TypeDeclarationSyntax> GetRootTypeDeclarationAsync(Solution currentSnapshot) 259var solution = workspace.CurrentSolution; 273var solution = workspace.CurrentSolution; 284var snapshot = workspace.CurrentSolution; 295var solution = workspace.CurrentSolution; 312var solution = workspace.CurrentSolution; 323var snapshot = workspace.CurrentSolution; 334var solution = workspace.CurrentSolution; 351var solution = workspace.CurrentSolution; 368var solution = workspace.CurrentSolution; 383var solution = workspace.CurrentSolution; 402var solution = workspace.CurrentSolution; 410var snapshot = workspace.CurrentSolution; 421var solution = workspace.CurrentSolution; 432var snapshot = workspace.CurrentSolution; 445var solution = workspace.CurrentSolution; 460var snapshot = workspace.CurrentSolution; 478var solutionX = workspace.CurrentSolution; 497var solutionY = workspace.CurrentSolution; 515var solutionZ = workspace.CurrentSolution; 536var solutionX = workspace.CurrentSolution; 555var solutionY = workspace.CurrentSolution; 579var cs = workspace.CurrentSolution; 608var solutionX = workspace.CurrentSolution; 627var solutionY = workspace.CurrentSolution; 654var cs = workspace.CurrentSolution; 676var cs = workspace.CurrentSolution; 704var solution = workspace.CurrentSolution; 743var oldSolution = workspace.CurrentSolution; 744var newSolution = oldSolution.WithDocumentText(document.Id, SourceText.From(newText)); 771var oldSolution = workspace.CurrentSolution; 772var newSolution = oldSolution.AddDocument(DocumentId.CreateNewId(project1.Id), "Doc2", SourceText.From(doc2Text)); 792var oldSolution = workspace.CurrentSolution; 793var newSolution = oldSolution.RemoveDocument(document.Id); 1126var oldSolution = workspace.CurrentSolution; 1127var newSolution = oldSolution.WithAdditionalDocumentText(additionalDoc.Id, SourceText.From(newText)); 1159var oldSolution = workspace.CurrentSolution; 1160var newSolution = oldSolution.WithAnalyzerConfigDocumentText(analyzerConfigDoc.Id, SourceText.From(newText)); 1249var oldSolution = workspace.CurrentSolution; 1250var newSolution = oldSolution.AddAdditionalDocument(newDocId, "app.config", "text"); 1285var oldSolution = workspace.CurrentSolution; 1286var newSolution = oldSolution.AddAnalyzerConfigDocument(newDocId, "app.config", SourceText.From("text")); 1477var solution = workspace1.CurrentSolution; 1485var newSolution = solution.WithOptions(newOptions); 1514var beforeSolutionForPrimaryWorkspace = primaryWorkspace.CurrentSolution; 1515var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
62var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.Features (42)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (5)
68private static async Task<Solution> EnableNullableReferenceTypesAsync( 71var solution = project.Solution; 266Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution) 274private readonly Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution = createChangedSolution; 278var changedSolution = await _createChangedSolution(CodeActionPurpose.Preview, CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false);
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.FixAllProvider.cs (5)
39async Task<Solution> EnableNullableReferenceTypesInSolutionAsync( 42var solution = fixAllContext.Solution; 56private sealed class FixAllCodeAction(Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution) 64private readonly Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution = createChangedSolution; 68var changedSolution = await _createChangedSolution(
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
84var solution = document.Project.Solution;
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
71private static async Task<Solution> ConvertAsync( 98var solution = document.Project.Solution;
Debugging\BreakpointResolver.cs (1)
20internal sealed class BreakpointResolver(Solution solution, string text) : AbstractBreakpointResolver(solution, text, LanguageNames.CSharp, EqualityComparer<string>.Default)
Debugging\CSharpBreakpointResolutionService.cs (1)
54public Task<IEnumerable<BreakpointResolutionResult>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken)
ExtractInterface\CSharpExtractInterfaceService.cs (2)
66protected override Task<Solution> UpdateMembersWithExplicitImplementationsAsync( 67Solution unformattedSolution, IReadOnlyList<DocumentId> documentIds,
GenerateType\CSharpGenerateTypeService.cs (2)
713internal override async Task<Solution> TryAddUsingsOrImportToDocumentAsync( 714Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (2)
211private async Task<Solution> ChangeImplementationAsync( 214var solution = project.Solution;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
43var solution = project.Solution;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
139static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Solution>> createSolution)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (4)
23private static async Task<Solution> AddMultipleMembersAsync( 40var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 72static async Task<Solution> AddSingleMemberAsync( 80var solution = project.Solution;
NavigationBar\CSharpNavigationBarItemService.cs (4)
63Solution solution, SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken) 189Solution solution, ISymbol member, SemanticModel semanticModel, CancellationToken cancellationToken) 217Solution solution, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 253Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
207var solution = document.Project.Solution;
QuickInfo\OnTheFlyDocsUtilities.cs (1)
14public static ImmutableArray<OnTheFlyDocsRelevantFileInfo?> GetAdditionalOnTheFlyDocsContext(Solution solution, ISymbol symbol)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
79private static async Task<Solution> ConvertToPositionalRecordAsync(
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
38private static Solution AllowUnsafeOnProject(Project project)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
87public override Solution UpgradeProject(Project project, string newVersion)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
95private static async Task<Solution> UsePrimaryConstructorAsync( 118var solution = document.Project.Solution;
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorFixAllProvider.cs (1)
38private static async Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalContext, ImmutableArray<FixAllContext> contexts)
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
61private static async Task<Solution> UseSystemThreadingLockAsync( 82var solution = document.Project.Solution;
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockFixAllProvider.cs (1)
30private static async Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalContext, ImmutableArray<FixAllContext> contexts)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (42)
Diagnostics\Suppression\SuppressionTests.cs (4)
800var solution = workspace.CurrentSolution; 804var updatedSolution = solution.WithProjectCompilationOptions(solution.ProjectIds.Single(), compilationOptions); 1046var solution = workspace.CurrentSolution; 1050var updatedSolution = solution.WithProjectCompilationOptions(solution.ProjectIds.Single(), compilationOptions);
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (25)
38private static Solution AddDefaultTestProject(Solution solution, string source) 295var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 301var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 362var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 366var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 389var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 423var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 428var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 454var oldSolution = workspace.CurrentSolution. 503var oldSolution = workspace.CurrentSolution; 508var newSolution = workspace.CurrentSolution.WithDocumentText(documentId, SourceText.From(source2)); 534var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 572var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 577var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 611var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 616var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 652var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 657var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 699var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 703var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 733var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 736var newSolution = oldSolution.AddDocument(documentId, "goo.cs", SourceText.From(source2), filePath: filePath); 789var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 793var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
EnableNullable\EnableNullableTests.cs (6)
26private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolution = 42private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromRestoreKeyword = 58private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromDisableKeyword =
SemanticSearch\CSharpSemanticSearchServiceTests.cs (5)
74var solution = workspace.CurrentSolution; 251var solution = workspace.CurrentSolution; 304var solution = workspace.CurrentSolution; 369var solution = workspace.CurrentSolution; 426var solution = workspace.CurrentSolution;
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (2)
44var oldSolution = appliedChanges.Item1; 45var newSolution = appliedChanges.Item2;
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Rename\CSharpRenameRewriterLanguageService.cs (3)
50private readonly Solution _solution; 785Solution baseSolution, 786Solution newSolution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
33public static async Task<Solution> AddAssignmentForPrimaryConstructorAsync( 40var solution = project.Solution; 101var solution = solutionEditor.OriginalSolution;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (29)
CodeGeneration\SymbolEditorTests.cs (29)
31private static Solution GetSolution(params string[] sources) 48private static async Task<IEnumerable<ISymbol>> GetSymbolsAsync(Solution solution, string name) 71var solution = GetSolution(code); 99var solution = GetSolution(code); 136var solution = GetSolution(code); 177var solution = GetSolution(code); 224var solution = GetSolution(code1, code2); 272var solution = GetSolution(code); 308var solution = GetSolution(code1, code2); 345var solution = GetSolution(code); 382var solution = GetSolution(code); 419var solution = GetSolution(code); 465var solution = GetSolution(code); 515var solution = GetSolution(code); 553var solution = GetSolution(code); 587var solution = GetSolution(code); 620var solution = GetSolution(code); 645var solution = GetSolution(code); 676var solution = GetSolution(code); 701var solution = GetSolution(code); 749var solution = GetSolution(code); 790var solution = GetSolution(code); 827var solution = GetSolution(code); 860var solution = GetSolution(code); 893var solution = GetSolution(code); 930var solution = GetSolution(code); 967var solution = GetSolution(code); 996var solution = GetSolution(code); 1034var solution = GetSolution(code);
Microsoft.CodeAnalysis.EditorFeatures (142)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (2)
97private static void HandleResult(ChangeSignatureResult result, Solution oldSolution, Workspace workspace, CommandExecutionContext context) 115var finalSolution = result.UpdatedSolution;
CodeActions\CodeActionEditHandlerService.cs (10)
56var oldSolution = workspace.CurrentSolution; 57var newSolution = await applyChanges.ChangedSolution.WithMergedLinkedFileChangesAsync( 94Solution originalSolution, 119var oldSolution = workspace.CurrentSolution; 180var updatedSolution = operations.OfType<ApplyChangesOperation>().FirstOrDefault()?.ChangedSolution ?? oldSolution; 187Solution oldSolution, ImmutableArray<CodeActionOperation> operationsList) 196var newSolution = applyOperation.ChangedSolution; 262Solution originalSolution, 292Solution oldSolution, 293Solution newSolution,
CodeActions\ICodeActionEditHandlerService.cs (1)
22Solution originalSolution,
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;
EditAndContinue\EditAndContinueLanguageService.cs (18)
52private Solution? _pendingUpdatedDesignTimeSolution; 53private Solution? _committedDesignTimeSolution; 55public event Action<Solution>? SolutionCommitted; 76private Solution GetCurrentDesignTimeSolution() 79private Solution GetCurrentCompileTimeSolution(Solution currentDesignTimeSolution) 118var currentSolution = GetCurrentDesignTimeSolution(); 120var solution = GetCurrentCompileTimeSolution(currentSolution); 161var solution = (inBreakState == true) ? GetCurrentCompileTimeSolution(GetCurrentDesignTimeSolution()) : null; 197var committedDesignTimeSolution = Interlocked.Exchange(ref _pendingUpdatedDesignTimeSolution, null); 246var currentDesignTimeSolution = GetCurrentDesignTimeSolution(); 247var currentCompileTimeSolution = GetCurrentCompileTimeSolution(currentDesignTimeSolution); 274private ImmutableArray<ProjectId> GetProjectIds(ImmutableArray<string> projectPaths, Solution solution) 318private ActiveStatementSpanProvider GetActiveStatementSpanProvider(Solution solution) 347var oldSolution = _committedDesignTimeSolution; 348var newSolution = GetCurrentDesignTimeSolution(); 371var designTimeSolution = GetCurrentDesignTimeSolution(); 372var solution = GetCurrentCompileTimeSolution(designTimeSolution);
EditAndContinue\IActiveStatementTrackingService.cs (1)
16void StartTracking(Solution solution, IActiveStatementSpanFactory spanProvider);
EditAndContinue\IEditAndContinueSolutionProvider.cs (2)
10/// Retrieves the <see cref="Solution"/> snapshot that corresponds to the current state of the debuggee. 18event Action<Solution> SolutionCommitted;
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
103public void SetBaseline(Solution solution)
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
54var solution = Workspace.CurrentSolution;
EditorConfigSettings\Extensions\SolutionExtensions.cs (1)
14public static ImmutableArray<Project> GetProjectsUnderEditorConfigFile(this Solution solution, string pathToEditorConfigFile)
EditorConfigSettings\Updater\SettingsUpdaterBase.cs (1)
74var solution = Workspace.CurrentSolution;
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
103var finalSolution = await result.GetSolutionAsync(cancellationToken).ConfigureAwait(false); 105var solution = document.Project.Solution;
ExternalAccess\IntelliCode\IntentProcessor.cs (3)
91var newSolution = processorResult.Solution; 110Solution changedSolution, 111Solution currentSolution,
ExternalAccess\VSTypeScript\Api\AbstractVSTypeScriptRequestHandler.cs (1)
62internal record struct TypeScriptRequestContext(Solution? Solution, Document? Document);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptBreakpointResolutionServiceImplementation.cs (1)
16Task<IEnumerable<VSTypeScriptBreakpointResolutionResultWrapper>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptInlineRenameReplacementInfo.cs (1)
16public abstract Solution NewSolution { get; }
ExternalAccess\VSTypeScript\VSTypeScriptBreakpointResolutionService.cs (1)
29public async Task<IEnumerable<BreakpointResolutionResult>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default)
Formatting\FormatCommandHandler.Paste.cs (1)
65var solution = document.Project.Solution;
GoToDefinition\GoToDefinitionHelpers.cs (2)
18Solution solution, 32Solution solution,
Host\IPreviewDialogService.cs (3)
28Solution PreviewChanges( 34Solution newSolution, 35Solution oldSolution,
InlineDiagnostics\AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
105var solution = project.Solution;
InlineRename\AbstractEditorInlineRenameService.InlineRenameReplacementInfo.cs (1)
26public Solution NewSolution => _conflicts.NewSolution!;
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
134var solution = this.Document.Project.Solution;
InlineRename\IEditorInlineRenameService.cs (1)
107Solution NewSolution { get; }
InlineRename\InlineRenameSession.cs (4)
46private readonly Solution _baseSolution; 804var newSolution = info.NewSolution; 860Solution newSolution, CancellationToken cancellationToken) 896var finalSolution = Workspace.CurrentSolution;
IntelliSense\NavigationActionFactory.cs (1)
60var solution = workspace.CurrentSolution;
Interactive\InteractiveSession.cs (1)
271private Project CreateSubmissionProjectNoLock(Solution solution, ProjectId newSubmissionProjectId, ProjectId? previousSubmissionProjectId, string languageName, ImmutableArray<string> imports, ImmutableArray<MetadataReference> references)
Interactive\InteractiveWorkspace.cs (1)
67var emptySolution = CreateSolution(SolutionId.CreateNewId("InteractiveSolution"));
NavigateTo\NavigateToItemProvider.Callback.cs (2)
22private readonly Solution _solution; 26public NavigateToItemProviderCallback(Solution solution, INavigateToItemDisplayFactory displayFactory, INavigateToCallback callback)
NavigateTo\NavigateToItemProvider.cs (1)
112var solution = _workspace.CurrentSolution;
Navigation\AbstractDefinitionLocationService.cs (4)
33var solution = document.Project.Solution; 92var solution = project.Solution; 114Solution solution, Document document, TextSpan span, CancellationToken cancellationToken) 132var solution = project.Solution;
Peek\DefinitionPeekableItem.cs (1)
70var solution = workspace.CurrentSolution;
Peek\PeekableItemFactory.cs (1)
60var solution = project.Solution;
Preview\AbstractPreviewFactoryService.cs (6)
68public SolutionPreviewResult? GetSolutionPreviews(Solution oldSolution, Solution? newSolution, CancellationToken cancellationToken) 71public SolutionPreviewResult? GetSolutionPreviews(Solution oldSolution, Solution? newSolution, double zoomLevel, CancellationToken cancellationToken) 486var leftSolution = oldDocument.Project.Solution; 493var rightSolution = newDocument.Project.Solution;
Preview\IPreviewFactoryService.cs (4)
11SolutionPreviewResult? GetSolutionPreviews(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken); 12SolutionPreviewResult? GetSolutionPreviews(Solution oldSolution, Solution newSolution, double zoomLevel, CancellationToken cancellationToken);
Preview\SolutionChangeSummary.cs (4)
11public readonly Solution OldSolution; 12public readonly Solution NewSolution; 17public SolutionChangeSummary(Solution oldSolution, Solution newSolution, SolutionChanges changes)
Remote\SolutionChecksumUpdater.cs (2)
122var solution = _workspace.CurrentSolution; 153var solution = _workspace.CurrentSolution;
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
116Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
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,
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingSolutionSet.cs (4)
14Solution originalSolution, 15Solution renamedSolution) 18public Solution OriginalSolution { get; } = originalSolution; 19public Solution RenamedSolution { get; } = renamedSolution;
SemanticSearch\SemanticSearchEditorWorkspace.cs (1)
42/// Used by code actions through <see cref="Workspace.TryApplyChanges(Solution)"/>.
Shared\Extensions\WorkspaceExtensions.cs (6)
24var oldSolution = workspace.CurrentSolution; 29var newSolution = oldSolution.UpdateDocument(newDocument.Id, changes, cancellationToken); 41var oldSolution = workspace.CurrentSolution; 42var newSolution = oldSolution.UpdateDocument(id, textChanges, cancellationToken); 46private static Solution UpdateDocument(this Solution solution, DocumentId id, IEnumerable<TextChange> textChanges, CancellationToken cancellationToken)
Shared\Preview\PreviewWorkspace.cs (1)
26public PreviewWorkspace(Solution solution)
Suggestions\Copilot\FlavoredSuggestedAction.cs (1)
30Solution originalSolution,
Suggestions\FixAll\FixAllGetFixesService.cs (4)
18protected override Solution? GetChangedSolution(Workspace workspace, Solution currentSolution, Solution newSolution, string fixAllPreviewChangesTitle, string fixAllTopLevelHeader, Glyph glyph) 22var changedSolution = previewService.PreviewChanges(
Suggestions\FixAll\FixMultipleOccurrencesService.cs (4)
27public Task<Solution> GetFixAsync( 45public Task<Solution> GetFixAsync( 63private static async Task<Solution> GetFixedSolutionAsync( 73Solution newSolution = null;
Suggestions\PreviewChanges\PreviewChangesCodeAction.cs (2)
34Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 49var changedSolution = previewDialogService.PreviewChanges(
Suggestions\PreviewChanges\PreviewChangesSuggestedAction.cs (1)
24Solution originalSolution,
Suggestions\RefineUsingCopilot\RefineUsingCopilotCodeAction.cs (3)
29Solution originalSolution, 62var newSolution = await originalCodeAction.GetChangedSolutionInternalAsync(originalSolution, progress, cancellationToken).ConfigureAwait(false); 95internal override async Task<bool> TryApplyAsync(Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
Suggestions\RefineUsingCopilot\RefineUsingCopilotSuggestedAction.cs (1)
30Solution originalSolution,
Suggestions\SuggestedActions\AbstractFixAllSuggestedAction.cs (1)
29Solution originalSolution,
Suggestions\SuggestedActions\FixAllCodeFixSuggestedAction.cs (1)
27Solution originalSolution,
Suggestions\SuggestedActions\FixAllCodeRefactoringSuggestedAction.cs (1)
24Solution originalSolution,
Suggestions\SuggestedActions\SuggestedAction.cs (2)
42protected readonly Solution OriginalSolution; 54Solution originalSolution,
Suggestions\SuggestedActionsSource_Async.cs (1)
282var originalSolution = unifiedSuggestedActionSet.OriginalSolution;
Suggestions\SuggestedActionWithNestedActions.cs (2)
31Solution originalSolution, 46Solution originalSolution,
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (13)
Completion\AbstractCompletionProviderTests.cs (3)
963var solution = testWorkspace.CurrentSolution; 1020var solution = testWorkspace.CurrentSolution; 1049var solution = testWorkspace.CurrentSolution;
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
158var updatedSolution = await testState.ExtractViaCodeAction();
ExtractInterface\ExtractInterfaceTestState.cs (2)
30public Solution OriginalSolution { get; } 98public async Task<Solution> ExtractViaCodeAction()
Formatting\AbstractNewDocumentFormattingServiceTests.cs (1)
28var solution = workspace.CurrentSolution;
Rename\RenamerTests.cs (3)
41var solution = workspace.CurrentSolution; 176var solution = workspace.CurrentSolution; 215var solution = workspace.CurrentSolution;
RenameTracking\MockPreviewDialogService.cs (3)
33public Solution PreviewChanges(string title, string helpString, string description, string topLevelName, Glyph topLevelGlyph, Solution newSolution, Solution oldSolution, bool showCheckBoxes = true)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (49)
CodeFixes\CodeFixServiceTests.cs (1)
861var solution = await codeAction.GetChangedSolutionInternalAsync(txtDocument.Project.Solution, CodeAnalysisProgress.None, CancellationToken.None);
CodeGeneration\CodeGenerationTests.cs (1)
898public Solution Solution { get { return Workspace.CurrentSolution; } }
CodeRefactorings\CodeRefactoringServiceTest.cs (2)
182var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution, CodeAnalysisProgress.None, CancellationToken.None); 221var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution, CodeAnalysisProgress.None, CancellationToken.None);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
233var solution = workspace.CurrentSolution; 314var solution = workspace.CurrentSolution;
EditAndContinue\EditAndContinueLanguageServiceTests.cs (3)
49private TestWorkspace CreateEditorWorkspace(out Solution solution, out EditAndContinueService service, out EditAndContinueLanguageService languageService, Type[] additionalParts = null) 125var solution = localWorkspace.CurrentSolution; 351using var workspace = CreateEditorWorkspace(out var solution, out var service, out var languageService);
FindSymbols\SymbolTreeInfoTests.cs (4)
21var solution = workspace.CurrentSolution; 42var solution = workspace.CurrentSolution; 65var solution = workspace.CurrentSolution; 87var solution = workspace.CurrentSolution;
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (3)
75var solution = workspace.CurrentSolution; 85var newSolution = solution 107var newSolution = document.Project.Solution
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
75public Solution CurrentSolution
Preview\PreviewWorkspaceTests.cs (7)
54var solution = previewWorkspace.CurrentSolution; 58var newSolution = previewWorkspace.CurrentSolution.RemoveProject(project.Id); 68var solution = previewWorkspace.CurrentSolution; 72var addedSolution = previewWorkspace.CurrentSolution.Projects.First() 80var changedSolution = previewWorkspace.CurrentSolution.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution; 84var removedSolution = previewWorkspace.CurrentSolution.Projects.First() 97var solution = previewWorkspace.CurrentSolution;
SymbolFinder\SymbolFinderTests.cs (24)
28private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, MetadataReference metadataReference, params ProjectId[] projectReferences) 58var solution = workspace.CurrentSolution; 99var solution = workspace.CurrentSolution; 136private static Project GetPortableProject(Solution solution) 139private static Project GetNormalProject(Solution solution) 146var solution = workspace.CurrentSolution; 191var solution = workspace.CurrentSolution; 232var solution = workspace.CurrentSolution; 274var solution = workspace.CurrentSolution; 316var solution = workspace.CurrentSolution; 356var solution = workspace.CurrentSolution; 397var solution = workspace.CurrentSolution; 437var solution = workspace.CurrentSolution; 468var solution = workspace.CurrentSolution; 517var solution = workspace.CurrentSolution; 569var solution = workspace.CurrentSolution; 596var solution = workspace.CurrentSolution; 644var solution = workspace.CurrentSolution; 670var solution = workspace.CurrentSolution; 734var solution = workspace.CurrentSolution; 777var solution = workspace.CurrentSolution; 805var solution = workspace.CurrentSolution; 843var solution = workspace.CurrentSolution;
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
42var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (11)
Compilation\CompilationTests.vb (1)
12Private Shared Function GetProject(snapshot As Solution, assemblyName As String) As Project
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (2)
61Optional verifySolutions As Func(Of Solution, Solution, Task) = Nothing,
Diagnostics\AddImport\AddImportCrossLanguageTests.vb (4)
570Dim verifySolutions As Func(Of Solution, Solution, Task) = Nothing 575Function(oldSolution As Solution, newSolution As Solution)
FindReferences\FindReferencesTests.vb (2)
472Private Shared Function GetFilePathAndProjectLabel(solution As Solution, syntaxTree As SyntaxTree) As String 537Private Shared Async Function LinkedFileTestHelper(solution As Solution, expectedLinkedSymbolCount As Integer) As Task
Rename\RenameEngineResult.vb (1)
127solution As Solution,
Workspaces\TryFindSourceDefinitionTests.vb (1)
17Private Shared Function GetProject(snapshot As Solution, assemblyName As String) As Project
Microsoft.CodeAnalysis.ExternalAccess.Debugger (2)
GlassTestsHotReloadService.cs (2)
31public async Task StartSessionAsync(Solution solution, CancellationToken cancellationToken) 85public async ValueTask<ManagedHotReloadUpdates> GetUpdatesAsync(Solution solution, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Extensions (5)
External\ExtensionMessageContext.cs (2)
12internal ExtensionMessageContext(Solution solution) 20public Solution Solution { get; }
Internal\ExtensionMessageHandlerFactory.cs (1)
28public ImmutableArray<IExtensionMessageHandlerWrapper<Solution>> CreateWorkspaceMessageHandlers(
Internal\ExtensionWorkspaceMessageHandlerWrapper.cs (2)
14: ExtensionHandlerWrapper<Solution>(handler, customMessageHandlerInterface, extensionIdentifier) 16protected override Task ExecuteAsync(MethodInfo executeAsyncMethod, object handler, object? message, Solution argument, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (6)
Editor\IFSharpEditorInlineRenameService.cs (1)
22Solution NewSolution { get; }
Editor\Implementation\Debugging\IFSharpBreakpointResolutionService.cs (1)
16Task<IEnumerable<FSharpBreakpointResolutionResult>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default);
Editor\InlineRename\FSharpInlineRenameReplacementInfo.cs (1)
19public abstract Solution NewSolution { get; }
Internal\Editor\FSharpEditorInlineRenameService.cs (1)
72public Solution NewSolution => _info.NewSolution;
Internal\Editor\Implementation\Debugging\FSharpBreakpointResolutionService.cs (1)
34public async Task<IEnumerable<BreakpointResolutionResult>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (1)
48Solution solution,
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (11)
Analyzers\OmniSharpWorkspaceAnalyzerOptionsFactory.cs (1)
12public static AnalyzerOptions Create(Solution solution, AnalyzerOptions options)
CodeRefactorings\WorkspaceServices\IOmniSharpSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (2)
11CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
Internal\CodeRefactorings\WorkspaceServices\OmniSharpSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (2)
27public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
NavigateTo\OmniSharpNavigateToSearchService.cs (2)
20Solution solution, 37private sealed class OmniSharpNavigateToCallbackImpl(Solution solution, OmniSharpNavigateToCallback callback) : INavigateToSearchCallback
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (2)
23var oldSolution = workspace.CurrentSolution; 55var newSolution = oldSolution.WithFallbackAnalyzerOptions(newFallbackOptions);
Rename\OmniSharpRenamer.cs (2)
15public readonly record struct RenameResult(Solution? Solution, string? ErrorMessage); 18Solution solution,
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (26)
Cohost\Handlers\CodeActions.cs (2)
24var solution = document.Project.Solution; 45var solution = document.Project.Solution;
Cohost\RazorCohostRequestContext.cs (1)
20internal Solution? Solution => context.Solution;
RazorRequestContext.cs (1)
18internal Solution? Solution => context.Solution;
RazorUri.cs (2)
22public static string GetHintNameFromGeneratedDocumentUri(Solution solution, Uri generatedDocumentUri) 27public static RazorGeneratedDocumentIdentity GetIdentityOfGeneratedDocument(Solution solution, Uri generatedDocumentUri)
Remote\JsonSerializableRazorPinnedSolutionInfoWrapper.cs (1)
15[property: JsonIgnore] Solution? Solution)
Remote\RazorPinnedSolutionInfoWrapper.cs (3)
19internal readonly Solution? Solution; 27internal RazorPinnedSolutionInfoWrapper(Checksum checksum, Solution? solution) 39public static implicit operator RazorPinnedSolutionInfoWrapper(Solution solution)
Remote\RazorRemoteHostClient.cs (4)
68public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 74public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class 82public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class 88public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class
Remote\RazorRemoteServiceConnectionWrapper.cs (4)
45public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 51public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) 59public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 65public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
SolutionExtensions.cs (3)
12public static ImmutableArray<TextDocument> GetTextDocuments(this Solution solution, Uri documentUri) 15public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri) 18public static int GetWorkspaceVersion(this Solution solution)
Testing\TestSolutionStore.cs (5)
13private readonly Dictionary<Checksum, Solution> _solutions = []; 15internal async Task<RazorPinnedSolutionInfoWrapper> AddAsync(Solution solution, CancellationToken cancellationToken) 23if (_solutions.TryGetValue(checksum, out var existingSolution)) 34internal Solution? Get(RazorPinnedSolutionInfoWrapper solutionInfo) 38_solutions.TryGetValue(solutionInfo.UnderlyingObject, out var solution);
Microsoft.CodeAnalysis.Features (620)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
46protected override Task<Solution?> GetChangedSolutionAsync( 68return Task.FromResult<Solution?>(constructorDocument.WithSyntaxRoot(newRoot).Project.Solution);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (1)
184var changedSolution = await action.GetChangedSolutionInternalAsync(
AddImport\AbstractAddImportFeatureService.cs (2)
326var solution = project.Solution; 456var solution = project.Solution;
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
82Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (4)
62private async Task<Solution> GetUpdatedSolutionAsync(CancellationToken cancellationToken) 108Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 110var newSolution = workspace.CurrentSolution.WithDocumentText( 122var rolledBackSolution = workspace.CurrentSolution.WithDocumentText(
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (1)
72Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
68Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
ChangeSignature\AbstractChangeSignatureService.cs (5)
161var solution = document.Project.Solution; 227Solution solution, 246private async Task<(Solution updatedSolution, string? confirmationMessage)> CreateUpdatedSolutionAsync( 251var currentSolution = context.Solution; 456private static bool TryGetNodeWithEditableSignatureOrAttributes(Location location, Solution solution, out SyntaxNode nodeToUpdate, out DocumentId documentId)
ChangeSignature\ChangeSignatureAnalyzedContext.cs (1)
19public Solution Solution => Document.Project.Solution;
ChangeSignature\ChangeSignatureCodeActionOperation.cs (4)
19internal sealed class ChangeSignatureCodeActionOperation(Solution changedSolution, string? confirmationMessage) : CodeActionOperation 21public Solution ChangedSolution { get; } = changedSolution ?? throw new ArgumentNullException(nameof(changedSolution)); 31Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 36private bool ApplyWorker(Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
ChangeSignature\ChangeSignatureResult.cs (2)
11Solution? updatedSolution = null, 20public Solution? UpdatedSolution { get; } = updatedSolution;
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
42Solution solution,
CodeFixes\Configuration\ConfigurationUpdater.cs (13)
107public static Task<Solution> ConfigureSeverityAsync( 126public static Task<Solution> ConfigureSeverityAsync( 157public static Task<Solution> BulkConfigureSeverityAsync( 172public static Task<Solution> BulkConfigureSeverityAsync( 180private static Task<Solution> BulkConfigureSeverityCoreAsync( 197public static Task<Solution> ConfigureCodeStyleOptionAsync( 209private static async Task<Solution> ConfigureCodeStyleOptionsAsync( 242var solution = await updater.ConfigureAsync(cancellationToken).ConfigureAwait(false); 254var solution = await updater.ConfigureAsync(cancellationToken).ConfigureAwait(false); 261private async Task<Solution> ConfigureAsync(CancellationToken cancellationToken) 270var solution = editorConfigDocument.Project.Solution; 304var currentSolution = _project.Solution; 336var newSolution = project.Solution.AddAnalyzerConfigDocuments([documentInfo]);
CodeFixes\FixAllOccurrences\IFixMultipleOccurrencesService.cs (2)
19Task<Solution> GetFixAsync( 34Task<Solution> GetFixAsync(
CodeFixes\Service\CodeFixService.cs (1)
360var solution = await fixAllService.GetFixAllChangedSolutionAsync(
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (10)
213var solution = fixAllState.Solution; 214var newSolution = await TryMergeFixesAsync( 225private static async Task<Solution> TryMergeFixesAsync( 226Solution oldSolution, 244var finalSolution = oldSolution.WithDocumentTexts(documentIdToFinalText); 249Solution oldSolution, 271Solution oldSolution, 296Solution oldSolution, 344Solution oldSolution, 352var changedSolution = await codeAction.GetChangedSolutionInternalAsync(
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (5)
57Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 67private static async Task<Solution> CreateChangedSolutionAsync( 73var currentSolution = triggerDocument.Project.Solution; 96private static async Task<Solution> CreateChangedSolutionAsync( 102var currentSolution = triggerProject.Solution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (2)
115var oldSolution = fixAllState.Project.Solution; 116var currentSolution = oldSolution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
60protected override async Task<Solution> GetChangedSolutionAsync(
CodeFixesAndRefactorings\AbstractFixAllCodeAction.cs (1)
65protected sealed override Task<Solution?> GetChangedSolutionAsync(
CodeFixesAndRefactorings\AbstractFixAllGetFixesService.cs (10)
17protected abstract Solution? GetChangedSolution( 19Solution currentSolution, 20Solution newSolution, 25public async Task<Solution?> GetFixAllChangedSolutionAsync(IFixAllContext fixAllContext) 71var newSolution = await codeAction.GetChangedSolutionInternalAsync( 102public Solution? PreviewChanges( 104Solution currentSolution, 105Solution newSolution, 141var changedSolution = GetChangedSolution( 200private static ImmutableArray<CodeActionOperation> GetNewFixAllOperations(ImmutableArray<CodeActionOperation> operations, Solution newSolution, CancellationToken cancellationToken)
CodeFixesAndRefactorings\FeaturesFixAllGetFixesService.cs (3)
17protected override Solution? GetChangedSolution(Workspace workspace, Solution currentSolution, Solution newSolution, string fixAllPreviewChangesTitle, string fixAllTopLevelHeader, Glyph glyph)
CodeFixesAndRefactorings\IFixAllGetFixesService.cs (4)
24Task<Solution?> GetFixAllChangedSolutionAsync(IFixAllContext fixAllContext); 29Solution? PreviewChanges( 31Solution currentSolution, 32Solution 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\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (3)
40var solution = document.Project.Solution; 79var solution = document.Project.Solution; 203Solution newSolution;
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
36var solution = document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (3)
29public abstract Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken); 56public override async Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken) 66var modifiedSolution = await editor.GetModifiedSolutionAsync().ConfigureAwait(false);
CodeRefactorings\MoveType\AbstractMoveTypeService.Editor.cs (2)
36var solution = await GetModifiedSolutionAsync().ConfigureAwait(false); 43public abstract Task<Solution?> GetModifiedSolutionAsync();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (7)
47public override async Task<Solution?> GetModifiedSolutionAsync() 66var solutionWithNewDocument = documentWithMovedType.Project.Solution; 73var solutionWithBothDocumentsUpdated = await RemoveTypeFromSourceDocumentAsync(sourceDocument).ConfigureAwait(false); 78private async Task<Solution> RemoveUnnecessaryImportsAsync( 79Solution solution, DocumentId sourceDocumentId, DocumentId documentWithMovedTypeId) 160var solutionWithNewDocument = projectToBeUpdated.Solution.AddDocument( 231private async Task<Solution> RemoveTypeFromSourceDocumentAsync(Document sourceDocument)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
30public override async Task<Solution?> GetModifiedSolutionAsync() 37private async Task<Solution?> GetNamespaceScopeChangedSolutionAsync(
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameFileEditor.cs (3)
26var newSolution = await GetModifiedSolutionAsync().ConfigureAwait(false); 31public override Task<Solution?> GetModifiedSolutionAsync() 32=> Task.FromResult<Solution?>(
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (2)
24public override async Task<Solution?> GetModifiedSolutionAsync() 29var solution = SemanticDocument.Project.Solution;
CodeRefactorings\MoveType\IMoveTypeService.cs (1)
18Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (23)
42public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 44public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken); 126public override async Task<Solution?> TryChangeTopLevelNamespacesAsync( 144var solution = document.Project.Solution; 182public override async Task<Solution> ChangeNamespaceAsync( 201var solution = document.Project.Solution; 213var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false); 224var solutionAfterNamespaceChange = annotatedSolution; 235var solutionAfterFirstMerge = await MergeDiffAsync(solution, solutionAfterNamespaceChange, cancellationToken).ConfigureAwait(false); 254var solutionAfterImportsRemoved = await RemoveUnnecessaryImportsAsync( 270Solution solution, 312protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken) 349var solution = document.Project.Solution; 428private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync( 429Solution solution, 471var solutionWithChangedNamespace = documentWithNewNamespace.Project.Solution; 503var solutionWithFixedReferences = solutionWithChangedNamespace.WithDocumentSyntaxRoots(fixedDocuments); 801private static async Task<Solution> RemoveUnnecessaryImportsAsync( 802Solution solution, 891private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
40var solution = _state.Document.Project.Solution;
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
171var solution = document.Project.Solution;
CodeRefactorings\WorkspaceServices\ISymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (2)
11CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
Completion\CompletionOptions.cs (1)
77var solution = document.Project.Solution;
Completion\CompletionService.cs (1)
124/// <param name="passThroughOptions">Options originating either from external caller of the <see cref="CompletionService"/> or set externally to <see cref="Solution.Options"/>.</param>
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
22var solution = originatingDocument.Project.Solution;
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
413var solution = document.Project.Solution;
Completion\Providers\CompletionUtilities.cs (1)
33Solution? solution = null;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
92var solution = currentProject.Solution; 197Solution solution,
Completion\Providers\SymbolCompletionItem.cs (1)
232public static SupportedPlatformData? GetSupportedPlatforms(CompletionItem item, Solution solution)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (11)
216public async Task<Solution> ConvertToStructAsync( 223var solution = document.Project.Solution; 237var resultSolution = await RemoteUtilities.UpdateSolutionAsync( 249private static async Task<Solution> AddRenameTokenAsync( 250Solution solution, 262private async Task<Solution> ConvertToStructInCurrentProcessAsync( 318var updatedSolution = await ApplyChangesAsync( 438var solution = startingProject.Solution; 524var solution = startingDocument.Project.Solution; 583private static async Task<Solution> ApplyChangesAsync( 586var currentSolution = startingDocument.Project.Solution;
ConvertTupleToStruct\IConvertTupleToStructCodeRefactoringProvider.cs (1)
14Task<Solution> ConvertToStructAsync(
Debugging\AbstractBreakpointResolver.cs (2)
59private readonly Solution _solution; 63Solution solution,
Debugging\IBreakpointResolutionService.cs (1)
17Task<IEnumerable<BreakpointResolutionResult>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (4)
120Solution solution, 150Solution solution, 157var frozenSolution = await solution.WithFrozenPartialCompilationsAsync(cancellationToken).ConfigureAwait(false); 385Solution solution,
DesignerAttribute\IDesignerAttributeDiscoveryService.cs (2)
22ValueTask ProcessSolutionAsync(Solution solution, ICallback callback, CancellationToken cancellationToken); 27ValueTask ProcessPriorityDocumentAsync(Solution solution, DocumentId priorityDocumentId, ICallback callback, CancellationToken cancellationToken);
Diagnostics\DiagnosticsUpdatedArgs.cs (4)
14public readonly Solution? Solution; 28Solution? solution, 45Solution solution, 54Solution? solution,
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
63var solution = project.Solution;
DocumentHighlighting\AbstractDocumentHighlightsService.cs (6)
39var solution = document.Project.Solution; 73var solution = document.Project.Solution; 166var solution = startingDocument.Project.Solution; 202Solution solution, 289private static async Task AddLocationSpanAsync(Location location, Solution solution, HashSet<DocumentSpan> spanSet, MultiDictionary<Document, HighlightSpan> tagList, HighlightSpanKind kind, CancellationToken cancellationToken) 300Solution solution, Location location, CancellationToken cancellationToken)
DocumentHighlighting\IRemoteDocumentHighlightsService.cs (1)
28public async ValueTask<DocumentHighlights> RehydrateAsync(Solution solution, CancellationToken cancellationToken)
DocumentIdSpan.cs (2)
15/// very stale <see cref="Solution"/> snapshot that may keep around a lot of memory in a host. 28public async Task<DocumentSpan?> TryRehydrateAsync(Solution solution, CancellationToken cancellationToken)
DocumentSpanExtensions.cs (1)
16var solution = documentSpan.Document.Project.Solution;
EditAndContinue\CommittedSolution.cs (5)
65private Solution _solution; 111public CommittedSolution(DebuggingSession debuggingSession, Solution solution, IEnumerable<KeyValuePair<DocumentId, DocumentState>> initialDocumentStates) 136public bool HasNoChanges(Solution solution) 168Solution solution; 461public void CommitChanges(Solution solution, ImmutableArray<ProjectId> projectsToStale, IReadOnlyCollection<ProjectId> projectsToUnstale)
EditAndContinue\DebuggingSession.cs (6)
130Solution solution, 512Solution solution, 616var solution = pendingSolutionUpdate.Solution; 688public void UpdateBaselines(Solution solution, ImmutableArray<ProjectId> rebuiltProjects) 721public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 886var newSolution = newProject.Solution;
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (2)
34Solution newSolution, 65Solution newSolution,
EditAndContinue\EditAndContinueService.cs (5)
135Solution solution, 183private static IEnumerable<(Project, IEnumerable<DocumentState>)> GetDocumentStatesGroupedByProject(Solution solution, ImmutableArray<DocumentId> documentIds) 222Solution solution, 252public void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects) 260public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (6)
256public static async ValueTask<bool> HasChangesAsync(Solution oldSolution, Solution newSolution, string sourceFilePath, CancellationToken cancellationToken) 279public static async ValueTask<bool> HasChangesAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 549Solution newSolution, 837Solution solution,
EditAndContinue\EmitSolutionUpdateResults.cs (3)
76public static Data CreateFromInternalError(Solution solution, string errorMessage, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects) 115public required Solution? Solution { get; init; } 183Solution solution,
EditAndContinue\IActiveStatementSpanFactory.cs (1)
27ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EditAndContinue\IActiveStatementSpanLocator.cs (1)
18ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, 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);
EditAndContinue\PendingSolutionUpdate.cs (2)
20Solution solution, 27public readonly Solution Solution = solution;
EditAndContinue\ProjectDiagnostics.cs (1)
16public static ImmutableArray<DiagnosticData> ToDiagnosticData(this ImmutableArray<ProjectDiagnostics> diagnostics, Solution solution)
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (3)
56Solution solution, 114public async ValueTask UpdateBaselinesAsync(Solution solution, ImmutableArray<ProjectId> rebuiltProjects, CancellationToken cancellationToken) 130public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\Remote\RemoteEditAndContinueServiceProxy.cs (1)
121Solution solution,
EditAndContinue\SolutionSnapshotRegistry.cs (5)
16SolutionSnapshotId RegisterSolutionSnapshot(Solution solution); 27private readonly Dictionary<SolutionSnapshotId, Solution> _pendingSolutionSnapshots = []; 38public SolutionSnapshotId RegisterSolutionSnapshot(Solution solution) 50public Solution GetRegisteredSolutionSnapshot(SolutionSnapshotId id) 54Contract.ThrowIfFalse(_pendingSolutionSnapshots.TryGetValue(id, out var solution));
EncapsulateField\AbstractEncapsulateFieldService.cs (14)
110public async Task<Solution> EncapsulateFieldsAsync( 118var solution = document.Project.Solution; 141private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken) 146var currentSolution = document.Project.Solution; 157var nextSolution = await EncapsulateFieldAsync(document, currentField, updateReferences, cancellationToken).ConfigureAwait(false); 167private async Task<Solution?> EncapsulateFieldAsync( 182var solution = document.Project.Solution; 193var solutionNeedingProperty = await UpdateReferencesAsync( 230private async Task<Solution> UpdateReferencesAsync( 231bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken) 275private static async Task<Solution> RenameAsync( 276Solution solution, 311private ISet<(DocumentId documentId, TextSpan span)> GetConstructorLocations(Solution solution, INamedTypeSymbol containingType) 318Solution destinationSolution,
EncapsulateField\EncapsulateFieldResult.cs (3)
12internal sealed class EncapsulateFieldResult(string name, Glyph glyph, Func<CancellationToken, Task<Solution>> getSolutionAsync) 16private readonly AsyncLazy<Solution> _lazySolution = AsyncLazy.Create(getSolutionAsync); 18public Task<Solution> GetSolutionAsync(CancellationToken cancellationToken)
EncapsulateField\IEncapsulateFieldService.cs (1)
18Task<Solution> EncapsulateFieldsAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken);
Extensions\ExtensionMessageHandlerService_RemoteOrLocal.cs (3)
20Solution? solution, 45Solution? solution, 102public ValueTask<ExtensionMessageResult> HandleExtensionWorkspaceMessageAsync(Solution solution, string messageName, string jsonMessage, CancellationToken cancellationToken)
Extensions\IExtensionMessageHandlerFactory.cs (1)
24ImmutableArray<IExtensionMessageHandlerWrapper<Solution>> CreateWorkspaceMessageHandlers(
Extensions\IExtensionMessageHandlerService.cs (1)
73Solution solution, string messageName, string jsonMessage, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\API\UnitTestingHotReloadService.cs (3)
66public async Task StartSessionAsync(Solution solution, ImmutableArray<string> capabilities, CancellationToken cancellationToken) 83/// where <paramref name="commitUpdates"/> was `true` or the one passed to <see cref="StartSessionAsync(Solution, ImmutableArray{string}, CancellationToken)"/> 92public async Task<(ImmutableArray<Update> updates, ImmutableArray<Diagnostic> diagnostics)> EmitSolutionUpdateAsync(Solution solution, bool commitUpdates, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\IRemoteUnitTestingSearchService.cs (1)
29public async Task<UnitTestingDocumentSpan?> TryRehydrateAsync(Solution solution, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\LegacySolutionEvents\UnitTestingLegacySolutionEventsListener.cs (1)
30private static IUnitTestingWorkCoordinator? GetCoordinator(Solution solution)
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingSolutionCrawlerRegistrationService.cs (1)
14IUnitTestingWorkCoordinator Register(Solution solution);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerLogger.cs (2)
186public static void LogIncrementalAnalyzerProcessorStatistics(int correlationId, Solution solution, CountLogAggregator<object> logAggregator) 222private static int GetSolutionHash(Solution solution)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (4)
39private Solution _lastReportedSolution = null!; 56public IUnitTestingWorkCoordinator Register(Solution solution) 145var solution = coordinator.Registration.GetSolutionToAnalyze(); 274public Solution GetSolutionToAnalyze()
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (15)
106var solution = Registration.GetSolutionToAnalyze(); 218private void EnqueueSolutionChangedEvent(Solution oldSolution, Solution newSolution) 243private void EnqueueFullSolutionEvent(Solution solution, UnitTestingInvocationReasons invocationReasons) 255private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId) 267private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons) 273private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons) 283private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId) 388var solution = Registration.GetSolutionToAnalyze(); 494var solution = _workCoordinator.Registration.GetSolutionToAnalyze(); 545public string GetLanguagesStringForTelemetry(Solution solution) 591public int GetDocumentCount(Solution solution) 634public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (1)
127var processingSolution = Processor._registration.GetSolutionToAnalyze();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (6)
41private Solution? _lastSolution = null; 200var solution = Processor._registration.GetSolutionToAnalyze(); 320var currentSolution = Processor._registration.GetSolutionToAnalyze(); 321var oldSolution = _lastSolution; 335void ResetLogAggregatorIfNeeded(Solution currentSolution, Solution? oldSolution)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (4)
176var solution = thisDocument.Project.Solution; 223var solution = project.Solution; 300private static IEnumerable<ProjectId> GetProjectsToAnalyze(Solution solution, ProjectId projectId) 418var solution = _registration.GetSolutionToAnalyze();
ExternalAccess\VSTypeScript\Api\VSTypeScriptDiagnosticsUpdatedArgsWrapper.cs (1)
13public Solution? Solution
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
50Solution solution,
ExternalAccess\Watch\Api\WatchHotReloadService.cs (6)
161public async Task StartSessionAsync(Solution solution, CancellationToken cancellationToken) 194/// the one passed to <see cref="StartSessionAsync(Solution, CancellationToken)"/> for the first invocation. 203public async Task<Updates2> GetUpdatesAsync(Solution solution, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, CancellationToken cancellationToken) 260public void UpdateBaselines(Solution solution, ImmutableArray<ProjectId> projectIds) 273public static Solution WithProjectInfo(Solution solution, ProjectInfo info)
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
29var solution = context.Document.Project.Solution;
ExtractClass\ExtractClassWithDialogCodeAction.cs (7)
115var solutionWithUpdatedOriginalType = await GetSolutionWithBaseAddedAsync( 128var finalSolution = await PullMembersUpAsync( 138private async Task<Solution> PullMembersUpAsync( 139Solution solution, 222private static async Task<Solution> GetSolutionWithBaseAddedAsync( 223Solution solution, 229var unformattedSolution = solution;
ExtractInterface\AbstractExtractInterfaceService.cs (17)
35protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync( 36Solution unformattedSolution, 138var solution = refactoringResult.DocumentToExtractFrom.Project.Solution; 174Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol, 194var completedUnformattedSolution = await GetSolutionWithOriginalTypeUpdatedAsync( 204var completedSolution = await GetFormattedSolutionAsync( 216Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol, 234var unformattedSolution = documentWithInterface.Project.Solution; 237var unformattedSolutionWithUpdatedType = await GetSolutionWithOriginalTypeUpdatedAsync( 243var completedSolution = await GetFormattedSolutionAsync( 277private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken) 282var formattedSolution = unformattedSolution; 307private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync( 308Solution solution, 325var unformattedSolution = solution; 352var updatedUnformattedSolution = await UpdateMembersWithExplicitImplementationsAsync(
ExtractInterface\ExtractInterfaceResult.cs (2)
9internal sealed class ExtractInterfaceResult(bool succeeded, Solution updatedSolution = null, DocumentId navigationDocumentId = null) 12public Solution UpdatedSolution { get; } = updatedSolution;
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (1)
51Solution solution,
FindUsages\AbstractFindUsagesService_FindImplementations.cs (5)
44var solution = project.Solution; 76var solution = project.Solution; 95Solution solution, ISymbol symbol, CancellationToken cancellationToken) 142Solution solution, ISymbol symbol, CancellationToken cancellationToken) 170Solution solution, ISymbol symbol, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindReferences.cs (3)
66Solution solution, 132var solution = project.Solution; 222var solution = document.Project.Solution;
FindUsages\DefaultExternalDefinitionItemProvider.cs (1)
23public Task<DefinitionItem?> GetThirdPartyDefinitionItemAsync(Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken)
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
60private async ValueTask<(Project? project, ISymbol? symbol)> TryResolveSymbolAsync(Solution solution, string symbolKey, CancellationToken cancellationToken)
FindUsages\DefinitionItem.DetachedDefinitionItem.cs (1)
78public async Task<DefaultDefinitionItem?> TryRehydrateAsync(Solution solution, CancellationToken cancellationToken)
FindUsages\DefinitionItemFactory.cs (9)
31Solution solution, 37Solution solution, 45Solution solution, 64Solution solution, 78Solution solution, 97Solution solution, 154internal static AssemblyLocation GetMetadataLocation(IAssemblySymbol assembly, Solution solution, out ProjectId originatingProjectId) 164internal static ImmutableArray<AssemblyLocation> GetMetadataLocations(ISymbol definition, Solution solution, out ProjectId? originatingProjectId) 224private static ImmutableArray<DocumentSpan> GetSourceLocations(ISymbol definition, ImmutableArray<Location> locations, Solution solution, bool includeHiddenLocations)
FindUsages\FindUsagesHelpers.cs (1)
29/// <para/> Note that the <see cref="Solution"/> returned may absolutely *not* be the same as
FindUsages\IExternalDefinitionItemProvider.cs (1)
14Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken);
FindUsages\IRemoteFindUsagesService.cs (5)
87internal sealed class FindUsagesServerCallback(Solution solution, IFindUsagesContext context, OptionsProvider<ClassificationOptions> classificationOptions) 89private readonly Solution _solution = solution; 173public async ValueTask<DocumentSpan> RehydrateAsync(Solution solution, CancellationToken cancellationToken) 232public async ValueTask<DefinitionItem.DefaultDefinitionItem> RehydrateAsync(Solution solution, CancellationToken cancellationToken) 305public async Task<SourceReferenceItem> RehydrateAsync(Solution solution, DefinitionItem definition, CancellationToken cancellationToken)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
128Solution originalSolution,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (1)
81var solution = _document.Project.Solution;
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (1)
57var solution = _document.Project.Solution;
GenerateType\AbstractGenerateTypeService.cs (2)
57internal abstract Task<Solution> TryAddUsingsOrImportToDocumentAsync( 58Solution updatedSolution, SyntaxNode modifiedRoot, Document document, TSimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (8)
272var newSolution = projectToBeUpdated.Solution.AddDocument(newDocumentId, documentName, string.Empty, folders, fullFilePath); 349var updatedSolution = projectToBeUpdated.Solution.AddDocument( 372private static Solution AddProjectReference(Project projectToBeUpdated, Project triggeringProject, Solution updatedSolution) 390var solution = _semanticDocument.Project.Solution; 436var solution = _semanticDocument.Project.Solution; 445var updatedSolution = solution.WithDocumentSyntaxRoot(generateTypeOptionsResult.ExistingDocument.Id, newRoot, PreservationMode.PreserveIdentity); 549var solution = _semanticDocument.Project.Solution;
GoToBase\AbstractGoToBaseService.cs (2)
18Solution solution, IMethodSymbol constructor, CancellationToken cancellationToken); 43var solution = project.Solution;
GoToBase\FindBaseHelpers.cs (1)
14ISymbol symbol, Solution solution, CancellationToken cancellationToken)
GoToDefinition\GoToDefinitionFeatureHelpers.cs (2)
19Solution solution, ISymbol? symbol, CancellationToken cancellationToken) 54Solution solution,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
37var solution = document.Project.Solution;
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)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (5)
356private async Task<Solution> AddAllSymbolInitializationsAsync( 377var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 420private async Task<Solution> AddSingleSymbolInitializationAsync( 435var solutionWithAssignmentAdded = documentWithMemberAdded.Project.Solution; 445var finalSolution = solutionWithAssignmentAdded;
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (2)
288private async Task<Solution> InlineMethodAsync(Document document, 336var solution = document.Project.Solution;
Intents\IntentResult.cs (2)
13internal readonly struct IntentProcessorResult(Solution solution, ImmutableArray<DocumentId> changedDocuments, string title, string actionName) 18public readonly Solution Solution = solution;
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (2)
242private async Task<Solution> IntroduceParameterAsync(Document originalDocument, TExpressionSyntax expression, 246var modifiedSolution = originalDocument.Project.Solution;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (3)
75var metadataSolution = metadataWorkspace.CurrentSolution.WithFallbackAnalyzerOptions(sourceWorkspace.CurrentSolution.FallbackAnalyzerOptions); 252private async Task<Location> RelocateSymbol_NoLockAsync(Solution solution, MetadataAsSourceGeneratedFileInfo fileInfo, SymbolKey symbolId, CancellationToken cancellationToken) 344var solution = fileInfo.Workspace.CurrentSolution;
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (10)
68var fixedSolution = await RefactorAndMoveAsync( 120var solutionWithFixedReferences = await RefactorReferencesAsync(projectToLocations, newDoc.Project.Solution, newType, typeArgIndices, cancellationToken).ConfigureAwait(false); 133var movedSolution = await MembersPuller.PullMembersUpAsync(sourceDoc, pullMembersUpOptions, cancellationToken).ConfigureAwait(false); 159private static async Task<Solution> RefactorAndMoveAsync( 162Solution oldSolution, 195var solutionWithFixedReferences = await RefactorReferencesAsync(projectToLocations, oldSolution, newType, typeArgIndices, cancellationToken).ConfigureAwait(false); 216private static async Task<Solution> RefactorReferencesAsync( 218Solution solution, 224var updatedSolution = solution; 345Solution solution,
MoveToNamespace\AbstractMoveToNamespaceService.cs (7)
226var originalSolution = document.Project.Solution; 228var changedSolution = await changeNamespaceService.ChangeNamespaceAsync( 249var modifiedSolution = await moveTypeService.GetModifiedSolutionAsync( 259var mergedSolution = await PropagateChangeToLinkedDocumentsAsync(modifiedDocument, formattingOptions, cancellationToken).ConfigureAwait(false); 275private static async Task<Solution> PropagateChangeToLinkedDocumentsAsync(Document document, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken) 280var solution = formattedDocument.Project.Solution; 282var finalSolution = solution.WithDocumentTexts(
MoveToNamespace\MoveToNamespaceResult.cs (4)
16public Solution UpdatedSolution { get; } 17public Solution OriginalSolution { get; } 23Solution originalSolution, 24Solution updatedSolution,
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
59Solution solution,
NavigateTo\AbstractNavigateToSearchService.cs (1)
37Solution solution, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
21Solution solution,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (3)
33var solution = document.Project.Solution; 107var solution = document.Project.Solution; 145Solution solution,
NavigateTo\INavigateToSearcherHost.cs (2)
35Solution solution, 39private readonly Solution _solution = solution;
NavigateTo\INavigateToSearchService.cs (3)
36Solution solution, 63Solution solution, 82Solution solution,
NavigateTo\NavigateToSearcher.cs (5)
46private readonly Solution _solution; 59Solution solution, 94Solution solution, 106Solution solution, 535public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
NavigateTo\NavigateToUtilities.cs (1)
16public static ImmutableHashSet<string> GetKindsProvided(Solution solution)
NavigateTo\RoslynNavigateToItem.cs (2)
71Solution solution, Document? activeDocument, CancellationToken cancellationToken) 148var solution = firstProject.Solution;
Navigation\AbstractNavigableItemsService.cs (2)
43async Task<(ISymbol symbol, Solution solution)?> GetSymbolAsync(Document document) 49var solution = project.Solution;
Navigation\INavigableItem.cs (3)
68internal ValueTask<Document> GetRequiredDocumentAsync(Solution solution, CancellationToken cancellationToken) 77internal async ValueTask<SourceText> GetTextAsync(Solution solution, CancellationToken cancellationToken) 83internal SourceText? TryGetTextSynchronously(Solution solution, CancellationToken cancellationToken)
Navigation\NavigableItemFactory.cs (3)
18Solution solution, ISymbol symbol, Location location, 26Solution solution, 37Solution solution, ISymbol symbol, CancellationToken cancellationToken)
Navigation\NavigableItemFactory.SymbolLocationNavigableItem.cs (2)
19Solution solution, 24private readonly Solution _solution = solution;
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)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (2)
268var pendingSolution = metadataWorkspace.CurrentSolution; 449var solution = info.SourceWorkspace.CurrentSolution;
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
81Solution solution,
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (1)
42var changedSolution = await MembersPuller.PullMembersUpAsync(_document, pullMemberUpOptions, cancellationToken).ConfigureAwait(false);
PullMemberUp\MemberAndDestinationValidator.cs (1)
14public static bool IsDestinationValid(Solution solution, INamedTypeSymbol destination, CancellationToken cancellationToken)
PullMemberUp\MembersPuller.cs (5)
59public static Task<Solution> PullMembersUpAsync( 91private static async Task<Solution> PullMembersIntoInterfaceAsync( 96var solution = document.Project.Solution; 266private static async Task<Solution> PullMembersIntoClassAsync( 271var solution = document.Project.Solution;
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
84var solution = document.Project.Solution;
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
70var solution = document.Project.Solution;
Rename\SymbolicRenameInfo.cs (1)
222var solution = document.Project.Solution;
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,
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (14)
71private async Task<Solution> ReplacePropertyWithMethodsAsync( 84var originalSolution = document.Project.Solution; 102var updatedSolution = originalSolution; 191private async Task<Solution> UpdateReferencesAsync( 192Solution updatedSolution, 210private async Task<Solution> UpdateReferencesInDocumentAsync( 211Solution updatedSolution, 293private static async Task<Solution> ReplaceDefinitionsWithMethodsAsync( 294Solution originalSolution, 295Solution updatedSolution, 316Solution originalSolution, 343private static async Task<Solution> ReplaceDefinitionsWithMethodsAsync( 344Solution updatedSolution, 394Solution updatedSolution,
SemanticSearch\AbstractSemanticSearchService.cs (1)
147Solution solution,
SemanticSearch\IRemoteSemanticSearchService.cs (2)
57internal sealed class ServerCallback(Solution solution, ISemanticSearchResultsObserver observer, OptionsProvider<ClassificationOptions> classificationOptions) 142public static async ValueTask<ExecuteQueryResult> ExecuteQueryAsync(Solution solution, CompiledQueryId queryId, ISemanticSearchResultsObserver results, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
SemanticSearch\ISemanticSearchService.cs (1)
36Solution solution,
SemanticSearch\QueryExecutionContext.cs (1)
45public async Task InvokeAsync(Solution solution, QueryKind queryKind, CancellationToken cancellationToken)
SemanticSearch\SemanticSearchUtilities.cs (4)
71public static Document GetQueryDocument(Solution solution) 74public static ProjectId GetQueryProjectId(Solution solution) 77public static Project GetQueryProject(Solution solution) 80public static DocumentId GetQueryDocumentId(Solution solution)
SemanticSearch\Tools\ReferencingSyntaxFinder.cs (2)
19internal sealed class ReferencingSyntaxFinder(Solution solution, CancellationToken cancellationToken) 54private static Task FindReferencesAsync(Action<ReferenceLocation> callback, (Solution solution, ISymbol symbol) args, CancellationToken cancellationToken)
SemanticSearch\Tools\SemanticModelGetter.cs (2)
11internal sealed class SemanticModelGetter(Solution solution, CancellationToken cancellationToken) 14/// Returns <see cref="SemanticModel"/> for any <see cref="SyntaxTree"/> in the <see cref="Solution"/>.
Shared\Extensions\DocumentExtensions.cs (1)
81var solution = document.Project.Solution;
Shared\Utilities\AnnotatedSymbolMapping.cs (4)
17Solution annotatedSolution, 30public Solution AnnotatedSolution { get; } = annotatedSolution; 49Solution solution, 97var annotatedSolution = solution;
Shared\Utilities\ExtractTypeHelpers.cs (2)
51Solution solution, 63var solutionWithInterfaceDocument = solution.AddDocument(newDocumentId, fileName, text: "", folders: folders, filePath: newDocumentPath);
Shared\Utilities\SupportedPlatformData.cs (2)
13internal sealed class SupportedPlatformData(Solution solution, ImmutableArray<ProjectId> invalidProjects, ImmutableArray<ProjectId> candidateProjects) 20public readonly Solution Solution = solution;
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
346? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken)) 374private async Task<Solution> FixAsync(
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (7)
77public static async Task<Solution> AddParameterAsync<TExpressionSyntax>( 89var solution = invocationDocument.Project.Solution; 158async Task<Solution> AddConstructorAssignmentsAsync(Solution rewrittenSolution) 160var finalSolution = await TryAddConstructorAssignmentsAsync(rewrittenSolution).ConfigureAwait(false); 164async Task<Solution?> TryAddConstructorAssignmentsAsync(Solution rewrittenSolution)
src\Analyzers\Core\CodeFixes\AddParameter\CodeFixData.cs (4)
13Func<CancellationToken, Task<Solution>> createChangedSolutionNonCascading, 14Func<CancellationToken, Task<Solution>>? createChangedSolutionCascading) 25public Func<CancellationToken, Task<Solution>> CreateChangedSolutionNonCascading { get; } = createChangedSolutionNonCascading ?? throw new ArgumentNullException(nameof(createChangedSolutionNonCascading)); 30public Func<CancellationToken, Task<Solution>>? CreateChangedSolutionCascading { get; } = createChangedSolutionCascading;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
88var solution = _project.Solution; 126var solution = _project.Solution;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
42protected override Task<Solution?> GetChangedSolutionAsync(
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (5)
101private async Task<Solution> FixNodeAsync( 153private async Task<Solution> RenameThenAddAsyncTokenAsync( 163var solution = document.Project.Solution; 169var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false); 183private async Task<Solution> AddAsyncTokenAsync(
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\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 63var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (3)
65private static async Task<Solution> FixAllByDocumentAsync( 66Solution solution, 82var newSolution = solution;
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (6)
103private static async Task<Solution> FixAsync( 114private readonly Solution _startingSolution; 120private readonly Func<CancellationToken, Task<Solution>> _createChangedSolutionAsync; 132Solution startingSolution, 137Func<CancellationToken, Task<Solution>> createChangedSolutionAsync, 155var newSolution = await _createChangedSolutionAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (2)
57private static async Task<Solution> UnsealDeclarationsAsync( 58Solution solution, ImmutableArray<SyntaxReference> declarationReferences, 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)
StackTraceExplorer\IStackTraceExplorerService.cs (2)
19(TextDocument? document, int line) GetDocumentAndLine(Solution solution, ParsedFrame frame); 20Task<DefinitionItem?> TryFindDefinitionAsync(Solution solution, ParsedFrame frame, StackFrameSymbolPart symbolPart, CancellationToken cancellationToken);
StackTraceExplorer\StackTraceExplorerService.cs (3)
27public (TextDocument? document, int line) GetDocumentAndLine(Solution solution, ParsedFrame frame) 43public async Task<DefinitionItem?> TryFindDefinitionAsync(Solution solution, ParsedFrame frame, StackFrameSymbolPart symbolPart, CancellationToken cancellationToken) 75private static ImmutableArray<TextDocument> GetFileMatches(Solution solution, StackFrameCompilationUnit root, out int lineNumber)
StackTraceExplorer\StackTraceExplorerUtilities.cs (1)
24public static async Task<DefinitionItem?> GetDefinitionAsync(Solution solution, StackFrameCompilationUnit compilationUnit, StackFrameSymbolPart symbolPart, CancellationToken cancellationToken)
SymbolMapping\SymbolMappingResult.cs (1)
21public Solution Solution => Project.Solution;
SyncNamespaces\AbstractSyncNamespacesService.cs (4)
32public async Task<Solution> SyncNamespacesAsync( 40var solution = projects[0].Solution; 96Solution solution, 136private static async Task<Solution> ApplyCodeFixAsync(
SyncNamespaces\ISyncNamespacesService.cs (1)
19Task<Solution> SyncNamespacesAsync(
UnusedReferences\IUnusedReferenceAnalysisService.cs (1)
15Solution solution,
UnusedReferences\UnusedReferencesRemover.cs (2)
26Solution solution, 264Solution solution,
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (12)
70var solution = context.Document.Project.Solution; 89private async Task<Solution> ProcessResultAsync( 90Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken) 102private async Task<Solution> ProcessResultWorkerAsync( 103Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken) 284var updatedSolution = currentSolution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot); 293Solution originalSolution, 294Solution currentSolution, 356Solution solution, 409Solution solution,
UseAutoProperty\UseAutoPropertyFixAllProvider.cs (3)
31private async Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalContext, ImmutableArray<FixAllContext> contexts) 55var originalSolution = originalContext.Solution; 56var currentSolution = originalSolution;
ValueTracking\IValueTrackingService.cs (1)
16Task<ImmutableArray<ValueTrackedItem>> TrackValueSourceAsync(Solution solution, ValueTrackedItem previousTrackedItem, CancellationToken cancellationToken);
ValueTracking\SerializableValueTrackedItem.cs (2)
32public static SerializableValueTrackedItem Dehydrate(Solution solution, ValueTrackedItem valueTrackedItem, CancellationToken cancellationToken) 43public async ValueTask<ValueTrackedItem> RehydrateAsync(Solution solution, CancellationToken cancellationToken)
ValueTracking\ValueTrackedItem.cs (1)
44public static async ValueTask<ValueTrackedItem?> TryCreateAsync(Solution solution, Location location, ISymbol symbol, ValueTrackedItem? parent = null, CancellationToken cancellationToken = default)
ValueTracking\ValueTracker.cs (3)
36var solution = document.Project.Solution; 74Solution solution, 321private static async Task<ISymbol?> GetSymbolAsync(ValueTrackedItem? item, Solution solution, CancellationToken cancellationToken)
ValueTracking\ValueTracker.OperationCollector.cs (2)
19private sealed class OperationCollector(ValueTrackingProgressCollector progressCollector, Solution solution) 22public Solution Solution { get; } = solution;
ValueTracking\ValueTrackingProgressCollector.cs (1)
40internal async Task<bool> TryReportAsync(Solution solution, Location location, ISymbol symbol, CancellationToken cancellationToken = default)
ValueTracking\ValueTrackingService.cs (2)
36var solution = document.Project.Solution; 58Solution solution,
Workspace\CompileTimeSolutionProvider.cs (9)
61private readonly ConditionalWeakTable<Solution, Solution> _designTimeToCompileTimeSolution = []; 66private Solution? _lastCompileTimeSolution; 90public Solution GetCompileTimeSolution(Solution designTimeSolution) 94_designTimeToCompileTimeSolution.TryGetValue(designTimeSolution, out var cachedCompileTimeSolution); 100var staleSolution = _lastCompileTimeSolution; 101var compileTimeSolution = designTimeSolution; 175Solution compileTimeSolution,
Workspace\ICompileTimeSolutionProvider.cs (2)
14Solution GetCompileTimeSolution(Solution designTimeSolution);
Microsoft.CodeAnalysis.Features.Test.Utilities (33)
EditAndContinue\EditAndContinueTestVerifier.cs (3)
465var oldSolution = workspace.CurrentSolution; 480var newSolution = oldProject.Solution; 547public static void SetDocumentsState(DebuggingSession session, Solution solution, CommittedSolution.DocumentState state)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (9)
69internal TestWorkspace CreateWorkspace(out Solution solution, out EditAndContinueService service, Type[]? additionalParts = null) 84internal static (Solution, Document) AddDefaultTestProject( 85Solution solution, 96internal static Project AddEmptyTestProject(Solution solution) 101internal static Solution AddDefaultTestProject( 102Solution solution, 170Solution solution, 224Solution solution, 237Solution solution,
EditAndContinue\Extensions.cs (5)
57public static Project AddTestProject(this Solution solution, string projectName, out ProjectId id) 60public static Project AddTestProject(this Solution solution, string projectName, string language, out ProjectId id) 63public static Project AddTestProject(this Solution solution, string projectName, string language, TargetFramework targetFramework, out ProjectId id) 70public static Project AddTestProject(this Solution solution, string projectName, string language = LanguageNames.CSharp, TargetFramework targetFramework = TargetFramework.NetLatest, ProjectId? id = null) 87public static Document AddTestDocument(this Solution solution, ProjectId projectId, string source, string path, out DocumentId id)
EditAndContinue\MockActiveStatementSpanProvider.cs (2)
14public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 17public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\MockEditAndContinueService.cs (8)
20public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 23public Func<Solution, IManagedHotReloadService, IPdbMatchingSourceTextProvider, ImmutableArray<DocumentId>, bool, bool, DebuggingSessionId>? StartDebuggingSessionImpl; 26public Func<Solution, ImmutableDictionary<ProjectId, RunningProjectInfo>, ActiveStatementSpanProvider, EmitSolutionUpdateResults>? EmitSolutionUpdateImpl; 29public Action<Solution, ImmutableArray<ProjectId>>? UpdateBaselinesImpl; 43public void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects) 46public ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ImmutableDictionary<ProjectId, RunningProjectInfo> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken) 52public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 64public ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken)
Workspaces\TestSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (6)
24public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 31public Solution _startingSolution; 32public Solution _updatedSolution; 34public Operation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
Microsoft.CodeAnalysis.Features.UnitTests (138)
EditAndContinue\ActiveStatementsMapTests.cs (3)
118var solution = workspace.CurrentSolution 175var solution = workspace.CurrentSolution 228var solution = workspace.CurrentSolution
EditAndContinue\CompileTimeSolutionProviderTests.cs (4)
41var designTimeSolution = workspace.CurrentSolution. 61var compileTimeSolution = provider.GetCompileTimeSolution(designTimeSolution); 123var compileTimeSolution1 = provider.GetCompileTimeSolution(workspace.CurrentSolution); 138var compileTimeSolution2 = provider.GetCompileTimeSolution(workspace.CurrentSolution);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (78)
80using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 168using var _ = CreateWorkspace(out var solution, out var service); 202using var _ = CreateWorkspace(out var solution, out var service); 236using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 271using var _ = CreateWorkspace(out var solution, out var service); 308using var _ = CreateWorkspace(out var solution, out var service); 342using var _ = CreateWorkspace(out var solution, out var service); 393using var _ = CreateWorkspace(out var solution, out var service); 496using var _w = CreateWorkspace(out var solution, out var service); 568using var _ = CreateWorkspace(out var solution, out var service); 621using var _ = CreateWorkspace(out var solution, out var service); 680using var _ = CreateWorkspace(out var solution, out var service); 745using var _ = CreateWorkspace(out var solution, out var service); 776using var w = CreateWorkspace(out var solution, out var service); 832using var _ = CreateWorkspace(out var solution, out var service); 884using var _ = CreateWorkspace(out var solution, out var service); 912using var _ = CreateWorkspace(out var solution, out var service); 987using var workspace = CreateWorkspace(out var solution, out var service); 1032using var _ = CreateWorkspace(out var solution, out var service); 1098using var _ = CreateWorkspace(out var solution, out var service); 1165using var _ = CreateWorkspace(out var solution, out var service); 1213using var _ = CreateWorkspace(out var solution, out var service); 1319using var _ = CreateWorkspace(out var solution, out var service); 1362using var _ = CreateWorkspace(out var solution, out var service); 1418using var _ = CreateWorkspace(out var solution, out var service); 1536using var _ = CreateWorkspace(out var solution, out var service); 1576using var _ = CreateWorkspace(out var solution, out var service); 1620using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 1653var oldSolution = solution; 1697using var _ = CreateWorkspace(out var solution, out var service); 1752var oldSolution = solution; 1877using var _ = CreateWorkspace(out var solution, out var service); 1928var oldSolution = solution; 1970using var _ = CreateWorkspace(out var solution, out var service); 2051using var _ = CreateWorkspace(out var solution, out var service); 2153using var _ = CreateWorkspace(out var solution, out var service); 2197using var _ = CreateWorkspace(out var solution, out var service); 2234using var _ = CreateWorkspace(out var solution, out var service); 2305using var _ = CreateWorkspace(out var solution, out var service); 2390using var _ = CreateWorkspace(out var solution, out var service); 2462using var _ = CreateWorkspace(out var solution, out var service); 2523using var _ = CreateWorkspace(out var solution, out var service); 2572using var _ = CreateWorkspace(out var solution, out var service); 2708using var _ = CreateWorkspace(out var solution, out var service); 2818using var _ = CreateWorkspace(out var solution, out var service); 2871using var _ = CreateWorkspace(out var solution, out var service); 2962using var _ = CreateWorkspace(out var solution, out var service); 3057using var workspace = CreateWorkspace(out var solution, out var service); 3113using var workspace = CreateWorkspace(out var solution, out var service); 3174using var _ = CreateWorkspace(out var solution, out var service); 3231using var _ = CreateWorkspace(out var solution, out var service); 3284using var _ = CreateWorkspace(out var solution, out var service); 3334using var _ = CreateWorkspace(out var solution, out var service); 3376using var _ = CreateWorkspace(out var solution, out var service); 3413using var _ = CreateWorkspace(out var solution, out var service); 3448using var _ = CreateWorkspace(out var solution, out var service); 3507using var _ = CreateWorkspace(out var solution, out var service); 3648using var _ = CreateWorkspace(out var solution, out var service); 3745using var _ = CreateWorkspace(out var solution, out var service); 3789using var _ = CreateWorkspace(out var solution, out var service); 3824using var _ = CreateWorkspace(out var solution, out var service); 3865using var _ = CreateWorkspace(out var solution, out var service); 3949using var _ = CreateWorkspace(out var solution, out var service); 4006using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 4077using var _ = CreateWorkspace(out var solution, out var service); 4180using var _ = CreateWorkspace(out var solution, out var service); 4281using var _ = CreateWorkspace(out var solution, out var service); 4370using var _ = CreateWorkspace(out var solution, out var service); 4456using var _ = CreateWorkspace(out var solution, out var service); 4575using var _ = CreateWorkspace(out var solution, out var service); 4694using var _ = CreateWorkspace(out var solution, out var service); 4799using var workspace = CreateWorkspace(out var solution, out var service); 4816var modifiedSolution = await moveTypeService.GetModifiedSolutionAsync(document, span, MoveTypeOperationKind.MoveType, cancellationToken: default); 4844using var _ = CreateWorkspace(out var solution, out var encService); 4870var solution1 = solution.WithDocumentText(documentIdA, CreateText("class C { void M() { System.Console.WriteLine(" + i + "); } }")); 4877var solution2 = solution1.WithDocumentText(documentIdA, CreateText(source3)); 4894using var _1 = CreateWorkspace(out var solution, out var service); 4930using var workspace = CreateWorkspace(out var solution, out var service);
EditAndContinue\EditSessionActiveStatementsTests.cs (7)
34Solution solution, 68private static async Task<Solution> AddDefaultTestSolutionAsync(TestWorkspace workspace, string[] markedSources) 70var solution = workspace.CurrentSolution; 180var solution = await AddDefaultTestSolutionAsync(workspace, markedSources); 348var solution = await AddDefaultTestSolutionAsync(workspace, [baseSource]); 528var solution = await AddDefaultTestSolutionAsync(workspace, [markedSourceV2]); 669var solution = await AddDefaultTestSolutionAsync(workspace, markedSources);
EditAndContinue\EmitSolutionUpdateResultsTests.cs (15)
26private static TestWorkspace CreateWorkspace(out Solution solution) 79var solution = document.Project.Solution; 163using var _ = CreateWorkspace(out var solution); 186using var _ = CreateWorkspace(out var solution); 211using var _ = CreateWorkspace(out var solution); 241using var _ = CreateWorkspace(out var solution); 267using var _ = CreateWorkspace(out var solution); 300using var _ = CreateWorkspace(out var solution); 327using var _ = CreateWorkspace(out var solution); 350using var _ = CreateWorkspace(out var solution); 381using var _ = CreateWorkspace(out var solution); 432using var _ = CreateWorkspace(out var solution); 463using var _ = CreateWorkspace(out var solution); 501using var _ = CreateWorkspace(out var solution); 545using var _ = CreateWorkspace(out var solution);
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
85var solution = localWorkspace.CurrentSolution;
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
29using var workspace = CreateWorkspace(out var solution, out var encService);
FindUsages\DefinitionItemFactoryTests.cs (29)
132var solution = workspace.CurrentSolution; 168var solution = workspace.CurrentSolution; 210var solution = workspace.CurrentSolution; 246var solution = workspace.CurrentSolution; 288var solution = workspace.CurrentSolution; 330var solution = workspace.CurrentSolution; 383var solution = workspace.CurrentSolution; 437var solution = workspace.CurrentSolution; 477var solution = workspace.CurrentSolution; 517var solution = workspace.CurrentSolution; 559var solution = workspace.CurrentSolution; 617var solution = workspace.CurrentSolution; 663var solution = workspace.CurrentSolution; 700var solution = workspace.CurrentSolution; 762var solution = workspace.CurrentSolution; 818var solution = workspace.CurrentSolution; 872var solution = workspace.CurrentSolution; 927var solution = workspace.CurrentSolution; 977var solution = workspace.CurrentSolution; 1032var solution = workspace.CurrentSolution; 1084var solution = workspace.CurrentSolution; 1146var solution = workspace.CurrentSolution; 1203var solution = workspace.CurrentSolution; 1260var solution = workspace.CurrentSolution; 1332var solution = workspace.CurrentSolution; 1392var solution = workspace.CurrentSolution; 1444var solution = workspace.CurrentSolution; 1507var solution = workspace.CurrentSolution; 1578var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.LanguageServer (1)
LanguageServer\Handler\Restore\RestoreHandler.cs (1)
105private static ImmutableArray<string> GetRestorePaths(RestoreParams request, Solution solution, RequestContext context)
Microsoft.CodeAnalysis.LanguageServer.Protocol (72)
Extensions\Extensions.cs (8)
71public static ImmutableArray<TextDocument> GetTextDocuments(this Solution solution, DocumentUri documentUri) 82public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, DocumentUri documentUri) 106public static async ValueTask<Document?> GetDocumentAsync(this Solution solution, TextDocumentIdentifier documentIdentifier, CancellationToken cancellationToken) 116public static async ValueTask<TextDocument?> GetTextDocumentAsync(this Solution solution, TextDocumentIdentifier documentIdentifier, CancellationToken cancellationToken) 164public static T FindDocumentInProjectContext<T>(this ImmutableArray<T> documents, TextDocumentIdentifier documentIdentifier, Func<Solution, DocumentId, T> documentGetter) where T : TextDocument 171var solution = documents.First().Project.Solution; 178public static Project? GetProject(this Solution solution, TextDocumentIdentifier projectIdentifier) 192public static TextDocument? GetAdditionalDocument(this Solution solution, TextDocumentIdentifier documentIdentifier)
Extensions\ProtocolConversions.cs (2)
392public static async Task<LSP.TextDocumentEdit[]> ChangedDocumentsToTextDocumentEditsAsync(IEnumerable<DocumentId> changedDocuments, Solution newSolution, 393Solution oldSolution, IDocumentTextDifferencingService? textDiffService, CancellationToken cancellationToken)
Extensions\SourceGeneratedDocumentUri.cs (1)
51public static SourceGeneratedDocumentIdentity? DeserializeIdentity(Solution solution, Uri documentUri)
ExternalAccess\Razor\FormatNewFileHandler.cs (1)
55var solution = project.Solution.AddDocument(
Features\CodeCleanup\AbstractCodeCleanupService.cs (1)
183var solution = await fixAllService.GetFixAllChangedSolutionAsync(
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (2)
27var designTimeSolution = designTimeDocument.Project.Solution; 40var compileTimeSolution = services.GetRequiredService<ICompileTimeSolutionProvider>().GetCompileTimeSolution(designTimeSolution);
Features\EditAndContinue\EditAndContinueDiagnosticSource_Workspace.cs (1)
38public static async ValueTask<ImmutableArray<IDiagnosticSource>> CreateWorkspaceDiagnosticSourcesAsync(Solution solution, Func<Document, bool> isDocumentOpen, CancellationToken cancellationToken)
Features\Options\ClientFallbackAnalyzerConfigOptionsProvider.cs (1)
15/// Flows editorconfig options stored by <see cref="IGlobalOptionService"/> to <see cref="Solution.FallbackAnalyzerOptions"/> whenever a new language is added to one of the target workspaces.
Features\Options\SolutionAnalyzerConfigOptionsUpdater.cs (3)
22/// Keeps <see cref="Solution.FallbackAnalyzerOptions"/> up-to-date with global option values maintained by <see cref="IGlobalOptionService"/>. 51Solution UpdateOptions(Solution oldSolution)
Features\UnifiedSuggestions\UnifiedSuggestedActionSet.cs (2)
17public Solution OriginalSolution { get; } 30Solution originalSolution,
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (11)
43var originalSolution = document.Project.Solution; 66Solution originalSolution, 87Solution originalSolution, 99Solution originalSolution, 129Solution originalSolution, 145async Task<IUnifiedSuggestedAction> GetUnifiedSuggestedActionAsync(Solution originalSolution, CodeAction action, CodeFix fix) 215Solution originalSolution, 279Solution originalSolution, 387Solution originalSolution, 511var originalSolution = document.Project.Solution; 600var originalSolution = document.Project.Solution;
Handler\CodeActions\CodeActionResolveHandler.cs (1)
76var solution = document.Project.Solution;
Handler\CodeActions\CodeActionResolveHelper.cs (5)
26var solution = context.Solution; 38public static async Task<LSP.WorkspaceEdit> GetCodeActionResolveEditsAsync(Solution solution, CodeActionResolveData data, ImmutableArray<CodeActionOperation> operations, ResourceOperationKind[] resourceOperations, Action<string> logFunction, CancellationToken cancellationToken) 65var newSolution = await applyChangesOperation.ChangedSolution.WithMergedLinkedFileChangesAsync(solution, changes, cancellationToken: cancellationToken).ConfigureAwait(false); 326private static bool HasDocumentNameChange(DocumentId documentId, Solution newSolution, Solution oldSolution)
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (2)
221Solution solution, 246static async Task<ProjectOrDocumentId?> GetIdForPreviousResultAsync(TextDocumentIdentifier textDocumentIdentifier, Solution solution, CancellationToken cancellationToken)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDiagnosticSourceHelpers.cs (2)
15public static IEnumerable<Project> GetProjectsInPriorityOrder(Solution solution, ImmutableArray<string> supportedLanguages) 22static IEnumerable<Project?> GetProjectsInPriorityOrderWorker(Solution solution)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDocumentsAndProjectDiagnosticSourceProvider.cs (1)
56var solution = context.Solution;
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (1)
17public Solution Solution => this.Document.Project.Solution;
Handler\Diagnostics\DiagnosticSources\AbstractProjectDiagnosticSource.cs (1)
18protected Solution Solution => this.Project.Solution;
Handler\Extensions\ActivateExtensionHandler.cs (1)
27var solution = context.Solution;
Handler\Extensions\DispatchDocumentExtensionMessageHandler.cs (1)
31var solution = context.Document.Project.Solution;
Handler\Extensions\DispatchWorkspaceExtensionMessageHandler.cs (1)
27var solution = context.Solution;
Handler\PullHandlers\VersionedPullCache.cs (1)
95private static async Task<bool> IsFullyLoadedAsync(Solution solution, CancellationToken cancellationToken)
Handler\RelatedDocuments\RelatedDocumentsHandler.cs (1)
44var solution = context.Solution;
Handler\Rename\RenameHandler.cs (2)
35var oldSolution = document.Project.Solution; 67var renamedSolution = renameReplacementInfo.NewSolution;
Handler\RequestContext.cs (5)
56private readonly StrongBox<(Workspace Workspace, Solution Solution, TextDocument? Document)>? _lspSolution; 83public Solution? Solution 167Solution? solution, 182_lspSolution = new StrongBox<(Workspace Workspace, Solution Solution, TextDocument? Document)>((workspace, solution, document)); 257Solution? solution = null;
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
37var solution = context.Solution;
Handler\Symbols\WorkspaceSymbolsHandler.cs (2)
54var solution = context.Solution; 80var solution = context.Solution;
Workspaces\ILspWorkspace.cs (1)
17/// overlay, where it uses the <see cref="Solution"/> snapshot from the VS workspace, but then forks it in any cases
Workspaces\LspWorkspaceManager.cs (10)
56private readonly Dictionary<Workspace, (int? forkedFromVersion, Solution solution)> _cachedLspSolutions = []; 227public async Task<(Workspace?, Solution?)> GetLspSolutionInfoAsync(CancellationToken cancellationToken) 245public async Task<(Workspace?, Solution?, TextDocument?)> GetLspDocumentInfoAsync(TextDocumentIdentifier textDocumentIdentifier, CancellationToken cancellationToken) 309private async Task<ImmutableArray<(Workspace workspace, Solution Solution, bool IsForked)>> GetLspSolutionsAsync(CancellationToken cancellationToken) 321var solutions = new FixedSizeArrayBuilder<(Workspace, Solution, bool)>(registeredWorkspaces.Length); 334async Task<(Solution Solution, bool IsForked)> GetLspSolutionForWorkspaceAsync(Workspace workspace, CancellationToken cancellationToken) 336var workspaceCurrentSolution = workspace.CurrentSolution; 406var lspSolution = workspaceCurrentSolution; 464Solution workspaceSolution) 542private static ImmutableDictionary<DocumentUri, ImmutableArray<TextDocument>> GetDocumentsForUris(ImmutableArray<DocumentUri> trackedDocuments, Solution workspaceCurrentSolution)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (22)
Completion\CompletionTests.cs (5)
309var solution = testLspServer.TestWorkspace.CurrentSolution; 493var solution = testLspServer.GetCurrentSolution(); 532var solution = testLspServer.GetCurrentSolution(); 571var solution = testLspServer.GetCurrentSolution(); 631var solution = testLspServer.GetCurrentSolution();
Diagnostics\AdditionalFileDiagnosticsTests.cs (2)
76var initialSolution = testLspServer.GetCurrentSolution(); 77var newSolution = initialSolution.RemoveAdditionalDocument(initialSolution.Projects.Single().AdditionalDocumentIds.Single());
Diagnostics\PullDiagnosticTests.cs (2)
240var solution = document.Project.Solution; 1094var solution = testLspServer.TestWorkspace.CurrentSolution;
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (2)
53var initialSolution = testLspServer.GetCurrentSolution(); 54var newSolution = initialSolution.RemoveProject(initialSolution.Projects.First().Id);
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (3)
39var solution = await GetLSPSolutionAsync(testLspServer, caretLocation.DocumentUri).ConfigureAwait(false); 84var solution = await GetLSPSolutionAsync(testLspServer, caretLocation.DocumentUri).ConfigureAwait(false); 104private static async Task<Solution> GetLSPSolutionAsync(TestLspServer testLspServer, DocumentUri uri)
Ordering\RequestOrderingTests.cs (4)
191var expectedSolution = testLspServer.GetCurrentSolution(); 194var solution = await GetLSPSolution(testLspServer, NonMutatingRequestHandler.MethodName); 243var solution = await GetLSPSolution(testLspServer, NonLSPSolutionRequestHandler.MethodName); 267private static async Task<Solution?> GetLSPSolution(TestLspServer testLspServer, string methodName)
SpellCheck\SpellCheckTests.cs (1)
124var solution = document.Project.Solution;
Symbols\WorkspaceSymbolsTests.cs (1)
246private static string GetContainerName(Solution solution, string? containingSymbolName = null)
Workspaces\LspWorkspaceManagerTests.cs (2)
224var newSolution = testLspServer.TestWorkspace.CurrentSolution.AddDocument(newDocumentId, "NewDoc.cs", SourceText.From("New Doc", System.Text.Encoding.UTF8, SourceHashAlgorithms.Default), filePath: @"C:\NewDoc.cs"); 780private static Task<(Workspace?, Solution?)> GetLspHostWorkspaceAndSolutionAsync(TestLspServer testLspServer)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (30)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (19)
AnnotatePublicApiFix.cs (5)
71static async Task<Solution?> GetFixAsync(TextDocument publicSurfaceAreaDocument, string oldSymbolName, string newSymbolName, CancellationToken cancellationToken) 106private readonly Solution _solution; 108public FixAllAdditionalDocumentChangeAction(string title, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix) 117protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 188Solution newSolution = _solution;
DeclarePublicApiFix.cs (9)
97private static async Task<Solution?> GetFixAsync(TextDocument? surfaceAreaDocument, bool isPublic, Project project, string newSymbolName, ImmutableHashSet<string> siblingSymbolNamesToRemove, CancellationToken cancellationToken) 114private static Solution AddPublicApiFiles(Project project, SourceText unshippedText, bool isPublic) 202private readonly Func<CancellationToken, Task<Solution?>> _createChangedAdditionalDocument; 204public AdditionalDocumentChangeAction(string title, DocumentId? apiDocId, bool isPublic, Func<CancellationToken, Task<Solution?>> createChangedAdditionalDocument) 215protected override Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 226private readonly Solution _solution; 228public FixAllAdditionalDocumentChangeAction(string title, DocumentId? apiDocId, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, bool isPublic) 239protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 323Solution newSolution = _solution;
NullableEnablePublicApiFix.cs (5)
56private static async Task<Solution?> GetFixAsync(TextDocument surfaceAreaDocument, CancellationToken cancellationToken) 74private readonly Solution _solution; 76public FixAllAdditionalDocumentChangeAction(string title, Solution solution, List<Project> projectsToFix) 85protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 109Solution newSolution = _solution;
Microsoft.CodeAnalysis.Remote.ServiceHub (87)
ExternalAccess\Pythia\Api\PythiaBrokeredServiceImplementation.cs (2)
22public static ValueTask<Solution> GetSolutionAsync(this PythiaPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, CancellationToken cancellationToken) 25public static ValueTask<T> RunServiceAsync<T>(this PythiaPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
ExternalAccess\Razor\Api\RazorBrokeredServiceImplementation.cs (1)
21public static ValueTask<T> RunServiceAsync<T>(this RazorPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingBrokeredServiceImplementation.cs (1)
27public static ValueTask<T> RunServiceAsync<T>(this UnitTestingPinnedSolutionInfoWrapper solutionInfo, ServiceBrokerClient client, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken)
Host\RemoteWorkspace.cs (24)
67/// cref="Solution"/> snapshot for it, and then invokes <paramref name="implementation"/> with that snapshot. That 78public ValueTask<(Solution solution, T result)> RunWithSolutionAsync<T>( 81Func<Solution, ValueTask<T>> implementation, 87private async ValueTask<(Solution solution, T result)> RunWithSolutionAsync<T>( 91Func<Solution, ValueTask<T>> implementation, 117async ValueTask<(InFlightSolution inFlightSolution, Task<Solution> solutionTask)> AcquireSolutionAndIncrementInFlightCountAsync() 141async ValueTask<(Solution solution, T result)> ProcessSolutionAsync(InFlightSolution inFlightSolution, Task<Solution> solutionTask) 149var solution = await solutionTask.WithCancellation(cancellationToken).ConfigureAwait(false); 205private async Task<Solution> GetOrCreateSolutionToUpdateAsync( 211var currentSolution = this.CurrentSolution; 235/// Create an appropriate <see cref="Solution"/> instance corresponding to the <paramref 251private async Task<Solution> ComputeDisconnectedSolutionAsync( 258var solutionToUpdate = await GetOrCreateSolutionToUpdateAsync( 271private Solution CreateSolutionFromInfo(SolutionInfo solutionInfo) 273var solution = this.CreateSolution(solutionInfo); 285private async Task<Solution> UpdateWorkspaceCurrentSolutionAsync( 286Solution newSolution, 314static bool IsAddingSolution(Solution oldSolution, Solution newSolution) 330public Solution CreateSolutionFromInfo(SolutionInfo solutionInfo) 333public Task<Solution> UpdateWorkspaceCurrentSolutionAsync(Solution newSolution) 336public async ValueTask<Solution> GetSolutionAsync(
Host\RemoteWorkspace.InFlightSolution.cs (8)
37private readonly Task<Solution> _disconnectedSolutionTask; 44private Task<Solution>? _primaryBranchTask; 56Func<CancellationToken, Task<Solution>> computeDisconnectedSolutionAsync) 85public Task<Solution> PreferredSolutionTask_NoLock 104public void TryKickOffPrimaryBranchWork_NoLock(Func<Solution, CancellationToken, Task<Solution>> updatePrimaryBranchAsync) 134async Task<Solution> ComputePrimaryBranchAsync(CancellationToken cancellationToken) 136var solution = await _disconnectedSolutionTask.ConfigureAwait(false);
Host\RemoteWorkspace.SolutionCreator.cs (18)
28private readonly struct SolutionCreator(RemoteWorkspace workspace, AssetProvider assetService, Solution baseSolution) 33private readonly Solution _baseSolution = baseSolution; 35public async Task<Solution> CreateSolutionAsync(Checksum newSolutionChecksum, CancellationToken cancellationToken) 39var solution = _baseSolution; 148private async Task<Solution> UpdateProjectsAsync( 149Solution solution, SolutionStateChecksums oldSolutionChecksums, SolutionStateChecksums newSolutionChecksums, CancellationToken cancellationToken) 232private async Task<Solution> UpdateProjectsAsync( 233Solution solution, 340private async Task<Solution> UpdateProjectAsync(Project project, ProjectStateChecksums oldProjectChecksums, ProjectStateChecksums newProjectChecksums, CancellationToken cancellationToken) 429Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 430Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 474Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 475Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 604Solution incrementalSolutionBuilt,
Host\RemoteWorkspace_SolutionCaching.cs (4)
20private (Checksum checksum, Solution solution) _lastRequestedPrimaryBranchSolution; 26private readonly RemoteSolutionCache<Checksum, Solution> _lastRequestedAnyBranchSolutions = new(); 84var cachedSolution = _lastRequestedPrimaryBranchSolution.checksum == solutionChecksum 121public async ValueTask AddPinnedSolutionsAsync(HashSet<Solution> solutions, CancellationToken cancellationToken)
Host\RemoteWorkspaceManager.cs (2)
88public async ValueTask<Solution> GetSolutionAsync(ServiceBrokerClient client, Checksum solutionChecksum, CancellationToken cancellationToken) 106Func<Solution, ValueTask<T>> implementation,
Host\SolutionAssetCache.cs (3)
159using var _1 = PooledHashSet<Solution>.GetInstance(out var pinnedSolutions); 165foreach (var pinnedSolution in pinnedSolutions) 170async ValueTask AddPinnedChecksumsAsync(Solution pinnedSolution)
Host\TestUtils.cs (5)
42Solution solutionFromScratch, 43Solution incrementalSolutionBuilt, 158public static async Task<Dictionary<Checksum, object>> GetAssetMapAsync(this Solution solution, ProjectId? projectConeId, CancellationToken cancellationToken) 182public static Task AppendAssetMapAsync(this Solution solution, Dictionary<Checksum, object> map, CancellationToken cancellationToken) 186this Solution solution, Dictionary<Checksum, object> map, ProjectId? projectId, CancellationToken cancellationToken)
Services\BrokeredServiceBase.cs (5)
86Func<Solution, ValueTask<T>> implementation, 106Checksum solutionChecksum, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken) 130Checksum solutionChecksum, Func<Solution, ValueTask> implementation, CancellationToken cancellationToken) 149Func<Solution, Solution, ValueTask> implementation,
Services\CodeLensReferences\RemoteCodeLensReferencesService.cs (1)
28private static async ValueTask<SyntaxNode?> TryFindNodeAsync(Solution solution, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken)
Services\ConvertTupleToStructCodeRefactoringProvider\RemoteConvertTupleToStructCodeRefactoringService.cs (8)
41var updatedSolution = await service.ConvertToStructAsync(document, span, scope, isRecord, cancellationToken).ConfigureAwait(false); 43var cleanedSolution = await CleanupAsync(solution, updatedSolution, cancellationToken).ConfigureAwait(false); 55Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 73private static async Task<Solution> CleanupAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 76var final = newSolution;
Services\EncapsulateField\RemoteEncapsulateFieldService.cs (1)
49var newSolution = await service.EncapsulateFieldsAsync(
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
126var solution = document.Project.Solution;
Services\SymbolFinder\RemoteSymbolFinderService.cs (3)
81private static ImmutableArray<SerializableSymbolAndProjectId> Convert(ImmutableArray<ISymbol> items, Solution solution, CancellationToken cancellationToken) 199private readonly Solution _solution; 205public FindReferencesProgressCallback(Solution solution, RemoteCallback<IRemoteSymbolFinderService.ICallback> callback, RemoteServiceCallbackId callbackId)
Microsoft.CodeAnalysis.Remote.Workspaces (34)
EditAndContinue\ManagedHotReloadLanguageService.cs (14)
50private Solution? _committedDesignTimeSolution; 51private Solution? _pendingUpdatedDesignTimeSolution; 62private async ValueTask<Solution> GetCurrentDesignTimeSolutionAsync(CancellationToken cancellationToken) 72private static Solution GetCurrentCompileTimeSolution(Solution currentDesignTimeSolution) 84var currentDesignTimeSolution = await GetCurrentDesignTimeSolutionAsync(cancellationToken).ConfigureAwait(false); 86var compileTimeSolution = GetCurrentCompileTimeSolution(currentDesignTimeSolution); 144var committedDesignTimeSolution = Interlocked.Exchange(ref _pendingUpdatedDesignTimeSolution, null); 170var currentDesignTimeSolution = await GetCurrentDesignTimeSolutionAsync(cancellationToken).ConfigureAwait(false); 171var currentCompileTimeSolution = GetCurrentCompileTimeSolution(currentDesignTimeSolution); 258var oldSolution = _committedDesignTimeSolution; 260var newSolution = await GetCurrentDesignTimeSolutionAsync(cancellationToken).ConfigureAwait(false); 286var designTimeSolution = await GetCurrentDesignTimeSolutionAsync(cancellationToken).ConfigureAwait(false); 287var solution = GetCurrentCompileTimeSolution(designTimeSolution);
ExternalAccess\Pythia\Api\PythiaRemoteHostClient.cs (4)
68public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 74public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class 82public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, PythiaRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class 88public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, PythiaRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class
ExternalAccess\Pythia\Api\PythiaRemoteServiceConnectionWrapper.cs (4)
45public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 51public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) 59public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, PythiaRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 65public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, PythiaPinnedSolutionInfoWrapper, PythiaRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingRemoteHostClient.cs (4)
68public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 74public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class 82public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, UnitTestingRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class 88public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, UnitTestingRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class
ExternalAccess\UnitTesting\Api\UnitTestingRemoteServiceConnectionWrapper.cs (4)
45public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 51public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) 59public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, UnitTestingRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 65public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, UnitTestingPinnedSolutionInfoWrapper, UnitTestingRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
SolutionAssetStorage.cs (4)
51public ValueTask<Scope> StoreAssetsAsync(Solution solution, CancellationToken cancellationToken) 54/// <inheritdoc cref="StoreAssetsAsync(Solution, CancellationToken)"/> 58/// <inheritdoc cref="StoreAssetsAsync(Solution, CancellationToken)"/> 62/// <inheritdoc cref="StoreAssetsAsync(Solution, CancellationToken)"/>
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (1)
53Protected Overrides Function TryAddAssignmentForPrimaryConstructorAsync(document As Document, parameter As IParameterSymbol, fieldOrProperty As ISymbol, cancellationToken As CancellationToken) As Task(Of Solution)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
GoToBase\VisualBasicGoToBaseService.vb (1)
21Protected Overrides Async Function FindNextConstructorInChainAsync(solution As Solution, constructor As IMethodSymbol, cancellationToken As CancellationToken) As Task(Of IMethodSymbol)
Microsoft.CodeAnalysis.VisualBasic.Features (16)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.CodeAction.vb (2)
14Private ReadOnly _solution As Solution 19Public Sub New(solution As Solution,
Debugging\BreakpointResolver.vb (1)
18Public Sub New(solution As Solution, text As String)
Debugging\VisualBasicBreakpointService.vb (1)
81solution As Solution,
ExtractInterface\VisualBasicExtractInterfaceService.vb (4)
81Private Shared Function CreateFinalSolution(solutionWithInterfaceDocument As Solution, documentIds As IEnumerable(Of DocumentId), docToRootMap As Dictionary(Of DocumentId, CompilationUnitSyntax)) As Solution 101unformattedSolution As Solution, documentIds As IReadOnlyList(Of DocumentId), extractedInterfaceSymbol As INamedTypeSymbol, 103symbolToDeclarationAnnotationMap As ImmutableDictionary(Of ISymbol, SyntaxAnnotation), cancellationToken As CancellationToken) As Task(Of Solution)
GenerateType\VisualBasicGenerateTypeService.vb (2)
612updatedSolution As Solution, 617cancellationToken As CancellationToken) As Task(Of Solution)
NavigationBar\VisualBasicNavigationBarItemService.vb (6)
101solution As Solution, 155solution As Solution, 181solution As Solution, 200solution As Solution, 309solution As Solution, 390solution As Solution,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (2)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (2)
23Private Shared Function AddDefaultTestProject(solution As Solution, source As String) As Solution
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
42Private ReadOnly _solution As Solution 687baseSolution As Solution, 688newSolution As Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (1)
53Protected Overrides Function TryAddAssignmentForPrimaryConstructorAsync(document As Document, parameter As IParameterSymbol, fieldOrProperty As ISymbol, cancellationToken As CancellationToken) As Task(Of Solution)
Microsoft.CodeAnalysis.Workspaces (737)
ChangeNamespace\IChangeNamespaceService.cs (2)
58Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 64Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
CodeActions\CodeAction.cs (32)
131static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction)); 239Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 245Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 264Solution originalSolution, CancellationToken cancellationToken) 284var changedSolution = await GetChangedSolutionAsync(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false); 310var changedSolution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false); 332protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 344protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 361internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 363var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false); 402internal async Task<Solution?> GetChangedSolutionInternalAsync( 403Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 405var solution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false); 427Solution? originalSolution, IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken) 453protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken) 513/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 517/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param> 520public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey) 524/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 528/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param> 531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 534/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/> 536public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 540string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey, CodeActionPriority priority, CodeActionCleanup cleanup) 699private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution; 705Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 718Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 728Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 734protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 755protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 756=> SpecializedTasks.Null<Solution>();
CodeActions\CodeAction_Cleanup.cs (15)
85Solution originalSolution, 86Solution changedSolution) 98internal static async Task<Solution> PostProcessChangesAsync( 99Solution? originalSolution, 100Solution changedSolution, 120private static async Task<Solution> CleanSyntaxAndSemanticsAsync( 121Solution originalSolution, 122Solution changedSolution, 131var cleanedSolution = await RunCleanupPassesInOrderAsync( 163var cleanedSolution = await RunCleanupPassesInOrderAsync( 173private static async Task<Solution> RunCleanupPassesInOrderAsync( 174Solution solution, 183var currentSolution = solution; 189async Task<Solution> RunParallelCleanupPassAsync( 190Solution solution, Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> cleanupDocumentAsync)
CodeActions\CodeActionWithOptions.cs (2)
38Solution originalSolution, object? options, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 54Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
CodeActions\Operations\ApplyChangesOperation.cs (7)
34public sealed class ApplyChangesOperation(Solution changedSolution) : CodeActionOperation 36public Solution ChangedSolution { get; } = changedSolution ?? throw new ArgumentNullException(nameof(changedSolution)); 43internal sealed override Task<bool> TryApplyAsync(Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 48Solution originalSolution, 49Solution changedSolution, 53var currentSolution = workspace.CurrentSolution; 92var forkedSolution = currentSolution;
CodeActions\Operations\CodeActionOperation.cs (1)
34internal virtual Task<bool> TryApplyAsync(Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (6)
37private async Task<Solution?> FixAllContextsAsync( 68var currentSolution = originalFixAllContext.Solution; 139var solution = fixAllContext.Solution; 166var changedSolution = await codeAction.GetChangedSolutionInternalAsync( 251private static async Task<Solution> ApplyChangesAsync( 252Solution currentSolution,
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (2)
47/// other aspects of (like it's properties), or changes to the <see cref="Project"/> or <see cref="Solution"/> 67private Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalFixAllContext, ImmutableArray<FixAllContext> fixAllContexts)
CodeFixes\FixAllOccurrences\FixAllContext.cs (1)
29public Solution Solution => State.Solution;
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (1)
127Solution solution,
CodeFixes\FixAllOccurrences\FixAllProvider.cs (2)
52/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at 66/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at
CodeFixesAndRefactorings\CommonFixAllState.cs (1)
21public Solution Solution => Project.Solution;
CodeFixesAndRefactorings\DefaultFixAllProviderHelpers.cs (9)
26Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 34var solution = fixAllContext.State.Scope switch 50private static Task<Solution?> GetDocumentFixesAsync<TFixAllContext>( 52Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 56private static Task<Solution?> GetProjectFixesAsync<TFixAllContext>( 58Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 62private static Task<Solution?> GetSolutionFixesAsync<TFixAllContext>( 64Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 67var solution = fixAllContext.State.Solution;
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (7)
23public static async Task<Solution?> FixAllContextsAsync<TFixAllContext>( 35var originalSolution = originalFixAllContext.State.Solution; 41var dirtySolution = await GetInitialUncleanedSolutionAsync(originalSolution).ConfigureAwait(false); 47var cleanedSolution = await CodeAction.PostProcessChangesAsync( 57var finalSolution = cleanedSolution.WithDocumentTexts(cleanedTexts); 60async Task<Solution> GetInitialUncleanedSolutionAsync(Solution originalSolution)
CodeFixesAndRefactorings\IFixAllState.cs (1)
21Solution Solution { get; }
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (2)
49/// or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at will be considered. 68private Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalFixAllContext, ImmutableArray<FixAllContext> fixAllContexts)
CodeRefactorings\FixAllOccurences\FixAllContext.cs (1)
63public Solution Solution => Project.Solution;
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (2)
50/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at 64/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at
Diagnostics\Extensions.cs (1)
480var solution = project.Solution;
Editing\SolutionEditor.cs (6)
16public class SolutionEditor(Solution solution) 21/// The <see cref="Solution"/> that was specified when the <see cref="SolutionEditor"/> was constructed. 23public Solution OriginalSolution => solution; 40/// Returns the changed <see cref="Solution"/>. 42public Solution GetChangedSolution() 44var changedSolution = solution;
Editing\SymbolEditor.cs (5)
22private SymbolEditor(Solution solution) 31public static SymbolEditor Create(Solution solution) 57public Solution OriginalSolution { get; } 62public Solution ChangedSolution { get; private set; } 145private static async Task<ISymbol> GetSymbolAsync(Solution solution, ProjectId projectId, string symbolId, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Api\UnitTestingSolutionExtensions.cs (2)
12public static int GetWorkspaceVersion(this Solution solution) 15public static async Task<UnitTestingChecksumWrapper> GetChecksumAsync(this Solution solution, CancellationToken cancellationToken)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
40var solution = project.Solution; 159Solution solution, IList<SerializableSymbolAndProjectId> array, CancellationToken cancellationToken)
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\FindLiterals\FindLiteralsSearchEngine.cs (2)
28private readonly Solution _solution; 38Solution solution,
FindSymbols\FindReferences\BaseTypeFinder.cs (1)
18ISymbol symbol, Solution solution, 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\DependentTypeFinder.cs (5)
63Solution solution, 401Solution solution, 449Solution solution, 463Solution solution, IEnumerable<Project> projectsToExamine) 480Solution solution,
FindSymbols\FindReferences\DependentTypeFinder_DerivedClasses.cs (1)
17Solution solution,
FindSymbols\FindReferences\DependentTypeFinder_DerivedInterfaces.cs (1)
17Solution solution,
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
16Solution solution,
FindSymbols\FindReferences\DependentTypeFinder_Remote.cs (3)
20Solution solution, 54Solution solution, 82private static async Task<ImmutableArray<INamedTypeSymbol>> RehydrateAsync(Solution solution, ImmutableArray<SerializableSymbolAndProjectId> values, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (3)
32ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken); 850ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken) 863TSymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
28protected override ValueTask<ImmutableArray<ISymbol>> DetermineCascadedSymbolsAsync(IMethodSymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
22Solution solution,
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (1)
20Solution solution,
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (1)
39ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
22Solution solution,
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (1)
30Solution solution,
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
24Solution solution,
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
55Solution solution, 90Solution solution,
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
21Solution solution,
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
32Solution solution,
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
29public Solution Solution => this.Document.Project.Solution;
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (2)
24Solution solution, 37private readonly Solution _solution = solution;
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (8)
37protected Solution Solution => Engine._solution; 64var solution = engine._solution; 93Solution solution, MetadataUnifyingSymbolHashSet symbols, CancellationToken cancellationToken) 103Solution solution, ISymbol symbol, CancellationToken cancellationToken) 173var solution = engine._solution; 194var solution = engine._solution; 247var solution = engine._solution; 281var solution = engine._solution;
FindSymbols\SymbolFinder.cs (2)
139public static Task<ISymbol?> FindSourceDefinitionAsync(ISymbol? symbol, Solution solution, CancellationToken cancellationToken = default) 186ISymbol symbol, Solution solution, CancellationToken cancellationToken)
FindSymbols\SymbolFinder.FindLiteralsServerCallback.cs (1)
15Solution solution,
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
21Solution solution,
FindSymbols\SymbolFinder_Callers.cs (3)
24ISymbol symbol, Solution solution, CancellationToken cancellationToken = default) 33ISymbol symbol, Solution solution, IImmutableSet<Document>? documents, CancellationToken cancellationToken = default) 76Solution 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_FindLiteralReferences.cs (2)
18Solution solution, 46object value, Solution solution,
FindSymbols\SymbolFinder_FindReferences_Current.cs (3)
23Solution solution, 72Solution solution, 87Solution solution,
FindSymbols\SymbolFinder_FindReferences_Legacy.cs (5)
27Solution solution, 40Solution solution, 60Solution solution, 82Solution solution, 98Solution solution,
FindSymbols\SymbolFinder_FindRenamableReferences.cs (1)
17Solution solution,
FindSymbols\SymbolFinder_Helpers.cs (4)
30Solution solution, 64Solution solution, ISymbol searchSymbol, ISymbol symbolToMatch) 121Solution solution, 154Solution solution,
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)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (2)
103Solution solution, 237Solution solution,
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
37var solution = project.Solution;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
84var solution = project.Solution; 122var solution = _workspace.CurrentSolution;
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (3)
20internal sealed class LinkedFileDiffMergingSession(Solution oldSolution, Solution newSolution, SolutionChanges solutionChanges) 49var updatedSolution = newSolution;
LinkedFileDiffMerging\LinkedFileMergeSessionResult.cs (2)
14public Solution MergedSolution { get; } 18public LinkedFileMergeSessionResult(Solution mergedSolution, ArrayBuilder<LinkedFileMergeResult> fileMergeResults)
Options\ILegacyWorkspaceOptionService.cs (1)
13/// <see cref="Workspace.Options"/> and <see cref="Solution.Options"/>.
Options\LegacyWorkspaceOptionService.cs (2)
46/// Sets values of options that may be stored in <see cref="Solution.Options"/> (public options). 48/// <see cref="Solution.Options"/> are queried for the options new values are fetched from
Options\SolutionOptionSet.cs (1)
13/// Implements in-proc only storage for <see cref="Solution.Options"/>.
Packaging\IPackageInstallerService.cs (1)
29ImmutableArray<Project> GetProjectsWithInstalledPackage(Solution solution, string packageName, string version);
Recommendations\Recommender.cs (1)
26var solution = workspace.CurrentSolution;
Remote\IRemoteKeepAliveService.cs (5)
18/// same <see cref="Solution"/> snapshot alive on the OOP side, computed attached values (like <see 97/// cref="CreateAsync(Solution, CancellationToken)"/> is not possible (for example, in a constructor). 99public static RemoteKeepAliveSession Create(Solution solution, IAsynchronousOperationListener listener) 108public static Task<RemoteKeepAliveSession> CreateAsync(Solution solution, CancellationToken cancellationToken) 111/// <inheritdoc cref="CreateAsync(Solution, CancellationToken)"/>
Remote\RemoteArguments.cs (6)
60Solution solution, ISymbol symbol, CancellationToken cancellationToken) 72ISymbol symbol, Solution solution, CancellationToken cancellationToken, 100Solution solution, CancellationToken cancellationToken) 173Solution solution, CancellationToken cancellationToken) 190Solution solution, CancellationToken cancellationToken) 235public static SerializableSymbolGroup Dehydrate(Solution solution, SymbolGroup group, CancellationToken cancellationToken)
Remote\RemoteHostClient.cs (10)
103Solution solution, 122Solution solution, 134/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, CancellationToken, ValueTask}, CancellationToken)"/> 161/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, CancellationToken, ValueTask}, CancellationToken)"/> 179Solution solution, 190Solution solution, 203/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, RemoteServiceCallbackId, CancellationToken, ValueTask}, object, CancellationToken)"/> 220/// Equivalent to <see cref="TryInvokeAsync{TService}(Solution, Func{TService, Checksum, RemoteServiceCallbackId, CancellationToken, ValueTask}, object, CancellationToken)"/> 239Solution solution1, 240Solution solution2,
Remote\RemoteServiceConnection.cs (6)
53Solution solution, 59Solution solution, 103Solution solution, 109Solution solution, 149Solution solution1, 150Solution solution2,
Remote\RemoteUtilities.cs (5)
23Solution oldSolution, 24Solution newSolution, 48public static async Task<Solution> UpdateSolutionAsync( 49Solution oldSolution, 53var currentSolution = oldSolution;
Rename\ConflictEngine\ConflictResolver.cs (4)
62var solution = lightweightRenameLocations.Solution; 151private static bool IsIdentifierValid_Worker(Solution solution, string replacementText, IEnumerable<ProjectId> projectIds) 345Solution solution, 407private static async ValueTask<Location?> GetSymbolLocationAsync(Solution solution, ISymbol symbol, CancellationToken cancellationToken)
Rename\ConflictEngine\ConflictResolver.Session.cs (7)
97var baseSolution = _renameLocationSet.Solution; 112var intermediateSolution = conflictResolution.OldSolution; 528var solution = conflictResolution.CurrentSolution; 718var solution = _renameLocationSet.Solution; 785private async Task<Solution> AnnotateAndRename_WorkerAsync( 786Solution originalSolution, 797var partiallyRenamedSolution = conflictResolution.CurrentSolution;
Rename\ConflictEngine\MutableConflictResolution.cs (8)
22Solution oldSolution, 34public readonly Solution OldSolution = oldSolution; 50public Solution CurrentSolution { get; private set; } = oldSolution; 62internal void UpdateCurrentSolution(Solution solution) 65internal async Task<Solution> RemoveAllRenameAnnotationsAsync( 66Solution intermediateSolution, 179internal async ValueTask<Solution> WithDocumentSyntaxRootAsync(Solution solution, DocumentId documentId, SyntaxNode newRoot, CancellationToken cancellationToken)
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
146internal async Task<Solution> SimplifyAsync( 147Solution solution,
Rename\ConflictResolution.cs (5)
30private readonly Solution? _newSolutionWithoutRenamedDocument; 33public readonly Solution? OldSolution; 38public readonly Solution? NewSolution; 71Solution oldSolution, 72Solution newSolutionWithoutRenamedDocument,
Rename\IRemoteRenamerService.cs (5)
88public async ValueTask<RenameLocation> RehydrateAsync(Solution solution, CancellationToken cancellation) 117ISymbol symbol, Solution solution, SerializableRenameLocations serializableLocations, CancellationToken cancellationToken) 162Solution solution, CancellationToken cancellationToken) 181public async Task<ConflictResolution> RehydrateAsync(Solution oldSolution, CancellationToken cancellationToken) 188var newSolutionWithoutRenamedDocument = await RemoteUtilities.UpdateSolutionAsync(
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\LightweightRenameLocations.cs (3)
25public readonly Solution Solution; 33Solution solution, 73ISymbol symbol, Solution solution, SymbolRenameOptions options, 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.RenameDocumentAction.cs (1)
43internal abstract Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken);
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\Renamer.RenameSymbolDocumentAction.cs (2)
36internal override async Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken) 38var solution = document.Project.Solution;
Rename\Renamer.SyncNamespaceDocumentAction.cs (2)
39internal override async Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken) 42var solution = await changeNamespaceService.TryChangeTopLevelNamespacesAsync(document, _analysis.TargetNamespace, cancellationToken).ConfigureAwait(false);
Rename\RenameRewriterParameters.cs (2)
24Solution originalSolution, 37internal readonly Solution OriginalSolution = originalSolution;
Rename\RenameUtilities.cs (3)
82internal static IEnumerable<Document> GetDocumentsAffectedByRename(ISymbol symbol, Solution solution, IEnumerable<RenameLocation> renameLocations) 211ISymbol symbol, Solution solution, CancellationToken cancellationToken) 316ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Rename\SymbolicRenameLocations.cs (5)
25public readonly Solution Solution; 35Solution solution, 58ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 114ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 126Solution 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, SymbolRenameOptions options, CancellationToken cancellationToken) 245ISymbol referencedSymbol, ISymbol originalSymbol, ReferenceLocation location, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 326Solution solution,
Shared\Extensions\IFindReferencesResultExtensions.cs (2)
115Solution solution, 125Solution solution,
Shared\Extensions\ISolutionExtensions.cs (6)
19this Solution solution, 39public static TextDocumentKind? GetDocumentKind(this Solution solution, DocumentId documentId) 42internal static TextDocument? GetTextDocumentForLocation(this Solution solution, Location location) 56public static Solution WithTextDocumentText(this Solution solution, DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveIdentity) 78public static Workspace? TryGetWorkspace(this Solution solution)
Shared\Extensions\ITypeSymbolExtensions.cs (1)
30Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (15)
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 ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken) 92public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated, CancellationToken cancellationToken) 95public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId) 112public static Solution WithUpToDateSourceGeneratorDocuments(this Solution solution, IEnumerable<ProjectId> projectIds)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Storage\LegacyPersistentStorageService.cs (1)
36public IPersistentStorage GetStorage(Solution solution)
Storage\SQLite\v2\SQLitePersistentStorageConstants.cs (1)
48/// Inside the DB we have a table for data corresponding to the <see cref="Solution"/>. The
Workspace\AdhocWorkspace.cs (1)
46public Solution AddSolution(SolutionInfo solutionInfo)
Workspace\DocumentActiveContextChangedEventArgs.cs (2)
12public Solution Solution { get; } 17public DocumentActiveContextChangedEventArgs(Solution solution, SourceTextContainer sourceTextContainer, DocumentId oldActiveContextDocumentId, DocumentId newActiveContextDocumentId)
Workspace\DocumentTracking\IDocumentTrackingServiceExtensions.cs (2)
17public static Document? GetActiveDocument(this IDocumentTrackingService service, Solution solution) 27public static ImmutableArray<Document> GetVisibleDocuments(this IDocumentTrackingService service, Solution solution)
Workspace\Host\ISupportedChangesService.cs (1)
13/// Can be acquired from <see cref="Solution.Services"/>, with <see cref="SolutionServices.GetService{ISupportedChangesService}"/>.
Workspace\Host\PersistentStorage\IPersistentStorageService.cs (1)
17IPersistentStorage GetStorage(Solution solution);
Workspace\Host\PersistentStorage\SolutionKey.cs (3)
12/// <see cref="Solution"/> without needing to have the entire <see cref="Solution"/> snapshot available. 21public static SolutionKey ToSolutionKey(Solution solution)
Workspace\IWorkspaceConfigurationService.cs (1)
26/// Options that affect behavior of workspace core APIs (<see cref="Solution"/>, <see cref="Project"/>, <see
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (14)
66private readonly Func<Solution, DocumentId, bool> _documentAlreadyInWorkspace; 69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction; 85Func<Solution, DocumentId, bool> documentAlreadyInWorkspace, 88Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction, 565Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 567Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 580Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 582Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
Workspace\ProjectSystem\ProjectSystemProject.cs (8)
220private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false) 306Solution solution, ProjectId projectId) 335private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue) 783public static (Solution newSolution, ProjectUpdateState newProjectUpdateState) UpdateProjectAnalyzerReferences( 784Solution solution, 840var newSolution = solution.WithProjectAnalyzerReferences(project.Id, isolatedReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (14)
156var newSolution = w.CreateSolution(solutionInfo); 269public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation) 545Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")] 573var newSolution = solutionChanges.Solution 594Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")] 595private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectState projectWithMetadataReference, ProjectState candidateProjectToReference) 670var newSolution = solutionChanges.Solution.RemoveProjectReference(projectIdToRetarget, convertedReference.ProjectReference) 702Solution currentSolution, 832var newSolution = solution 872Func<Solution, ProjectId, ProjectUpdateState, TReference, TReference, (Solution newSolution, ProjectUpdateState newProjectUpdateState)> update, 878var initialSolution = solutionChanges.Solution; 893var newSolution = solutionChanges.Solution;
Workspace\ProjectSystem\SolutionChangeAccumulator.cs (6)
13internal sealed class SolutionChangeAccumulator(Solution startingSolution) 23public Solution Solution { get; private set; } = startingSolution; 32public void UpdateSolutionForDocumentAction(Solution newSolution, WorkspaceChangeKind changeKind, IEnumerable<DocumentId> documentIds) 75/// The same as <see cref="UpdateSolutionForDocumentAction(Solution, WorkspaceChangeKind, IEnumerable{DocumentId})" /> but also records 78public void UpdateSolutionForRemovedDocumentAction(Solution solution, WorkspaceChangeKind removeDocumentChangeKind, IEnumerable<DocumentId> documentIdsRemoved) 89public void UpdateSolutionForProjectAction(ProjectId projectId, Solution newSolution)
Workspace\Solution\Document.cs (5)
392var solution = this.Project.Solution.WithDocumentText(this.Id, text, PreservationMode.PreserveIdentity); 408var solution = this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity); 557var solution = this.Project.Solution; 566var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken); 582/// Returns the options that should be applied to this document. This consists of global options from <see cref="Solution.Options"/>,
Workspace\Solution\Project.cs (2)
36internal Project(Solution solution, ProjectState projectState) 50public Solution Solution { get; }
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) 997private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated) 1011public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1036public Solution AddDocument(DocumentInfo documentInfo) 1040/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include 1043/// <returns>A new <see cref="Solution"/> with the documents added.</returns> 1044public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos) 1051public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 1058public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1079public Solution AddAdditionalDocument(DocumentInfo documentInfo) 1082public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos) 1089public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1134public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos) 1140public Solution RemoveDocument(DocumentId documentId) 1149public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds) 1155private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1161public Solution RemoveAdditionalDocument(DocumentId documentId) 1170public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1176private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1182public Solution RemoveAnalyzerConfigDocument(DocumentId documentId) 1191public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1197private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1203public Solution WithDocumentName(DocumentId documentId, string name) 1222public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders) 1237public Solution WithDocumentFilePath(DocumentId documentId, string? filePath) 1251public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1254internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue) 1274public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1295public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1316public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1337public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1358public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1379public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue) 1383internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue) 1399internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState) 1402internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates) 1413public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1436public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1457public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1478public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1499internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken) 1503internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken) 1506private Solution ComputeFrozenSolution(CancellationToken cancellationToken) 1514var frozenSolution = new Solution( 1529internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken) 1533AsyncLazy<Solution> GetLazySolution() 1548static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId) 1553static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken) 1556var solution = new Solution(newCompilationState); 1567internal async Task<Solution> WithMergedLinkedFileChangesAsync( 1568Solution oldSolution, 1591internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services) 1599public Solution GetIsolatedSolution() 1608public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1638var newSolution = WithCompilationState(newCompilationState); 1647internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents) 1651internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap) 1658internal Solution WithoutFrozenSourceGeneratedDocuments() 1669internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState) 1676public SolutionChanges GetChanges(Solution oldSolution) 1687/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a 1704/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/> 1725public Solution WithOptions(OptionSet options) 1738internal Solution WithOptions(SolutionOptionSet options)
Workspace\Solution\SolutionChanges.cs (6)
16private readonly Solution _newSolution; 17private readonly Solution _oldSolution; 19internal SolutionChanges(Solution newSolution, Solution oldSolution) 38var old = _oldSolution; 88/// Gets changed source generated document ids that were modified with <see cref="Solution.WithFrozenSourceGeneratedDocuments(System.Collections.Immutable.ImmutableArray{ValueTuple{SourceGeneratedDocumentIdentity, DateTime, Text.SourceText}})"/>
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (1)
137/// queried for (for example: <see cref="Solution.GetOriginatingProject(ISymbol)"/>. If <see
Workspace\Solution\SolutionCompilationState.cs (3)
986/// <inheritdoc cref="Solution.WithDocumentSyntaxRoots(ImmutableArray{ValueTuple{DocumentId, SyntaxNode}}, PreservationMode)"/> 1263/// generated. This method exists to implement <see cref="Solution.GetDocument(SyntaxTree?)"/> and is best avoided unless you're doing something 1850/// <inheritdoc cref="Solution.WithCachedSourceGeneratorState(ProjectId, Project)"/>
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (1)
22/// cref="Solution.WithFrozenSourceGeneratedDocuments"/> to ensure that a particular solution snapshot contains a
Workspace\Solution\SolutionState.cs (2)
226/// This implicitly also changes the value of <see cref="Solution.Workspace"/> for this solution, 1195/// <inheritdoc cref="Solution.GetDocumentIdsWithFilePath(string?)" />
Workspace\TextExtensions.cs (3)
26var solution = workspace.CurrentSolution; 62var solution = workspace.CurrentSolution; 109var solution = workspace.CurrentSolution;
Workspace\Workspace.cs (146)
35/// workspace's <see cref="TryApplyChanges(Solution)"/> method. 56private Solution _latestSolution; 60/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>. 127protected internal Solution CreateSolution(SolutionInfo solutionInfo) 136private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 142protected internal Solution CreateSolution(SolutionId id) 152/// after <see cref="TryApplyChanges(Solution)"/> is called. 154public Solution CurrentSolution 169protected Solution SetCurrentSolution(Solution solution) 181private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution) 188var oldSolution = this.CurrentSolution; 200/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 202Func<Solution, Solution> transformation, 206Action<Solution, Solution>? onBeforeUpdate = null, 207Action<Solution, Solution>? onAfterUpdate = null) 230internal (bool updated, Solution newSolution) SetCurrentSolution( 231Func<Solution, Solution> transformation, 232Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 233Action<Solution, Solution>? onBeforeUpdate = null, 234Action<Solution, Solution>? onAfterUpdate = null) 249internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync( 251Func<Solution, Solution> transformation, 252Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 253Action<Solution, Solution>? onBeforeUpdate, 254Action<Solution, Solution>? onAfterUpdate, 262var newSolution = data.transformation(oldSolution); 288static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution) 328static Solution UpdateAddedDocumentToExistingContentsInSolution( 329Solution solution, ArrayBuilder<DocumentId> addedDocumentIds) 369static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds) 407/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language. 409/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>. 416/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/> 417/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>. 419private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution) 469/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated 474/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated 476private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>( 478Func<Solution, TData, Solution> transformation, 480Action<Solution, Solution, TData>? onBeforeUpdate = null, 481Action<Solution, Solution, TData>? onAfterUpdate = null) 497/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/> 498private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>( 501Func<Solution, TData, Solution> transformation, 503Action<Solution, Solution, TData>? onBeforeUpdate, 504Action<Solution, Solution, TData>? onAfterUpdate, 511var oldSolution = Volatile.Read(ref _latestSolution); 523var newSolution = transformation(oldSolution, data); 561/// Gets or sets the set of all global options and <see cref="Solution.Options"/>. 562/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>. 772private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects) 784private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project) 800var newSolution = this.CreateSolution(solutionInfo); 816var newSolution = this.CreateSolution(reloadedSolutionInfo); 1046/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment. 1139var newSolution = oldSolution; 1283Func<Solution, DocumentId, TextDocument?> getDocumentInSolution, 1284Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText, 1319var newSolution = oldSolution; 1320var previousSolution = newSolution; 1474static Solution UpdateReferencesAfterAdd(Solution solution) 1531/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method. 1553public virtual bool TryApplyChanges(Solution newSolution) 1556internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker) 1567var oldSolution = this.CurrentSolution; 1590var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result; 1858/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1865/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1866/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1871/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed. 1878/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1879/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1884/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project 2087/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution. 2098/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution. 2109/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options. 2127/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options. 2144/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project. 2155/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project. 2166/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project. 2177/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project. 2188/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project. 2199/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project. 2210/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution. 2221/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution. 2232/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project. 2243/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project. 2276/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project. 2287/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project. 2309/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project. 2320/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project. 2350private static void CheckSolutionIsEmpty(Solution solution) 2364private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId) 2380private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId) 2477internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2488internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2502private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId) 2518private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId) 2534private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId) 2563private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2579private static void CheckAnalyzerConfigDocumentIsNotInSolution(Solution solution, DocumentId documentId)
Workspace\Workspace_Editor.cs (15)
555Action<Solution, DocumentId> checkTextDocumentIsInSolution, 556Func<Solution, DocumentId, SourceText, PreservationMode, Solution> withDocumentText, 557Func<Solution, DocumentId, TextAndVersion, PreservationMode, Solution> withDocumentTextAndVersion, 749Action<Solution, DocumentId> checkTextDocumentIsInSolution, 750Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader) 850private SourceText GetOpenDocumentText(Solution solution, DocumentId documentId) 863protected virtual Solution AdjustReloadedSolution(Solution oldSolution, Solution reloadedSolution) 865var newSolution = reloadedSolution; 882var oldSolution = oldProject.Solution; 883var newSolution = reloadedProject.Solution;
Workspace\Workspace_Events.cs (3)
96protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId? projectId = null, DocumentId? documentId = null) 175var currentSolution = this.CurrentSolution;
Workspace\Workspace_SourceGeneration.cs (1)
71Solution solution, ImmutableSegmentedList<(ProjectId? projectId, bool forceRegeneration)> projectIds)
Workspace\WorkspaceChangeEventArgs.cs (4)
29public Solution OldSolution { get; } 36public Solution NewSolution { get; } 65public WorkspaceChangeEventArgs(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId? projectId = null, DocumentId? documentId = null)
Microsoft.CodeAnalysis.Workspaces.MSBuild (8)
MSBuild\MSBuildWorkspace.cs (4)
176public Task<Solution> OpenSolutionAsync( 192public async Task<Solution> OpenSolutionAsync( 306public override bool TryApplyChanges(Solution newSolution) 311internal override bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker)
MSBuild\ProjectMap.cs (4)
16/// project into a custom <see cref="Workspace"/>. To use, pass <see cref="Workspace.CurrentSolution"/> to <see cref="Create(Solution)"/>. 56/// Create a <see cref="ProjectMap"/> populated with the given <see cref="Solution"/>. 58/// <param name="solution">The <see cref="Solution"/> to populate the new <see cref="ProjectMap"/> with.</param> 59public static ProjectMap Create(Solution solution)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (85)
MSBuildWorkspaceTestBase.cs (6)
71var sol = await workspace.OpenSolutionAsync(solutionFilePath); 80var sol = await workspace.OpenSolutionAsync(solutionFilePath); 89var sol = await workspace.OpenSolutionAsync(solutionFilePath); 98var sol = await workspace.OpenSolutionAsync(solutionFilePath); 127var sol = await workspace.OpenSolutionAsync(solutionFilePath); 143protected async Task<Solution> SolutionAsync(params IBuilder[] inputs)
NetCoreTests.cs (1)
405var solution = await workspace.OpenSolutionAsync(solutionFilePath);
VisualStudioMSBuildWorkspaceTests.cs (78)
63var solution = await workspace.OpenSolutionAsync(solutionFilePath); 80var solution = await workspace.OpenSolutionAsync(solutionFilePath); 119var solution = await workspace.OpenSolutionAsync(solutionFilePath); 212var solution = await workspace.OpenSolutionAsync(solutionFilePath); 224var solution = await workspace.OpenSolutionAsync(solutionFilePath); 248var sol = await workspace.OpenSolutionAsync(solutionFilePath); 263var sol = await workspace.OpenSolutionAsync(solutionFilePath); 284var solution = await workspace.OpenSolutionAsync(solutionFilePath); 302var sol = await workspace.OpenSolutionAsync(solutionFilePath); 317var sol = await workspace.OpenSolutionAsync(solutionFilePath); 340var sol = await workspace.OpenSolutionAsync(solutionFilePath); 362var solution = await SolutionAsync( 396var solution = await workspace.OpenSolutionAsync(solutionFilePath); 406var solution1 = solution.WithDocumentText(document.Id, SourceText.From("using test;")); 419var solution2 = solution1.WithProjectCompilationOptions(project.Id, project.CompilationOptions.WithOutputKind(OutputKind.NetModule)); 429var solution3 = solution2.AddProject(pid2, "foo", "foo", LanguageNames.CSharp); 595var solution = await workspace.OpenSolutionAsync(solutionFilePath); 795var solution = await workspace.OpenSolutionAsync(solutionFilePath); 813var solution = await workspace.OpenSolutionAsync(solutionFilePath); 831var solution = await workspace.OpenSolutionAsync(solutionFilePath); 849var solution = await workspace.OpenSolutionAsync(solutionFilePath); 962var solution = await ws.OpenSolutionAsync(GetSolutionFileName(@"TestSolution.sln")); 996var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1012var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1025var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1054var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1084var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1097var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1112var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1174var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1639var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1820var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1846var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1880var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1903var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1927var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1950var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1975var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1996var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2003var solution2 = workspace.CurrentSolution; 2022var solutionB = await workspaceB.OpenSolutionAsync(solutionFilePath); 2037var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2046var solution2 = workspace.CurrentSolution; 2071var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2079var solution2 = workspace.CurrentSolution; 2098var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2103var newSolution = solution.WithDocumentText(document.Id, newText); 2108var solution2 = workspace.CurrentSolution; 2124var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2130var newSolution = solution.WithAdditionalDocumentText(document.Id, newText); 2135var solution2 = workspace.CurrentSolution; 2152var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2156var newSolution = solution.AddDocument(newDocId, "Bar.cs", newText); 2161var solution2 = workspace.CurrentSolution; 2214var originalSolution = workspace.CurrentSolution; 2244var originalSolution = workspace.CurrentSolution; 2412var sol = await workspace.OpenSolutionAsync(fullPath); 2431var sol = await workspace.OpenSolutionAsync(fullPath); 2504var sol = await workspace.OpenSolutionAsync(fullPath); 2519var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2535var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2553var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2571var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2648var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2664var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2681var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2687var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2693var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2711var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2737var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2900var noEncodingSolution = noEncodingDoc.Project.Solution; 2922var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2950var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3027var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3158var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3200var solution = await workspace.OpenSolutionAsync(fullPath); 3263var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3290var solution = await workspace.OpenSolutionAsync(solutionFilePath);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (33)
SolutionUtilities.cs (19)
17public static ProjectChanges GetSingleChangedProjectChanges(Solution oldSolution, Solution newSolution) 33private static IEnumerable<ProjectChanges> GetChangedProjectChanges(Solution oldSolution, Solution newSolution) 39public static Document GetSingleChangedDocument(Solution oldSolution, Solution newSolution) 47public static TextDocument GetSingleChangedAdditionalDocument(Solution oldSolution, Solution newSolution) 55public static IEnumerable<DocumentId> GetChangedDocuments(Solution oldSolution, Solution newSolution) 67public static Document GetSingleAddedDocument(Solution oldSolution, Solution newSolution) 75public static IEnumerable<DocumentId> GetTextChangedDocuments(Solution oldSolution, Solution newSolution) 87public static IEnumerable<DocumentId> GetAddedDocuments(Solution oldSolution, Solution newSolution) 99public static Tuple<Project, ProjectReference> GetSingleAddedProjectReference(Solution oldSolution, Solution newSolution) 105public static Project AddEmptyProject(Solution solution, string languageName = LanguageNames.CSharp, string name = "TestProject")
WorkspaceExtensions.cs (7)
18var oldSolution = workspace.CurrentSolution; 19var newSolution = oldSolution.AddDocument(id, name, initialText, folders).GetDocument(id)!.WithSourceCodeKind(sourceCodeKind).Project.Solution; 26var oldSolution = workspace.CurrentSolution; 27var newSolution = oldSolution.RemoveDocument(documentId); 33var oldSolution = workspace.CurrentSolution; 34var newSolution = oldSolution.WithDocumentText(documentId, newText); 54public static IEnumerable<Project> GetProjectsByName(this Solution solution, string name)
Workspaces\TestWorkspace`1.cs (7)
113/// Use to set specified editorconfig options as <see cref="Solution.FallbackAnalyzerOptions"/>. 126/// Use to set specified editorconfig options as <see cref="Solution.FallbackAnalyzerOptions"/>. 141/// Use to set specified options both as global options and as <see cref="Solution.FallbackAnalyzerOptions"/>. 524public Task ChangeDocumentAsync(DocumentId documentId, Solution solution) 554public Task ChangeProjectAsync(ProjectId projectId, Solution solution) 564public Task ChangeSolutionAsync(Solution solution) 771public override bool TryApplyChanges(Solution newSolution)
Microsoft.CodeAnalysis.Workspaces.UnitTests (381)
CodeCleanup\AddMissingTokensTests.cs (1)
2587var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\CodeCleanupTests.cs (1)
423var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\FixIncorrectTokenTests.cs (1)
732var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
933var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\ReduceTokenTests.cs (1)
1993var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (1)
1335var solution = new AdhocWorkspace().CurrentSolution;
FindAllDeclarationsTests.cs (19)
127var solution = workspace.CurrentSolution; 150var solution = workspace.CurrentSolution; 353using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 362var declarations = await SymbolFinder.FindSourceDeclarationsAsync((Solution)null, "Test", true); 369using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 377using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 459using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 467using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 475using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 484await SymbolFinder.FindSourceDeclarationsAsync((Solution)null, str => str.Contains("Test")); 491using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 499using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 578using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 591using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 600await SymbolFinder.FindSourceDeclarationsWithPatternAsync((Solution)null, "test"); 607using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 615using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 624using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 651var solution = workspace.CurrentSolution
FindAllDeclarationsTests.TestSolutionsAndProject.cs (4)
89private Workspace CreateWorkspaceWithSingleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) 106private Workspace CreateWorkspaceWithMultipleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) 123private Workspace CreateWorkspaceWithSolution(SolutionKind solutionKind, out Solution solution, TestHost testHost = TestHost.OutOfProcess) 140var workspace = CreateWorkspaceWithSolution(solutionKind, out var solution, testHost);
FindReferencesTests.cs (20)
27private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, IEnumerable<MetadataReference> metadataReference, params ProjectId[] projectReferences) 43private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, MetadataReference metadataReference, params ProjectId[] projectReferences) 59private static Solution GetSingleDocumentSolution(Workspace workspace, string sourceText, string languageName = LanguageNames.CSharp) 69private static Solution GetMultipleDocumentSolution(Workspace workspace, string[] sourceTexts) 73var solution = workspace.CurrentSolution 104var solution = GetSingleDocumentSolution(workspace, text); 126var solution = workspace.CurrentSolution 178var sln = CreateWorkspace().CurrentSolution 219var sln = CreateWorkspace().CurrentSolution 285var sln = CreateWorkspace().CurrentSolution 334var solution = GetSingleDocumentSolution(workspace, text); 375var solution = CreateWorkspace().CurrentSolution; 454var solution = GetMultipleDocumentSolution(workspace, [implText, interface1Text, interface2Text]); 475var solution = CreateWorkspace().CurrentSolution; 540var solution = GetSingleDocumentSolution(workspace, text); 569var solution = GetSingleDocumentSolution(workspace, text); 604var solution = GetSingleDocumentSolution(workspace, text, LanguageNames.VisualBasic); 648var solution = GetSingleDocumentSolution(workspace, text, LanguageNames.CSharp);
Formatter\FormatterTests.cs (1)
127var solutionWithUpdatedOptions = workspace.CurrentSolution.WithOptions(updatedSolutionOptions);
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (4)
20var solution = workspace.CurrentSolution; 37var startingSolution = solution; 38var updatedSolution = solution; 50var mergedSolution = updatedSolution.WithMergedLinkedFileChangesAsync(startingSolution).Result;
SemanticModelReuse\SemanticModelReuseTests.cs (1)
26var solution = new AdhocWorkspace().CurrentSolution;
Simplifier\SimplifierTests.cs (1)
90var solutionWithUpdatedOptions = workspace.CurrentSolution.WithOptions(updatedOptions);
SolutionTests\ProjectDependencyGraphTests.cs (35)
36var solution = CreateSolutionFromReferenceMap("A"); 53private static void VerifyTopologicalSort(Solution solution, params string[] expectedResults) 79var solution = CreateSolutionFromReferenceMap("A"); 88private static void VerifyDependencySets(Solution solution, string expectedResult) 115var solution = CreateSolutionFromReferenceMap(""); 130var solution = CreateSolutionFromReferenceMap("A B C D"); 167var solution = CreateSolutionFromReferenceMap("A:B B:C C D:E E:F F"); 187var solution = CreateSolutionFromReferenceMap("A:B B:C C"); 215var solution = CreateSolutionFromReferenceMap("A B C:D D"); 242var solution = CreateSolution(); 268var solution = CreateSolutionFromReferenceMap("A B:C C D:E E"); 277private static void VerifyDirectReferences(Solution solution, string project, string[] expectedResults) 289private static void VerifyTransitiveReferences(Solution solution, string project, string[] expectedResults) 295private static void VerifyTransitiveReferences(Solution solution, ProjectDependencyGraph projectDependencyGraph, string project, string[] expectedResults) 311var solution = CreateSolutionFromReferenceMap("A:B B"); 337var solution = CreateSolutionFromReferenceMap(""); 352var solution = CreateSolutionFromReferenceMap("A B C D"); 389var solution = CreateSolutionFromReferenceMap("A:B B C:D D"); 409var solution = CreateSolutionFromReferenceMap("A:B B:C C:D D"); 431var solution = CreateSolutionFromReferenceMap("A:B B:C C:D D"); 453var solution = CreateSolutionFromReferenceMap("A:B B:C C:D D"); 475var solution = CreateSolutionFromReferenceMap("A:B B:C C:D D"); 500var solution = CreateSolutionFromReferenceMap("A:B,D B:C C D"); 528var solution = CreateSolutionFromReferenceMap("A:B B:C C D:E E"); 557var solution = CreateSolutionFromReferenceMap("A:B,D B:C C D"); 588var solution = CreateSolutionFromReferenceMap("A:B B:C,C C:D D"); 645private static void VerifyDirectReverseReferences(Solution solution, string project, string[] expectedResults) 657private static void VerifyReverseTransitiveReferences(Solution solution, string project, string[] expectedResults) 674private static Solution CreateSolutionFromReferenceMap(string projectReferences) 676var solution = CreateSolution(); 710private static Solution AddProject(Solution solution, string projectName) 716private static Solution AddProjectReferences(Solution solution, string projectName, IEnumerable<string> projectReferences) 737private static Solution CreateSolution()
SolutionTests\SolutionTests.cs (252)
115var solution = workspace.CurrentSolution; 124var solution = workspace.CurrentSolution; 134var solution = workspace.CurrentSolution; 143var solution = workspace.CurrentSolution; 153var solution = workspace.CurrentSolution; 162var solution = workspace.CurrentSolution; 172var solution = workspace.CurrentSolution; 176var newSolution1 = solution.WithDocumentName(documentId, name); 179var newSolution2 = newSolution1.WithDocumentName(documentId, name); 192var solution = workspace.CurrentSolution; 196var newSolution1 = solution.WithDocumentFolders(documentId, folders); 199var newSolution2 = newSolution1.WithDocumentFolders(documentId, folders); 203var newSolution3 = solution.WithDocumentFolders(documentId, []); 206var newSolution4 = solution.WithDocumentFolders(documentId, []); 209var newSolution5 = solution.WithDocumentFolders(documentId, null); 223var solution = workspace.CurrentSolution; 227var newSolution1 = solution.WithDocumentFilePath(documentId, path); 231var newSolution2 = newSolution1.WithDocumentFilePath(documentId, path); 234var newSolution3 = solution.WithDocumentFilePath(documentId, ""); 238var newSolution4 = solution.WithDocumentFilePath(documentId, null); 250var solution = workspace.CurrentSolution; 255var newSolution1 = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Script); 269var solution = workspace.CurrentSolution; 288var solution = workspace.CurrentSolution; 291var newSolution = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Interactive); 299var solution = workspace.CurrentSolution; 307var newSolution1 = solution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity); 314var newSolution2 = newSolution1.WithDocumentSyntaxRoot(documentId, actualRoot); 329var solution = workspace.CurrentSolution 345var solution = workspace.CurrentSolution; 350var newSolution1 = solution.WithDocumentText(documentId, text, PreservationMode.PreserveIdentity); 356var newSolution2 = newSolution1.WithDocumentText(documentId, text, PreservationMode.PreserveIdentity); 370var solution = workspace.CurrentSolution; 374var newSolution1 = solution.WithDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 380var newSolution2 = newSolution1.WithDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 394var solution = workspace.CurrentSolution; 398var newSolution1 = solution.WithDocumentText([documentId], text, PreservationMode.PreserveIdentity); 402var newSolution2 = newSolution1.WithDocumentText([documentId], text, PreservationMode.PreserveIdentity); 427var solution = workspace.CurrentSolution; 494private static Solution UpdateSolution(PreservationMode mode, TextUpdateType updateType, Solution solution, DocumentId documentId1, SourceText text, TextAndVersion textAndVersion) 515var solution = workspace.CurrentSolution; 594var solution = workspace.CurrentSolution; 680var solution = workspace.CurrentSolution; 757var solution = workspace.CurrentSolution; 845var solution = workspace.CurrentSolution; 916var solution = workspace.CurrentSolution; 920var newSolution1 = solution.WithAdditionalDocumentText(documentId, text, PreservationMode.PreserveIdentity); 924var newSolution2 = newSolution1.WithAdditionalDocumentText(documentId, text, PreservationMode.PreserveIdentity); 938var solution = workspace.CurrentSolution; 942var newSolution1 = solution.WithAdditionalDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 948var newSolution2 = newSolution1.WithAdditionalDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 962var solution = workspace.CurrentSolution; 966var newSolution1 = solution.WithAnalyzerConfigDocumentText(documentId, text, PreservationMode.PreserveIdentity); 970var newSolution2 = newSolution1.WithAnalyzerConfigDocumentText(documentId, text, PreservationMode.PreserveIdentity); 984var solution = workspace.CurrentSolution; 988var newSolution1 = solution.WithAnalyzerConfigDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 994var newSolution2 = newSolution1.WithAnalyzerConfigDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 1008var solution = workspace.CurrentSolution; 1012var newSolution1 = solution.WithDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1016var newSolution2 = solution.WithDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1030var solution = workspace.CurrentSolution; 1034var newSolution1 = solution.WithAdditionalDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1038var newSolution2 = solution.WithAdditionalDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1052var solution = workspace.CurrentSolution; 1056var newSolution1 = solution.WithAnalyzerConfigDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1060var newSolution2 = solution.WithAnalyzerConfigDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1088var solution = workspace.CurrentSolution 1206var newSolution = solution.WithProjectInfo(newInfo); 1297var solution = workspace.CurrentSolution 1332var solution = workspace.CurrentSolution 1367var solution = workspace.CurrentSolution 1402var solution = workspace.CurrentSolution 1436var solution = workspace.CurrentSolution 1442var newSolution = solution.WithProjectAssemblyName(projectId, assemblyName); 1458var solution = workspace.CurrentSolution 1486var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp); 1513var solution = workspace.CurrentSolution 1536var solution = workspace.CurrentSolution 1559var solution = workspace.CurrentSolution. 1582var solution = workspace.CurrentSolution. 1619var solution = workspace.CurrentSolution 1673var solution = workspace.CurrentSolution 1695var solution = workspace.CurrentSolution 1718var solution = workspace.CurrentSolution 1735var solution = workspace.CurrentSolution 1760var solution = workspace.CurrentSolution 1914var solution = workspace.CurrentSolution; 1932var solution2 = solution.WithProjectReferences(projectId, projectRefs); 1947var solution = workspace.CurrentSolution; 1952var newSolution1 = solution.WithProjectReferences(projectId, projectRefs); 1963var solution = workspace.CurrentSolution; 1978var solution2 = solution.AddProjectReferences(projectId, EmptyEnumerable<ProjectReference>()); 1983var solution3 = solution.AddProjectReferences(projectId, e); 2005var solution = workspace.CurrentSolution; 2016var solution2 = solution.RemoveProjectReference(projectId, externalProjectRef); 2020var solution3 = solution.RemoveProjectReference(projectId, projectRef2); 2023var solution4 = solution3.RemoveProjectReference(projectId, externalProjectRef); 2040var solution = workspace.CurrentSolution; 2076var solution = workspace.CurrentSolution; 2094var solution = workspace.CurrentSolution; 2097var solution2 = solution.AddMetadataReferences(projectId, EmptyEnumerable<MetadataReference>()); 2103var solution3 = solution.AddMetadataReferences(projectId, OnceEnumerable(metadataRef1, metadataRef2)); 2119var solution = workspace.CurrentSolution; 2126var solution2 = solution.RemoveMetadataReference(projectId, metadataRef1); 2129var solution3 = solution2.RemoveMetadataReference(projectId, metadataRef2); 2146var solution = workspace.CurrentSolution; 2164var solution = workspace.CurrentSolution; 2167var solution2 = solution.AddAnalyzerReferences(projectId, EmptyEnumerable<AnalyzerReference>()); 2173var solution3 = solution.AddAnalyzerReferences(projectId, OnceEnumerable(analyzerRef1, analyzerRef2)); 2176var solution4 = solution3.AddAnalyzerReferences(projectId, []); 2192var solution = workspace.CurrentSolution; 2199var solution2 = solution.RemoveAnalyzerReference(projectId, analyzerRef1); 2202var solution3 = solution2.RemoveAnalyzerReference(projectId, analyzerRef2); 2219var solution = workspace.CurrentSolution; 2233var solution = workspace.CurrentSolution; 2235var solution2 = solution.AddAnalyzerReferences(EmptyEnumerable<AnalyzerReference>()); 2241var solution3 = solution.AddAnalyzerReferences(OnceEnumerable(analyzerRef1, analyzerRef2)); 2244var solution4 = solution3.AddAnalyzerReferences([]); 2259var solution = workspace.CurrentSolution; 2265var solution2 = solution.RemoveAnalyzerReference(analyzerRef1); 2268var solution3 = solution2.RemoveAnalyzerReference(analyzerRef2); 2286var solution = workspace.CurrentSolution; 2290var solution2 = solution.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2297var solution3 = solution2.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2312var solution4 = solution3.AddAnalyzerConfigDocument(editorConfigId, ".editorconfig", SourceText.From(editorConfigContent), filePath: Path.Combine(s_projectDir, "subfolder", ".editorconfig")); 2316static void TestOptionValues(Solution solution, string expectedA, bool hasBWithoutFallback, string expectedB, string expectedBFile) 2362var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2370var solution2 = solution.AddDocument(documentId, "name", loader, folders); 2388var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2396var solution2 = solution.AddDocument(documentId, "name", "text", folders, filePath); 2418var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2427var solution2 = solution.AddDocument(documentId, "name", sourceText, folders, filePath, isGenerated: true); 2445var origSolution = workspace.CurrentSolution; 2454var newSolution = origSolution.AddDocument(newDocumentId, document.Name, sourceText, filePath: document.FilePath!); 2470var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2479var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 2499var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2510var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 2533var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2542var solution2 = solution.AddDocument(documentId, "name", root); 2556var solution = workspace.CurrentSolution; 2569var solution = workspace.CurrentSolution; 2581var solution = workspace.CurrentSolution; 2596var solution = workspace.CurrentSolution 2642var solution = workspace.CurrentSolution 2666var solution = workspace.CurrentSolution 2694var solution = workspace.CurrentSolution 2704var solution = workspace.CurrentSolution; 2718var solution = workspace.CurrentSolution 2739var solution = workspace.CurrentSolution 2760var solution = workspace.CurrentSolution 2779var solution = workspace.CurrentSolution 2798var solution = workspace.CurrentSolution 2813var solution = workspace.CurrentSolution 2832var solution = workspace.CurrentSolution 2849var solution = workspace.CurrentSolution 2864private static async Task ValidateSolutionAndCompilationsAsync(Solution solution) 2951var solution = workspace.CurrentSolution; 2972var solution = workspace.CurrentSolution; 3010var solution = workspace.CurrentSolution; 3019var newSolution = solution.AddAnalyzerReference(project1, analyzerReference); 3068var solution = workspace.CurrentSolution; 3086var sol = workspace.CurrentSolution; 3095var sol2 = sol.RemoveProject(pid); 3105var sol = workspace.CurrentSolution; 3117var sol2 = sol.RemoveProject(pid); 3131var sol = workspace.CurrentSolution; 3142var sol2 = sol.RemoveProject(pid); 3149var sol3 = sol2.AddProject(pid, "goo", "goo.dll", LanguageNames.CSharp); 3167var sol = workspace.CurrentSolution 3188var solution1 = workspace.CurrentSolution 3194var solution2 = solution1.WithDocumentSyntaxRoot(documentId, newRoot); 3211var sol = workspace.CurrentSolution 3222var sol2 = sol.WithDocumentSyntaxRoot(did, annotatedRoot); 3252var sol = workspace.CurrentSolution 3293var solution = workspace.CurrentSolution 3324var sol = workspace.CurrentSolution; 3355var sol = workspace.CurrentSolution 3377var sol = workspace.CurrentSolution 3398var sol = workspace.CurrentSolution 3422var sol = workspace.CurrentSolution 3444var sol = workspace.CurrentSolution 3465var sol = workspace.CurrentSolution 3485var sol = workspace.CurrentSolution 3505var sol = workspace.CurrentSolution 3525var sol = workspace.CurrentSolution 3544var sol = workspace.CurrentSolution 3554private static ObjectReference<SourceText> GetObservedText(Solution solution, DocumentId documentId, string expectedText = null) 3575var sol = workspace.CurrentSolution 3585private static ObjectReference<SourceText> GetObservedTextAsync(Solution solution, DocumentId documentId, string expectedText = null) 3607var sol = workspace.CurrentSolution 3617private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRoot(Solution solution, DocumentId documentId) 3633var sol = workspace.CurrentSolution 3643private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRootAsync(Solution solution, DocumentId documentId) 3669var sol = workspace.CurrentSolution 3701var sol = workspace.CurrentSolution 3708private static void TestRecoverableSyntaxTree(Solution sol, DocumentId did) 3752var sol = workspace.CurrentSolution 3762private static ObjectReference<Compilation> GetObservedCompilationAsync(Solution solution, ProjectId projectId) 3777var sol = workspace.CurrentSolution 3787private static ObjectReference<Compilation> GetObservedCompilation(Solution solution, ProjectId projectId) 3804var sol = workspace.CurrentSolution 3938var solution = workspace.CurrentSolution; 3992var solution = new AdhocWorkspace().CurrentSolution 4019var solution2 = solution.WithDocumentText(did3, SourceText.From(text4)); 4178var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }")); 4223var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }")); 4288var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 4400var solution = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution; 4456var currentSolution = workspace.CurrentSolution; 4596var solution = workspace.CurrentSolution; 4612var solution = workspace.CurrentSolution; 4673var solution = workspace.CurrentSolution; 4700var solution = workspace.CurrentSolution; 4736var solution = workspace.CurrentSolution; 4777var solution = workspace.CurrentSolution; 4823var solution = workspace.CurrentSolution; 4854var solution = workspace.CurrentSolution; 4905var solution = workspace.CurrentSolution; 4929var solution = workspace.CurrentSolution 4946var solution = workspace.CurrentSolution; 4964var solution = workspace.CurrentSolution; 4987var solution = workspace.CurrentSolution; 5009var solution = workspace.CurrentSolution; 5037var solution = workspace.CurrentSolution; 5065var solution = workspace.CurrentSolution; 5094var solution = workspace.CurrentSolution; 5125var solution = workspace.CurrentSolution; 5163var solution = workspace.CurrentSolution; 5180var solution = workspace.CurrentSolution; 5226var solution = workspace.CurrentSolution; 5270var solution = workspace.CurrentSolution; 5294var solution = workspace.CurrentSolution; 5432var s0 = workspace.CurrentSolution; 5442var s1 = s0.WithOptions(options); 5446var s2 = s1.AddProject("P1", "A1", LanguageNames.VisualBasic).Solution; 5450var s4 = s2.RemoveProject(s2.Projects.Single(p => p.Name == "P1").Id); 5478var solution = workspace.CurrentSolution.AddProject(projInfo); 5507var solution = workspace.CurrentSolution; 5522var finalSolution = solutionWithSourceTextToRelease.GetObjectReference( 5561var solution = workspace.CurrentSolution 5589var solution = workspace.CurrentSolution 5609var solution = workspace.CurrentSolution 5628var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5647var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5669var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5699var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5729var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5759var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5796var frozenSolution = freeze 5832var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
SolutionTests\SolutionWithSourceGeneratorTests.cs (15)
390var solutionWithProjects = AddProjectWithReference(workspace.CurrentSolution, analyzerReference); 404static Solution AddProjectWithReference(Solution solution, TestGeneratorReference analyzerReference) 420var solution = AddEmptyProject(workspace.CurrentSolution) 661var solution = AddEmptyProject(workspace.CurrentSolution) 819var frozenSolution = originalDocument2.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 905var solution = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference).Solution; 915var solutionWithFrozenDocuments = solution.WithFrozenSourceGeneratedDocuments( 999var solution = project.Solution.WithDocumentTexts( 1219var solution = sourceGeneratedDocument1.WithText(SourceText.From("// Change doc 1")).Project.Solution; 1337var newSolution = await FreezeDocumentAndGetSolution(project, sourceGeneratedDocumentIdentity); 1342static async Task<Solution> FreezeDocumentAndGetSolution(Project project, SourceGeneratedDocumentIdentity identity) 1372var newSolution = await FreezeDocumentAndGetSolution(project, sourceGeneratedDocumentIdentity); 1377static async Task<Solution> FreezeDocumentAndGetSolution(Project project, SourceGeneratedDocumentIdentity identity) 1436var solution = workspace.CurrentSolution;
SyntaxNodeTests.cs (1)
83var sol = new AdhocWorkspace().CurrentSolution
SyntaxReferenceTests.cs (10)
25private static Solution AddSingleFileCSharpProject(Solution solution, string source) 35private static Solution AddSingleFileVisualBasicProject(Solution solution, string source) 49var solution = AddSingleFileCSharpProject(workspace.CurrentSolution, """ 72var solution = AddSingleFileVisualBasicProject(workspace.CurrentSolution, """ 94var solution = AddSingleFileCSharpProject(workspace.CurrentSolution, """ 117var solution = AddSingleFileVisualBasicProject(workspace.CurrentSolution, """ 140var solution = AddSingleFileCSharpProject(workspace.CurrentSolution, """ 168var solution = AddSingleFileVisualBasicProject(workspace.CurrentSolution, """
WorkspaceServiceTests\GlobalOptionServiceTests.cs (5)
72var newSolution1 = workspace1.CurrentSolution.WithOptions(newSet); 77var oldSolution2 = workspace2.CurrentSolution; 83var newSolution2 = workspace2.CurrentSolution; 103var newSolution1 = workspace1.CurrentSolution.WithOptions(newSet); 107var oldSolution2 = workspace2.CurrentSolution;
WorkspaceTests\AdhocWorkspaceTests.cs (5)
92var solution = ws.AddSolution(sinfo); 128var solution = ws.CurrentSolution; 165var newSolution = ws.CurrentSolution.AddProject(projInfo); 200var newSolution = ws.CurrentSolution.RemoveProject(pid); 395public WorkspaceWithPartialSemantics(Solution solution)
WorkspaceTests\WorkspaceTests.cs (2)
106var newSolution = ws.CurrentSolution.WithAnalyzerReferences([new TestAnalyzerReference()]); 190var solution = workspace1.CurrentSolution;
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
497var solution = operations.OfType<ApplyChangesOperation>().Single().ChangedSolution;
Microsoft.Interop.ComInterfaceGenerator (7)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (6)
106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 113var updatedSolution = editor.GetChangedSolution(); 212Solution solutionWithUpdatedSources = solutionEditor.GetChangedSolution(); 227private static Solution AddUnsafe(Solution solution, Project project)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
24Solution solution = context.Solution;
Microsoft.Interop.LibraryImportGenerator (9)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
52private static async Task<Solution> AddDisableRuntimeMarshallingAttributeApplicationToProject(Project project, CancellationToken cancellationToken)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
154private static async Task<Solution> AddMissingMembers(Document doc, SyntaxNode node, HashSet<string> missingMemberNames, CancellationToken ct)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (6)
106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 113var updatedSolution = editor.GetChangedSolution(); 212Solution solutionWithUpdatedSources = solutionEditor.GetChangedSolution(); 227private static Solution AddUnsafe(Solution solution, Project project)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
24Solution solution = context.Solution;
Microsoft.ML.CodeAnalyzer.Tests (2)
Code\RelaxTestNamingTest.cs (2)
22private static Solution WithoutSuppressedDiagnosticsTransform(Solution solution, ProjectId projectId)
Microsoft.ML.InternalCodeAnalyzer (3)
NameFixProvider.cs (3)
102private async Task<Solution> RenameAsync(Document document, 112var originalSolution = document.Project.Solution; 115var newSolution = await Renamer.RenameSymbolAsync(document.Project.Solution, typeSymbol, renameOptions, newName, cancellationToken).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices (141)
CallHierarchy\CallHierarchyDetail.cs (1)
69var solution = _workspace.CurrentSolution;
CodeCleanup\AbstractCodeCleanUpFixer.cs (7)
57var solution = _workspace.CurrentSolution; 117var solution = _workspace.CurrentSolution; 158async Task<Solution> ApplyFixAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 170Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> applyFixAsync, 185var solution = await applyFixAsync(progress, cancellationToken).ConfigureAwait(true); 193private static async Task<Solution> FixProjectsAsync( 194Solution solution,
CodeLens\CodeLensCallbackListener.cs (6)
68var solution = _workspace.CurrentSolution; 88var solution = _workspace.CurrentSolution; 120var solution = _workspace.CurrentSolution; 159var solution = _workspace.CurrentSolution; 172Solution solution, Guid projectGuid, string filePath, TextSpan textSpan, DocumentId? sourceGeneratorDocumentId, CancellationToken cancellationToken) 233Solution solution, Guid projectGuid, string filePath, DocumentId? sourceGeneratorDocumentId, CancellationToken cancellationToken)
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,
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (2)
131var solution = document.Project.Solution; 157var forkedSolution = solution.WithDocumentText(document.Id, _projectionBuffer.CurrentSnapshot.AsText(), PreservationMode.PreserveIdentity);
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
12public DebuggerIntelliSenseWorkspace(Solution solution)
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
122var solution = _workspace.CurrentSolution;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (3)
74var currentSolution = _workspace.CurrentSolution; 171var solution = _workspace.CurrentSolution; 218private Project? GetProject(Solution solution, IVsHierarchy? hierarchy)
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
87var solution = _workspace.CurrentSolution;
EditorConfigSettings\SettingsEditorControl.xaml.cs (1)
83var solution = _workspace.CurrentSolution;
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
50var solution = document.Project.Solution;
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
46var solution = document.Project.Solution;
FindReferences\VisualStudioDefinitionsAndReferencesFactory.cs (1)
32Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken)
Implementation\AbstractEditorFactory.cs (2)
291var solution = workspace.CurrentSolution; 326var forkedSolution = projectToAddTo.Solution.AddDocument(
Implementation\HierarchyItemToProjectIdMap.cs (1)
29Solution solution, IVsHierarchyItem? hierarchyItem, string? targetFrameworkMoniker, [NotNullWhen(true)] out Project? project)
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (1)
193var solution = _languageService.Workspace.CurrentSolution;
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
466Solution solution, string languageName, CancellationToken cancellationToken) 584public ImmutableArray<ObjectListItem> GetProjectListItems(Solution solution, string languageName, uint listFlags)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (2)
23internal Task<ImmutableHashSet<(ProjectId, IAssemblySymbol)>> GetAssemblySetAsync(Solution solution, string languageName, CancellationToken cancellationToken) 41internal ImmutableArray<ObjectListItem> GetProjectListItems(Solution solution, string languageName, uint listFlags)
NavigateTo\RoslynNavigateToSearchCallback.cs (2)
24private readonly Solution _solution; 29Solution solution,
NavigateTo\RoslynSearchItemsSource.cs (1)
95var solution = provider._workspace.CurrentSolution;
Packaging\PackageInstallerServiceFactory.cs (4)
481var solution = Workspace.CurrentSolution; 521ImmutableSegmentedList<(bool solutionChanged, ProjectId? changedProject)> workQueue, Solution solution, HashSet<ProjectId> projectsToProcess) 541Solution solution, 657public ImmutableArray<Project> GetProjectsWithInstalledPackage(Solution solution, string packageName, string version)
Preview\PreviewEngine.cs (8)
29private readonly Solution _newSolution; 30private readonly Solution _oldSolution; 42public Solution FinalSolution { get; private set; } 45public PreviewEngine(string title, string helpString, string description, string topLevelItemName, Glyph topLevelGlyph, Solution newSolution, Solution oldSolution, IComponentModel componentModel, bool showCheckBoxes = true) 56Solution newSolution, 57Solution oldSolution, 214var updatedSolution = _topLevelChange.GetUpdatedSolution(applyingChanges: false);
Preview\PreviewService.cs (3)
29public Solution PreviewChanges( 35Solution newSolution, 36Solution oldSolution,
Preview\PreviewUpdater.PreviewDialogWorkspace.cs (1)
18public PreviewDialogWorkspace(Solution solution) : base(solution)
Preview\ReferenceChange.AnalyzerReferenceChange.cs (4)
22internal override Solution AddToSolution(Solution solution) 25internal override Solution RemoveFromSolution(Solution solution)
Preview\ReferenceChange.cs (6)
31var oldSolution = projectChanges.OldProject.Solution; 32var newSolution = projectChanges.NewProject.Solution; 75internal abstract Solution AddToSolution(Solution solution); 76internal abstract Solution RemoveFromSolution(Solution solution);
Preview\ReferenceChange.MetadataReferenceChange.cs (4)
21internal override Solution AddToSolution(Solution solution) 24internal override Solution RemoveFromSolution(Solution solution)
Preview\ReferenceChange.ProjectReferenceChange.cs (4)
23internal override Solution AddToSolution(Solution solution) 26internal override Solution RemoveFromSolution(Solution solution)
Preview\TopLevelChange.cs (8)
23private readonly Solution _newSolution; 29Solution newSolution, 60public Solution GetUpdatedSolution(bool applyingChanges) 62var solution = ApplyFileChanges(_newSolution, Children.Changes.OfType<FileChange>(), applyingChanges); 71private static Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fileChanges, bool applyingChanges) 182private static Solution ApplyReferenceChanges(Solution solution, IEnumerable<ReferenceChange> referenceChanges)
Progression\GraphNodeCreation.cs (2)
17public static Task<GraphNodeId> CreateNodeIdAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 21public static Task<GraphNode> CreateNodeAsync(this Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken)
ProjectSystem\VisualStudioWorkspace.cs (1)
69public abstract void DisplayReferencedSymbols(Solution solution, IEnumerable<ReferencedSymbol> referencedSymbols);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
30var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (3)
28protected abstract TextDocument? GetDocument(Solution currentSolution); 32var currentSolution = Workspace.CurrentSolution; 45var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
31var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (2)
28var currentSolution = Workspace.CurrentSolution; 43var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.cs (2)
302Microsoft.CodeAnalysis.Solution newSolution, 310var currentSolution = this.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (2)
207var solution = _workspace.CurrentSolution; 326var solution = w.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.RemoveAdditionalDocumentUndoUnit.cs (1)
24protected override TextDocument? GetDocument(Solution currentSolution)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveAnalyzerConfigDocumentUndoUnit.cs (1)
24protected override TextDocument? GetDocument(Solution currentSolution)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveDocumentUndoUnit.cs (1)
24protected override TextDocument? GetDocument(Solution currentSolution)
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
30var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (2)
28var currentSolution = Workspace.CurrentSolution; 43var currentSolution = Workspace.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs (1)
36var updatedSolution = _workspace.CurrentSolution.WithDocumentName(documentId, _toName);
PullMemberUp\MainDialog\BaseTypeTreeNodeViewModel.cs (1)
45Solution solution,
SyncNamespaces\SyncNamespacesCommandHandler.cs (3)
118var solution = _workspace.CurrentSolution; 133Solution? solution = null; 147var newSolution = previewChangeService.PreviewChanges(
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (4)
202var originalSolution = _workspace.CurrentSolution; 219var newSolution = _workspace.CurrentSolution; 404private static ImmutableDictionary<Document, ImmutableArray<Diagnostic>> GetDocumentDiagnosticsMappedToNewSolution(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentDiagnosticsToFixMap, Solution newSolution, string language) 423private static ImmutableDictionary<Project, ImmutableArray<Diagnostic>> GetProjectDiagnosticsMappedToNewSolution(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectDiagnosticsToFixMap, Solution newSolution, string language)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (3)
195private static Microsoft.VisualStudio.RpcContracts.DiagnosticManagement.Diagnostic? CreateDiagnostic(ProjectId projectId, Guid projectHierarchyGuid, DiagnosticData diagnostic, Solution solution) 320public InProgressState(ExternalErrorDiagnosticUpdateSource owner, Solution solution) 326public Solution Solution { get; }
UnusedReferences\Dialog\RemoveUnusedReferencesDialog.xaml.cs (1)
34public bool? ShowModal(JoinableTaskFactory joinableTaskFactory, Solution solution, string projectFilePath, ImmutableArray<ReferenceUpdate> referenceUpdates)
UnusedReferences\Dialog\UnusedReferencesTableProvider.cs (1)
63public void AddTableData(Solution solution, string projectFilePath, ImmutableArray<ReferenceUpdate> referenceUpdates)
UnusedReferences\Dialog\UnusedReferencesTableProvider.DataSource.cs (1)
33public void AddTableData(Solution solution, string projectFilePath, ImmutableArray<ReferenceUpdate> referenceUpdates)
UnusedReferences\RemoveUnusedReferencesCommandHandler.cs (5)
112Solution? solution = null; 167private (Solution?, string?, ImmutableArray<ReferenceUpdate>) GetUnusedReferencesForProjectHierarchy( 182var solution = _workspace.CurrentSolution; 189private ImmutableArray<ReferenceUpdate> GetUnusedReferencesForProject(Solution solution, string projectFilePath, string projectAssetsFile, CancellationToken cancellationToken) 205private static void ApplyUnusedReferenceUpdates(JoinableTaskFactory joinableTaskFactory, Solution solution, string projectFilePath, ImmutableArray<ReferenceUpdate> referenceUpdates, CancellationToken cancellationToken)
UnusedReferences\UnusedReferenceAnalysisService.cs (1)
26public async Task<ImmutableArray<ReferenceInfo>> GetUnusedReferencesAsync(Solution solution, string projectFilePath, string projectAssetsFilePath, ImmutableArray<ReferenceInfo> projectReferences, CancellationToken cancellationToken)
ValueTracking\ValueTrackedTreeItemViewModel.cs (3)
27private readonly Solution _solution; 48Solution solution, 93Solution solution,
ValueTracking\ValueTrackingCommandHandler.cs (1)
123var solution = document.Project.Solution;
Venus\ContainedLanguageCodeSupport.cs (1)
329var newSolution = Renamer.RenameSymbolAsync(document.Project.Solution, symbol, options, newName, cancellationToken).WaitAndGetResult_Venus(cancellationToken);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
61var solution = visualStudioWorkspace.CurrentSolution;
Workspace\VisualStudioDocumentNavigationService.cs (1)
190var solution = workspace.CurrentSolution;
Workspace\VisualStudioSymbolNavigationService.cs (1)
53var solution = project.Solution;
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (6)
33public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 48private readonly Solution _startingSolution; 49private readonly Solution _updatedSolution; 55Solution startingSolution, 56Solution updatedSolution)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
SemanticSearch\SemanticSearchQueryExecutor.cs (1)
42public async Task ExecuteAsync(string? query, Document? queryDocument, Solution solution, CancellationToken cancellationToken)
SemanticSearch\SemanticSearchToolWindowImpl.cs (1)
387var querySolution = _semanticSearchWorkspace.Value.CurrentSolution;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (45)
CodeModel\AbstractFileCodeElementTests.cs (1)
50protected Microsoft.CodeAnalysis.Solution GetCurrentSolution()
PersistentStorage\AbstractPersistentStorageTests.cs (43)
114var solution = CreateOrOpenSolution(nullPaths: true); 134var solution = CreateOrOpenSolution(folder); 156var solution = CreateOrOpenSolution(); 177var solution = CreateOrOpenSolution(); 200var solution = CreateOrOpenSolution(); 216var solution = CreateOrOpenSolution(); 234var solution = CreateOrOpenSolution(); 252var solution = CreateOrOpenSolution(); 267var solution = CreateOrOpenSolution(); 282var solution = CreateOrOpenSolution(); 297var solution = CreateOrOpenSolution(); 309var solution = CreateOrOpenSolution(); 322var solution = CreateOrOpenSolution(); 334var solution = CreateOrOpenSolution(); 343var solution = CreateOrOpenSolution(); 362var solution = CreateOrOpenSolution(); 381var solution = CreateOrOpenSolution(); 400var solution = CreateOrOpenSolution(); 419var solution = CreateOrOpenSolution(); 439var solution = CreateOrOpenSolution(); 459var solution = CreateOrOpenSolution(); 479var solution = CreateOrOpenSolution(); 500var solution = CreateOrOpenSolution(); 521var solution = CreateOrOpenSolution(); 542var solution = CreateOrOpenSolution(); 563var solution = CreateOrOpenSolution(); 587var solution = CreateOrOpenSolution(); 611var solution = CreateOrOpenSolution(); 635var solution = CreateOrOpenSolution(); 659var solution = CreateOrOpenSolution(); 680var solution = CreateOrOpenSolution(); 701var solution = CreateOrOpenSolution(); 722var solution = CreateOrOpenSolution(); 743var solution = CreateOrOpenSolution(); 767var solution = CreateOrOpenSolution(); 791var solution = CreateOrOpenSolution(); 815var solution = CreateOrOpenSolution(); 850var solution = CreateOrOpenSolution(); 871var solution = CreateOrOpenSolution(); 891var solution = CreateOrOpenSolution(); 972protected Solution CreateOrOpenSolution(TempDirectory? persistentFolder = null, bool nullPaths = false) 983var solution = workspace.CurrentSolution; 1001Solution solution,
PersistentStorage\SQLiteV2PersistentStorageTests.cs (1)
23var solution = CreateOrOpenSolution(nullPaths: true);
Microsoft.VisualStudio.LanguageServices.LiveShare (7)
LiveShareInitializeHandler.cs (2)
16internal class LiveShareInitializeHandler : ILspRequestHandler<InitializeParams, InitializeResult, Solution> 28public Task<InitializeResult> HandleAsync(InitializeParams param, RequestContext<Solution> requestContext, CancellationToken cancellationToken)
LSPSDKInitializeHandler.cs (2)
23internal sealed class LSPSDKInitializeHandler : ILspRequestHandler<LSP.InitializeParams, LSP.InitializeResult, Solution> 31public Task<LSP.InitializeResult> HandleAsync(LSP.InitializeParams request, RequestContext<Solution> requestContext, CancellationToken cancellationToken)
ProjectsHandler.cs (3)
20internal class ProjectsHandler : ILspRequestHandler<object, object[], Solution> 22public async Task<object[]> HandleAsync(object param, RequestContext<Solution> requestContext, CancellationToken cancellationToken) 26var solution = requestContext.Context;
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (2)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (1)
76Public Overrides Sub DisplayReferencedSymbols(solution As Solution, referencedSymbols As IEnumerable(Of ReferencedSymbol))
ProjectSystemShim\Framework\TestEnvironment.vb (1)
109Public Overrides Sub DisplayReferencedSymbols(solution As Solution, referencedSymbols As IEnumerable(Of ReferencedSymbol))
Microsoft.VisualStudio.LanguageServices.Xaml (13)
Features\InlineRename\XamlEditorInlineRenameService.cs (5)
148private readonly Solution _oldSolution; 150public InlineRenameLocationSet(IXamlRenameInfo renameInfo, Solution solution, ImmutableArray<InlineRenameLocation> locations) 166var newSolution = _oldSolution; 183public InlineRenameReplacementInfo(InlineRenameLocationSet inlineRenameLocationSet, Solution newSolution, string replacementText) 190public Solution NewSolution { get; }
Implementation\IXamlEditAndContinueSolutionProvider.cs (1)
16event Action<Solution>? SolutionCommitted;
Implementation\LanguageServer\Extensions\SolutionExtensions.cs (1)
14public static IEnumerable<Project> GetXamlProjects(this Solution solution)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (4)
61var solution = document.Project.Solution; 91private async Task<LSP.Location[]> GetLocationsAsync(XamlDefinition definition, Document document, Solution solution, CancellationToken cancellationToken) 111private static async Task<LSP.Location?> GetSourceDefinitionLocationAsync(XamlSourceDefinition sourceDefinition, Solution solution, CancellationToken cancellationToken) 153private static async Task<LSP.Location[]> GetSymbolDefinitionLocationsAsync(XamlSymbolDefinition symbolDefinition, Document document, Solution solution, IMetadataAsSourceFileService metadataAsSourceFileService, IGlobalOptionService globalOptions, CancellationToken cancellationToken)
Implementation\XamlEditAndContinueSolutionProvider.cs (2)
34public event Action<Solution>? SolutionCommitted; 44private void OnEditAndContinueSolutionCommitted(Solution solution)
Roslyn.Diagnostics.Analyzers (31)
AbstractExposeMemberForTesting`1.cs (1)
100private async Task<Solution> AddMemberToTestAccessorAsync(Document document, TextSpan sourceSpan, string memberName, string memberDocumentationCommentId, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Roslyn.Diagnostics.Analyzers.UnitTests (2)
RelaxTestNamingSuppressorTests.cs (2)
23private static Solution WithoutSuppressedDiagnosticsTransform(Solution solution, ProjectId projectId)
Roslyn.Diagnostics.CSharp.Analyzers (5)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
67private static async Task<Solution> RemoveOptSuffixOnVariableAsync(Document document, ISymbol variableSymbol, string newName, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
33public static async Task<Solution> AddAssignmentForPrimaryConstructorAsync( 40var solution = project.Solution; 101var solution = solutionEditor.OriginalSolution;
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
77var solution = workspace.CurrentSolution;
Roslyn.VisualStudio.Next.UnitTests (185)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
52var newSolution = document.Project.Solution.WithDocumentText(document.Id, newText, PreservationMode.PreserveIdentity);
Remote\SerializationValidator.cs (2)
111public async Task<Solution> GetSolutionAsync(SolutionAssetStorage.Scope scope) 210internal async Task VerifySolutionStateSerializationAsync(Solution solution, Checksum solutionChecksum)
Remote\SnapshotSerializationTests.cs (21)
44internal static Solution SetFullSolution(Workspace workspace) 84var solution = workspace.CurrentSolution; 105var solution = workspace.CurrentSolution; 116var solution = workspace.CurrentSolution; 172var solution = workspace.CurrentSolution; 185var solution = SetFullSolution(workspace); 207var solution = SetFullSolution(workspace); 219var solution = SetFullSolution(workspace); 233var solution = SetFullSolution(workspace); 247var solution = SetFullSolution(workspace); 295var solution = SetFullSolution(workspace); 302var recovered = await validator.GetSolutionAsync(scope1); 318var roundtrip = await validator.GetSolutionAsync(scope2); 335var solution = SetFullSolution(workspace); 342var recovered = await validator.GetSolutionAsync(scope1); 359var roundtrip = await validator.GetSolutionAsync(scope2); 493var recovered = await validator.GetSolutionAsync(snapshot); 513var recovered = await validator.GetSolutionAsync(snapshot); 526var recovered = await validator.GetSolutionAsync(snapshot); 583var solution = workspace.CurrentSolution 592var recovered = await validator.GetSolutionAsync(scope);
Services\AssetProviderTests.cs (2)
71var solution = workspace.CurrentSolution; 99var solution = workspace.CurrentSolution;
Services\ServiceHubServicesTests.cs (51)
71var solution = workspace.CurrentSolution; 93var solution = workspace.CurrentSolution; 121private static async Task<AssetProvider> GetAssetProviderAsync(Workspace workspace, Workspace remoteWorkspace, Solution solution, Dictionary<Checksum, object> map = null) 148var solution = workspace.CurrentSolution; 199var solution = workspace.CurrentSolution; 235var solution = workspace.CurrentSolution.AddProject("unknown", "unknown", NoCompilationConstants.LanguageName).Solution; 270var solution = workspace.CurrentSolution; 315var solution = workspace.CurrentSolution; 382var solution = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync( 732var solution = workspace.CurrentSolution; 816var solution = workspace.CurrentSolution; 871var solution = workspace.CurrentSolution; 926var initialSolution = workspace.CurrentSolution; 931var currentSolution = workspace.CurrentSolution; 977var initialSolution = workspace.CurrentSolution; 982var currentSolution = workspace.CurrentSolution; 1018var initialSolution = workspace.CurrentSolution; 1025var currentSolution = workspace.CurrentSolution; 1061var initialSolution = workspace.CurrentSolution; 1067var currentSolution = workspace.CurrentSolution; 1114var initialSolution = workspace.CurrentSolution; 1120var currentSolution = workspace.CurrentSolution; 1167var initialSolution = workspace.CurrentSolution; 1173var currentSolution = workspace.CurrentSolution; 1220var initialSolution = workspace.CurrentSolution; 1228var currentSolution = workspace.CurrentSolution; 1265var initialSolution = workspace.CurrentSolution; 1273var currentSolution = workspace.CurrentSolution; 1309var initialSolution = workspace.CurrentSolution; 1316var currentSolution = workspace.CurrentSolution; 1352var initialSolution = workspace.CurrentSolution; 1359var currentSolution = workspace.CurrentSolution; 1467private static async Task<Solution> VerifyIncrementalUpdatesAsync( 1471Solution solution, 1476var remoteSolution = remoteWorkspace.CurrentSolution; 1490var currentSolution = UpdateSolution(solution, projectName, documentName, csAddition, vbAddition); 1515var currentRemoteSolution = remoteWorkspace.CurrentSolution; 1550var initialSolution = workspace.CurrentSolution; 1560var finalSolution = workspace.CurrentSolution; 1663private static void VerifyStates(Solution solution1, Solution solution2, string projectName, ImmutableArray<string> documentNames) 1699private static async Task VerifyAssetStorageAsync(InProcRemoteHostClient client, Solution solution) 1708private static Solution UpdateSolution(Solution solution, string projectName, string documentName, string csAddition, string vbAddition) 1725private static (Project project, Document document) GetProjectAndDocument(Solution solution, string projectName, string documentName) 1733private static (Project project, ImmutableArray<Document> documents) GetProjectAndDocuments(Solution solution, string projectName, ImmutableArray<string> documentNames) 1742private static async Task UpdatePrimaryWorkspace(RemoteHostClient client, Solution solution) 1748private static Solution Populate(Solution solution) 1813private static Solution AddProject( 1814Solution solution,
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (6)
245Func<Assembly, string, CancellationToken, ImmutableArray<IExtensionMessageHandlerWrapper<Solution>>> createWorkspaceMessageHandlersCallback, 289(_, _, _) => [new TestHandler<Solution>("WorkspaceMessageName")], 306(_, _, _) => [new TestHandler<Solution>("WorkspaceMessageName")], 675(_, _, _) => [new TestHandler<Solution>("HandlerName", (_, _, _) => 1)], 776public Func<Assembly, string, CancellationToken, ImmutableArray<IExtensionMessageHandlerWrapper<Solution>>>? CreateWorkspaceMessageHandlersCallback { get; set; } 779public ImmutableArray<IExtensionMessageHandlerWrapper<Solution>> CreateWorkspaceMessageHandlers(Assembly assembly, string extensionIdentifier, CancellationToken cancellationToken)
Services\SolutionAssetCacheTests.cs (1)
74var solution = workspace.CurrentSolution;
Services\SolutionServiceTests.cs (100)
50var solution = workspace.CurrentSolution; 54var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 67var solution = workspace.CurrentSolution; 71var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, cancellationToken: CancellationToken.None); 93var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 122var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 142var solution = workspace.CurrentSolution; 146var first = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 147var second = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 167static Solution SetSolutionProperties(Solution solution, int version) 181static void ValidateProperties(Solution solution, int version, bool isRecovered) 215static Solution SetSolutionProperties(Solution solution, int version) 227static void ValidateProperties(Solution solution, int version) 250Solution SetProjectProperties(Solution solution, int version) 266void ValidateProperties(Solution solution, int version) 420var solution1 = workspace.CurrentSolution; 423var remoteSolution1 = await GetInitialOOPSolutionAsync(remoteWorkspace, assetProvider, solution1); 428var currentSolution = remoteSolution1.WithDocumentText(remoteSolution1.Projects.First().Documents.First().Id, SourceText.From(code + " class Test2 { }")); 429var oopSolution2 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(currentSolution); 438var remoteSolution3 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(currentSolution); 447var solution2 = remoteWorkspace.GetTestAccessor().CreateSolutionFromInfo(solutionInfo2); 450var solution3 = await remoteWorkspace.GetTestAccessor().UpdateWorkspaceCurrentSolutionAsync(solution2); 454static async Task<Solution> GetInitialOOPSolutionAsync(RemoteWorkspace remoteWorkspace, AssetProvider assetProvider, Solution solution) 464static async Task Verify(RemoteWorkspace remoteWorkspace, Solution givenSolution, Solution remoteSolution) 480var solution = workspace.CurrentSolution; 500var solution = workspace.CurrentSolution 508var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); 514var frozenSolution1 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText1).Project.Solution; 523var frozenSolution2 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText2).Project.Solution; 539var solution = workspace.CurrentSolution; 554var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); 562var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 568var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 580var solution = workspace.CurrentSolution; 594var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 601var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 607var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); 621var solution = workspace.CurrentSolution; 635var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 642var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); 654var solution = workspace.CurrentSolution; 669var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); 675var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 682var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 695var solution = workspace.CurrentSolution; 711var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); 717var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 723var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 735var solution = workspace.CurrentSolution; 751var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None); 757var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 763var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 775var solution = workspace.CurrentSolution; 789var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 796var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 808var solution = workspace.CurrentSolution; 822var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); 834var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 846var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None); 863var solution = workspace.CurrentSolution; 877var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); 890var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 909var solution = workspace.CurrentSolution; 932var solution = workspace.CurrentSolution; 946var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None); 959var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None); 977var solution = workspace.CurrentSolution; 996var solution = workspace.CurrentSolution; 1028var solution = workspace.CurrentSolution; 1066var solution = workspace.CurrentSolution; 1092var solution = workspace.CurrentSolution; 1104var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 1119var solution = workspace.CurrentSolution; 1133var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, CancellationToken.None); 1148var solution = workspace.CurrentSolution; 1164var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, CancellationToken.None); 1195var solution = workspace.CurrentSolution; 1218var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, CancellationToken.None); 1250private static async Task VerifySolutionUpdate(string code, Func<Solution, Solution> newSolutionGetter) 1259Func<Solution, Solution> newSolutionGetter, 1260Action<Solution>? oldSolutionValidator = null, 1261Action<Solution>? newSolutionValidator = null) 1266Func<Solution, Solution> newSolutionGetter, 1267Action<Solution>? oldSolutionValidator, 1268Action<Solution>? oldRecoveredSolutionValidator, 1269Action<Solution>? newRecoveredSolutionValidator) 1271var solution = workspace.CurrentSolution; 1282var recoveredSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 1289var newSolution = newSolutionGetter(solution); 1294var recoveredNewSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 1300var third = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, CancellationToken.None); 1307private static async Task<AssetProvider> GetAssetProviderAsync(Workspace workspace, RemoteWorkspace remoteWorkspace, Solution solution, Dictionary<Checksum, object>? map = null)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
231var solution = workspace.CurrentSolution;
Test.Utilities (1)
CodeMetricsTestsBase.cs (1)
44var solution = new AdhocWorkspace()
Text.Analyzers (30)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (5)
25public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 55public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 60Solution solution, 132Solution solution, 142Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
91public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
178bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 183bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 191SyntaxNode? FindMostRelevantNameSpaceOrTypeDeclaration(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
214var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (9)
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) 99public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 105public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
11/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (3)
30protected abstract Task<Solution> TryAddAssignmentForPrimaryConstructorAsync( 82public async Task<Solution> AddAssignmentAsync( 111private async Task<Solution> TryAddAssignmentForFunctionLikeDeclarationAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
21Task<Solution> AddAssignmentAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
77var solution = e.NewSolution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
19ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 44Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Text.Analyzers.UnitTests (4)
IdentifiersShouldBeSpelledCorrectlyTests.cs (4)
170static Solution RenameProjectAssembly(Solution solution, ProjectId projectId) 200static Solution RenameProjectAssembly(Solution solution, ProjectId projectId)