2 instantiations of Solution
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\Solution.cs (1)
349=> compilationState == CompilationState ? this : new Solution(compilationState);
Workspace\Workspace.cs (1)
136=> new(this, solutionInfo.Attributes, options, analyzerReferences, fallbackAnalyzerOptions);
3122 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)
IdeBenchmarks (3)
InheritanceMargin\BenchmarksHelpers.cs (1)
19Solution solution,
InheritanceMargin\InheritanceMarginServiceBenchmarks.cs (1)
23private Solution _solution;
SQLitePersistentStorageBenchmark.cs (1)
68var solution = _workspace.CurrentSolution;
IdeCoreBenchmarks (13)
ClassificationBenchmarks.cs (1)
33Solution _solution;
FindReferencesBenchmarks.cs (1)
29Solution _solution;
FormatterBenchmarks.cs (1)
49var solution = new AdhocWorkspace().CurrentSolution
IncrementalSourceGeneratorBenchmarks.cs (1)
87var solution = _workspace.OpenSolutionAsync(_solutionPath, progress: null, CancellationToken.None).Result;
NavigateToBenchmarks.cs (3)
84var solution = _workspace.OpenSolutionAsync(_solutionPath, progress: null, CancellationToken.None).Result; 215var solution = _workspace.CurrentSolution; 226private 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)
21private Solution _solution;
SwitchStatementBenchmarks.cs (1)
67var solution = workspace.CurrentSolution
Metrics (1)
Program.cs (1)
331var solution = await workspace.OpenSolutionAsync(solutionFile, cancellationToken: CancellationToken.None).ConfigureAwait(false);
Metrics.Legacy (1)
src\RoslynAnalyzers\Tools\Metrics\Program.cs (1)
331var 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 (16)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (3)
104private static Task<Solution> AddAnalyzerReleaseTrackingFilesAsync(Project project) 168private static async Task<Solution> AddEntryToUnshippedFileAsync(Project project, string entryToAdd, CancellationToken cancellationToken) 186private 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)
156private static async Task<Solution> ApplyFixAsync(Document document, SyntaxNode root, FixInfo fixInfo, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (4)
83private readonly Solution _solution; 85public FixAllAdditionalDocumentChangeAction(FixAllScope fixAllScope, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, string equivalenceKey) 96protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 124var newSolution = _solution;
Microsoft.CodeAnalysis.Analyzers.UnitTests (4)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzerTests.cs (2)
4471private static Solution WithoutEnableReleaseTrackingWarning(Solution solution, ProjectId projectId)
MetaAnalyzers\ReleaseTrackingAnalyzerTests.cs (2)
999private static Solution DisableNonReleaseTrackingWarnings(Solution solution, ProjectId projectId)
Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests (2)
RestrictedInternalsVisibleToAnalyzerTests.cs (2)
123private static Solution ApplySolutionTransforms(Solution solution, ProjectId apiConsumerProjectId)
Microsoft.CodeAnalysis.CodeStyle.Fixes (81)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
345? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken)) 373private 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 (1)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
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) 96public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 99public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
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\SymbolFinder\SymbolFinderInternal.cs (2)
18ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 43Solution 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.EditorFeatures (3)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
188private static async Task<(Solution solution, TextSpan renameSpan)?> TryGetNewSolutionWithAddedMethodAsync( 222var newSolution = document.Project.Solution.WithDocumentText(formattedDocument.Id, newText);
GoToBase\CSharpGoToBaseService.cs (1)
27Solution solution, IMethodSymbol constructor, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (127)
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); 218Func<Solution, Solution> codeActionTransform, 219Func<Solution, Solution> intermediaryTransform) 226Func<Solution, Solution> codeActionTransform, 227Func<Solution, Solution> intermediaryTransform) 234Func<Solution, Solution> codeActionTransform, 235Func<Solution, Solution> intermediaryTransform, 241var originalSolution = workspace.CurrentSolution; 256var changedSolution = intermediaryTransform(originalSolution);
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)
3006var solution = testWorkspace.CurrentSolution; 3489var solution = testWorkspace.CurrentSolution; 3548var solution = testWorkspace.CurrentSolution;
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); 363var solution = workspace.CurrentSolution; 367var newSolution = solution.WithAnalyzerConfigDocumentText(editorconfig.Id, text);
ExtractMethod\ExtractMethodTests.cs (1)
11481var solution = new AdhocWorkspace().CurrentSolution;
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); 1124var oldSolution = workspace.CurrentSolution; 1125var newSolution = oldSolution.WithAdditionalDocumentText(additionalDoc.Id, SourceText.From(newText)); 1157var oldSolution = workspace.CurrentSolution; 1158var newSolution = oldSolution.WithAnalyzerConfigDocumentText(analyzerConfigDoc.Id, SourceText.From(newText)); 1247var oldSolution = workspace.CurrentSolution; 1248var newSolution = oldSolution.AddAdditionalDocument(newDocId, "app.config", "text"); 1283var oldSolution = workspace.CurrentSolution; 1284var newSolution = oldSolution.AddAnalyzerConfigDocument(newDocId, "app.config", SourceText.From("text")); 1474var solution = workspace1.CurrentSolution; 1482var newSolution = solution.WithOptions(newOptions); 1511var beforeSolutionForPrimaryWorkspace = primaryWorkspace.CurrentSolution; 1512var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
62var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.Features (40)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (4)
68private static async Task<Solution> EnableNullableReferenceTypesAsync( 71var solution = project.Solution; 266Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution) 272private readonly Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution = createChangedSolution;
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) 62private readonly Func<CodeActionPurpose, IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution = createChangedSolution; 66var changedSolution = await _createChangedSolution(
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
84var solution = document.Project.Solution;
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
70private static async Task<Solution> ConvertAsync( 97var 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)
209private async Task<Solution> ChangeImplementationAsync( 212var solution = project.Solution;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
43var solution = project.Solution;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
132static 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 (3)
61Solution solution, SyntaxTree tree, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken) 185Solution solution, ISymbol member, SyntaxTree tree, CancellationToken cancellationToken) 200Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
196var 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)
37private 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)
29private static async Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalContext, ImmutableArray<FixAllContext> contexts)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (40)
Diagnostics\Suppression\SuppressionTests.cs (4)
758var solution = workspace.CurrentSolution; 762var updatedSolution = solution.WithProjectCompilationOptions(solution.ProjectIds.Single(), compilationOptions); 1000var solution = workspace.CurrentSolution; 1004var updatedSolution = solution.WithProjectCompilationOptions(solution.ProjectIds.Single(), compilationOptions);
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (25)
39private static Solution AddDefaultTestProject(Solution solution, string source) 302var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 308var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 369var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 373var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 396var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 430var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 435var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 463var oldSolution = workspace.CurrentSolution. 512var oldSolution = workspace.CurrentSolution; 517var newSolution = workspace.CurrentSolution.WithDocumentText(documentId, SourceText.From(source2)); 543var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 581var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 586var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 620var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 625var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 661var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 666var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 708var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 712var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 742var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 745var newSolution = oldSolution.AddDocument(documentId, "goo.cs", SourceText.From(source2), filePath: filePath); 798var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 802var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2));
EnableNullable\EnableNullableTests.cs (6)
27private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolution = 43private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromRestoreKeyword = 59private static readonly Func<Solution, ProjectId, Solution> s_enableNullableInFixedSolutionFromDisableKeyword =
SemanticSearch\CSharpSemanticSearchServiceTests.cs (5)
74var solution = workspace.CurrentSolution; 278var solution = workspace.CurrentSolution; 331var solution = workspace.CurrentSolution; 396var solution = workspace.CurrentSolution; 453var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Rename\CSharpRenameRewriterLanguageService.cs (4)
49private readonly Solution _solution; 782Solution baseSolution, 783Solution newSolution, 926private static async Task<ISymbol?> GetVBPropertyFromAccessorOrAnOverrideAsync(ISymbol symbol, Solution solution, 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;
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) 78var solution = GetSolution(code); 110var solution = GetSolution(code); 147var solution = GetSolution(code); 191var solution = GetSolution(code); 237var solution = GetSolution(code1, code2); 279var solution = GetSolution(code); 315var solution = GetSolution(code1, code2); 354var solution = GetSolution(code); 391var solution = GetSolution(code); 432var solution = GetSolution(code); 478var solution = GetSolution(code); 528var solution = GetSolution(code); 555var solution = GetSolution(code); 592var solution = GetSolution(code); 619var solution = GetSolution(code); 649var solution = GetSolution(code); 678var solution = GetSolution(code); 710var solution = GetSolution(code); 761var solution = GetSolution(code); 802var solution = GetSolution(code); 835var solution = GetSolution(code); 868var solution = GetSolution(code); 901var solution = GetSolution(code); 942var solution = GetSolution(code); 975var solution = GetSolution(code); 1000var solution = GetSolution(code); 1032var solution = GetSolution(code);
Microsoft.CodeAnalysis.EditorFeatures (96)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (2)
97private static void HandleResult(ChangeSignatureResult result, Solution oldSolution, Workspace workspace, CommandExecutionContext context) 115var finalSolution = result.UpdatedSolution;
CodeActions\CodeActionEditHandlerService.cs (9)
56var oldSolution = workspace.CurrentSolution; 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) 170var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution); 190internal async Task TrackActiveSpansAsync(Solution solution) 313public async ValueTask<ImmutableArray<ActiveStatementSpan>> GetSpansAsync(Solution solution, DocumentId? documentId, string filePath, CancellationToken cancellationToken) 354var solution = document.Project.Solution;
EditAndContinue\EditAndContinueLanguageService.cs (8)
52private Solution? _pendingUpdatedDesignTimeSolution; 53private Solution? _committedDesignTimeSolution; 55public event Action<Solution>? SolutionCommitted; 76private Solution GetCurrentDesignTimeSolution() 79private Solution GetCurrentCompileTimeSolution(Solution currentDesignTimeSolution) 274private ImmutableArray<ProjectId> GetProjectIds(ImmutableArray<string> projectPaths, Solution solution) 318private ActiveStatementSpanProvider GetActiveStatementSpanProvider(Solution solution)
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)
94public 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 (1)
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,
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 (1)
50private readonly Solution _baseSolution;
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"));
Navigation\AbstractDefinitionLocationService.cs (3)
32var solution = document.Project.Solution; 113Solution solution, Document document, TextSpan span, CancellationToken cancellationToken) 131var 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)
169var solution = _workspace.CurrentSolution; 200var 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)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (13)
Completion\AbstractCompletionProviderTests.cs (3)
963var solution = testWorkspace.CurrentSolution; 1019var solution = testWorkspace.CurrentSolution; 1048var solution = testWorkspace.CurrentSolution;
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
166var 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 (44)
CodeGeneration\CodeGenerationTests.cs (1)
895public Solution Solution { get { return Workspace.CurrentSolution; } }
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
240var solution = workspace.CurrentSolution; 323var solution = workspace.CurrentSolution;
EditAndContinue\EditAndContinueLanguageServiceTests.cs (3)
46private TestWorkspace CreateEditorWorkspace(out Solution solution, out EditAndContinueService service, out EditAndContinueLanguageService languageService, Type[] additionalParts = null) 124var solution = localWorkspace.CurrentSolution; 243using 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\DependentTypeFinderTests.cs (22)
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; 643var solution = workspace.CurrentSolution; 669var solution = workspace.CurrentSolution; 733var solution = workspace.CurrentSolution; 776var solution = workspace.CurrentSolution;
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
40var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (27)
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;
Peek\DefinitionPeekableItem.cs (1)
70var solution = workspace.CurrentSolution;
Peek\PeekableItemFactory.cs (1)
61var solution = project.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)
26public Task<Solution> GetFixAsync( 44public Task<Solution> GetFixAsync( 62private 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 (2)
28Solution originalSolution, 94internal 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\SuggestedActionWithNestedActions.cs (2)
31Solution originalSolution, 46Solution originalSolution,
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)
573Dim verifySolutions As Func(Of Solution, Solution, Task) = Nothing 578Function(oldSolution As Solution, newSolution As Solution)
FindReferences\FindReferencesTests.vb (2)
471Private Shared Function GetFilePathAndProjectLabel(solution As Solution, syntaxTree As SyntaxTree) As String 536Private Shared Async Function LinkedFileTestHelper(solution As Solution, expectedLinkedSymbolCount As Integer) As Task
Rename\RenameEngineResult.vb (1)
128solution 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)
14internal ExtensionMessageContext(Solution solution) 22public 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 (20)
src\Tools\ExternalAccess\Razor\Shared\Cohost\Handlers\CodeActions.cs (2)
24var solution = document.Project.Solution; 45var solution = document.Project.Solution;
src\Tools\ExternalAccess\Razor\Shared\Cohost\RazorCohostRequestContext.cs (1)
18internal Solution? Solution => context.Solution;
src\Tools\ExternalAccess\Razor\Shared\RazorUri.cs (1)
21public static string GetHintNameFromGeneratedDocumentUri(Solution solution, Uri generatedDocumentUri)
src\Tools\ExternalAccess\Razor\Shared\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
src\Tools\ExternalAccess\Razor\Shared\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)
src\Tools\ExternalAccess\Razor\Shared\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)
src\Tools\ExternalAccess\Razor\Shared\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.ExternalAccess.Razor.Features (21)
RazorRequestContext.cs (1)
18internal Solution? Solution => context.Solution;
src\Tools\ExternalAccess\Razor\Shared\Cohost\Handlers\CodeActions.cs (2)
24var solution = document.Project.Solution; 45var solution = document.Project.Solution;
src\Tools\ExternalAccess\Razor\Shared\Cohost\RazorCohostRequestContext.cs (1)
18internal Solution? Solution => context.Solution;
src\Tools\ExternalAccess\Razor\Shared\RazorUri.cs (1)
21public static string GetHintNameFromGeneratedDocumentUri(Solution solution, Uri generatedDocumentUri)
src\Tools\ExternalAccess\Razor\Shared\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
src\Tools\ExternalAccess\Razor\Shared\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)
src\Tools\ExternalAccess\Razor\Shared\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)
src\Tools\ExternalAccess\Razor\Shared\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 (539)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
47protected override Task<Solution?> GetChangedSolutionAsync( 69return Task.FromResult<Solution?>(constructorDocument.WithSyntaxRoot(newRoot).Project.Solution);
AddImport\AbstractAddImportFeatureService.cs (2)
326var solution = project.Solution; 456var solution = project.Solution;
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
81Workspace 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 (4)
161var solution = document.Project.Solution; 227Solution solution, 246private async Task<(Solution updatedSolution, string? confirmationMessage)> CreateUpdatedSolutionAsync( 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 (12)
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;
CodeFixes\FixAllOccurrences\IFixMultipleOccurrencesService.cs (2)
19Task<Solution> GetFixAsync( 34Task<Solution> GetFixAsync(
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (9)
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,
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_Attribute.cs (1)
60protected override async Task<Solution> GetChangedSolutionAsync(
CodeFixesAndRefactorings\AbstractFixAllCodeAction.cs (1)
68protected sealed override Task<Solution?> GetChangedSolutionAsync(
CodeFixesAndRefactorings\AbstractFixAllGetFixesService.cs (9)
17protected abstract Solution? GetChangedSolution( 19Solution currentSolution, 20Solution newSolution, 25public async Task<Solution?> GetFixAllChangedSolutionAsync(IFixAllContext fixAllContext) 102public Solution? PreviewChanges( 104Solution currentSolution, 105Solution newSolution, 141var changedSolution = GetChangedSolution( 200protected 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)
46var solution = document.Project.Solution; 82var solution = document.Project.Solution; 221Solution newSolution;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
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)
CodeRefactorings\MoveType\AbstractMoveTypeService.Editor.cs (1)
42public abstract Task<Solution?> GetModifiedSolutionAsync();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (6)
46public override async Task<Solution?> GetModifiedSolutionAsync() 65var solutionWithNewDocument = documentWithMovedType.Project.Solution; 77private async Task<Solution> RemoveUnnecessaryImportsAsync( 78Solution solution, DocumentId sourceDocumentId, DocumentId documentWithMovedTypeId) 159var solutionWithNewDocument = projectToBeUpdated.Solution.AddDocument( 233private 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 (2)
31public override Task<Solution?> GetModifiedSolutionAsync() 32=> Task.FromResult<Solution?>(
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (1)
24public override async Task<Solution?> GetModifiedSolutionAsync()
CodeRefactorings\MoveType\IMoveTypeService.cs (1)
18Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (19)
41public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 43public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken); 114public override async Task<Solution?> TryChangeTopLevelNamespacesAsync( 134var solution = document.Project.Solution; 174public override async Task<Solution> ChangeNamespaceAsync( 193var solution = document.Project.Solution; 209var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false); 220var solutionAfterNamespaceChange = annotatedSolution; 267Solution solution, 309protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken) 346var solution = document.Project.Solution; 425private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync( 426Solution solution, 758private static async Task<Solution> RemoveUnnecessaryImportsAsync( 759Solution solution, 848private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
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)
412var solution = document.Project.Solution;
Completion\Providers\CompletionUtilities.cs (1)
33Solution? solution = null;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
94var solution = currentProject.Solution; 199Solution solution,
Completion\Providers\SymbolCompletionItem.cs (1)
232public static SupportedPlatformData? GetSupportedPlatforms(CompletionItem item, Solution solution)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (10)
215public async Task<Solution> ConvertToStructAsync( 222var solution = document.Project.Solution; 248private static async Task<Solution> AddRenameTokenAsync( 249Solution solution, 261private async Task<Solution> ConvertToStructInCurrentProcessAsync( 317var updatedSolution = await ApplyChangesAsync( 437var solution = startingProject.Solution; 523var solution = startingDocument.Project.Solution; 582private static async Task<Solution> ApplyChangesAsync( 585var 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 (3)
120Solution solution, 150Solution solution, 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,
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)
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)
30private Solution _solution; 93public CommittedSolution(DebuggingSession debuggingSession, Solution solution, IEnumerable<KeyValuePair<DocumentId, DocumentState>> initialDocumentStates) 118public bool HasNoChanges(Solution solution) 144Solution solution; 430public void CommitSolution(Solution solution)
EditAndContinue\DebuggingSession.cs (5)
113Solution solution, 497Solution solution, 614public void UpdateBaselines(Solution solution, ImmutableArray<ProjectId> rebuiltProjects) 662public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 826var newSolution = newProject.Solution;
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 (5)
263public static async ValueTask<bool> HasChangesAsync(Solution oldSolution, Solution newSolution, string sourceFilePath, CancellationToken cancellationToken) 286public static async ValueTask<bool> HasChangesAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 808public async ValueTask<SolutionUpdate> EmitSolutionUpdateAsync(Solution solution, ActiveStatementSpanProvider solutionActiveStatementSpanProvider, UpdateId updateId, CancellationToken cancellationToken)
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, IImmutableSet<ProjectId> runningProjects, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken); 26void UpdateBaselines(DebuggingSessionId sessionId, Solution solution, ImmutableArray<ProjectId> rebuiltProjects); 28ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken); 32ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EditAndContinue\ProjectDiagnostics.cs (1)
16public static ImmutableArray<DiagnosticData> ToDiagnosticData(this ImmutableArray<ProjectDiagnostics> diagnostics, Solution solution)
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (3)
58Solution solution, 143public async ValueTask UpdateBaselinesAsync(Solution solution, ImmutableArray<ProjectId> rebuiltProjects, CancellationToken cancellationToken) 159public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
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)
109public async Task<Solution> EncapsulateFieldsAsync( 117var solution = document.Project.Solution; 140private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken) 145var currentSolution = document.Project.Solution; 156var nextSolution = await EncapsulateFieldAsync(document, currentField, updateReferences, cancellationToken).ConfigureAwait(false); 166private async Task<Solution?> EncapsulateFieldAsync( 181var solution = document.Project.Solution; 192var solutionNeedingProperty = await UpdateReferencesAsync( 229private async Task<Solution> UpdateReferencesAsync( 230bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken) 274private static async Task<Solution> RenameAsync( 275Solution solution, 310private ISet<(DocumentId documentId, TextSpan span)> GetConstructorLocations(Solution solution, INamedTypeSymbol containingType) 317Solution destinationSolution,
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\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 (3)
39private Solution _lastReportedSolution = null!; 56public IUnitTestingWorkCoordinator Register(Solution solution) 274public Solution GetSolutionToAnalyze()
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (12)
217private void EnqueueSolutionChangedEvent(Solution oldSolution, Solution newSolution) 242private void EnqueueFullSolutionEvent(Solution solution, UnitTestingInvocationReasons invocationReasons) 254private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId) 266private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons) 272private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons) 282private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId) 544public string GetLanguagesStringForTelemetry(Solution solution) 590public int GetDocumentCount(Solution solution) 633public IEnumerable<(Project project, DocumentId documentId)> GetDocumentIds(Solution solution)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (4)
41private Solution? _lastSolution = null; 321var oldSolution = _lastSolution; 335void ResetLogAggregatorIfNeeded(Solution currentSolution, Solution? oldSolution)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (3)
176var solution = thisDocument.Project.Solution; 223var solution = project.Solution; 300private static IEnumerable<ProjectId> GetProjectsToAnalyze(Solution solution, ProjectId projectId)
ExternalAccess\VSTypeScript\Api\VSTypeScriptDiagnosticsUpdatedArgsWrapper.cs (1)
13public Solution? Solution
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
50Solution solution,
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
29var solution = context.Document.Project.Solution;
ExtractClass\ExtractClassWithDialogCodeAction.cs (5)
138private async Task<Solution> PullMembersUpAsync( 139Solution solution, 222private static async Task<Solution> GetSolutionWithBaseAddedAsync( 223Solution solution, 229var unformattedSolution = solution;
ExtractInterface\AbstractExtractInterfaceService.cs (12)
35protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync( 36Solution unformattedSolution, 138var solution = refactoringResult.DocumentToExtractFrom.Project.Solution; 174Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol, 216Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol, 277private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken) 282var formattedSolution = unformattedSolution; 307private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync( 308Solution solution, 325var unformattedSolution = solution; 352var updatedUnformattedSolution = await UpdateMembersWithExplicitImplementationsAsync(
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)
43var solution = project.Solution; 75var solution = project.Solution; 94Solution solution, ISymbol symbol, CancellationToken cancellationToken) 141Solution solution, ISymbol symbol, CancellationToken cancellationToken) 169Solution 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)
77public async Task<DefaultDefinitionItem?> TryRehydrateAsync(Solution solution, CancellationToken cancellationToken)
FindUsages\DefinitionItemFactory.cs (9)
30Solution solution, 36Solution solution, 44Solution solution, 63Solution solution, 77Solution solution, 96Solution solution, 153internal static AssemblyLocation GetMetadataLocation(IAssemblySymbol assembly, Solution solution, out ProjectId originatingProjectId) 163internal static ImmutableArray<AssemblyLocation> GetMetadataLocations(ISymbol definition, Solution solution, out ProjectId? originatingProjectId) 223private static ImmutableArray<DocumentSpan> GetSourceLocations(ISymbol definition, ImmutableArray<Location> locations, Solution solution, bool includeHiddenLocations)
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 (2)
87internal sealed class FindUsagesServerCallback(Solution solution, IFindUsagesContext context, OptionsProvider<ClassificationOptions> classificationOptions) 89private readonly Solution _solution = solution;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
127Solution originalSolution,
GenerateType\AbstractGenerateTypeService.cs (2)
56internal abstract Task<Solution> TryAddUsingsOrImportToDocumentAsync( 57Solution updatedSolution, SyntaxNode modifiedRoot, Document document, TSimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (4)
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)
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) 65Solution solution,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
36var solution = document.Project.Solution;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (11)
58var solution = project.Solution; 282Solution solution, 342Solution solution, 400Solution solution, 437Solution solution, 462Solution solution, 501Solution solution, 549Solution solution, 617Solution solution, 671Solution solution, 706private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
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)
291private async Task<Solution> InlineMethodAsync(Document document, 339var 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)
236private async Task<Solution> IntroduceParameterAsync(Document originalDocument, TExpressionSyntax expression, 240var modifiedSolution = originalDocument.Project.Solution;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
252private async Task<Location> RelocateSymbol_NoLockAsync(Solution solution, MetadataAsSourceGeneratedFileInfo fileInfo, SymbolKey symbolId, CancellationToken cancellationToken) 344var solution = fileInfo.Workspace.CurrentSolution;
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (6)
159private static async Task<Solution> RefactorAndMoveAsync( 162Solution oldSolution, 216private static async Task<Solution> RefactorReferencesAsync( 218Solution solution, 224var updatedSolution = solution; 345Solution solution,
MoveToNamespace\AbstractMoveToNamespaceService.cs (2)
226var originalSolution = document.Project.Solution; 275private static async Task<Solution> PropagateChangeToLinkedDocumentsAsync(Document document, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken)
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)
45private readonly Solution _solution; 58Solution solution, 93Solution solution, 105Solution solution, 534public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
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 (1)
43async Task<(ISymbol symbol, Solution solution)?> GetSymbolAsync(Document document)
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)
17Solution solution, ISymbol symbol, Location location, 25Solution solution, 36Solution 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)
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)
13public static bool IsDestinationValid(Solution solution, INamedTypeSymbol destination, CancellationToken cancellationToken)
PullMemberUp\MembersPuller.cs (5)
58public static Task<Solution> PullMembersUpAsync( 90private static async Task<Solution> PullMembersIntoInterfaceAsync( 95var solution = document.Project.Solution; 265private static async Task<Solution> PullMembersIntoClassAsync( 270var solution = document.Project.Solution;
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
70var solution = document.Project.Solution;
Rename\SymbolicRenameInfo.cs (1)
221var 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, 289private static async Task<Solution> ReplaceDefinitionsWithMethodsAsync( 290Solution originalSolution, 291Solution updatedSolution, 312Solution originalSolution, 339private static async Task<Solution> ReplaceDefinitionsWithMethodsAsync( 340Solution updatedSolution, 390Solution updatedSolution,
SemanticSearch\IRemoteSemanticSearchService.cs (1)
58internal sealed class ServerCallback(Solution solution, ISemanticSearchResultsObserver observer, OptionsProvider<ClassificationOptions> classificationOptions)
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 (3)
13internal sealed class SupportedPlatformData(Solution solution, ImmutableArray<ProjectId> invalidProjects, ImmutableArray<ProjectId> candidateProjects) 20public readonly Solution Solution = solution; 30var projects = CandidateProjects.Select(Solution.GetRequiredProject).OrderBy(p => p.Name);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
345? new Func<CancellationToken, Task<Solution>>(cancellationToken => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, cancellationToken)) 373private 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)
25Solution solution, 263Solution solution,
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (12)
69var solution = context.Document.Project.Solution; 88private async Task<Solution> ProcessResultAsync( 89Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken) 101private async Task<Solution> ProcessResultWorkerAsync( 102Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken) 283var updatedSolution = currentSolution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot); 292Solution originalSolution, 293Solution currentSolution, 355Solution solution, 408Solution solution,
UseAutoProperty\UseAutoPropertyFixAllProvider.cs (1)
30private async Task<Solution?> FixAllContextsHelperAsync(FixAllContext originalContext, ImmutableArray<FixAllContext> contexts)
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)
59private readonly ConditionalWeakTable<Solution, Solution> _designTimeToCompileTimeSolution = []; 64private Solution? _lastCompileTimeSolution; 88public Solution GetCompileTimeSolution(Solution designTimeSolution) 92_designTimeToCompileTimeSolution.TryGetValue(designTimeSolution, out var cachedCompileTimeSolution); 98var staleSolution = _lastCompileTimeSolution; 99var compileTimeSolution = designTimeSolution; 173Solution compileTimeSolution,
Workspace\ICompileTimeSolutionProvider.cs (2)
14Solution GetCompileTimeSolution(Solution designTimeSolution);
Microsoft.CodeAnalysis.Features.Test.Utilities (30)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
477var newSolution = oldProject.Solution; 544public static void SetDocumentsState(DebuggingSession session, Solution solution, CommittedSolution.DocumentState state)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (8)
69internal TestWorkspace CreateWorkspace(out Solution solution, out EditAndContinueService service, Type[]? additionalParts = null) 84internal static (Solution, Document) AddDefaultTestProject( 85Solution solution, 95internal static Project AddEmptyTestProject(Solution solution) 100internal static Solution AddDefaultTestProject( 101Solution solution, 157Solution solution, 211Solution solution,
EditAndContinue\Extensions.cs (4)
55public static Project AddTestProject(this Solution solution, string projectName, string language = LanguageNames.CSharp) 58public static Project AddTestProject(this Solution solution, string projectName, out ProjectId id) 61public static Project AddTestProject(this Solution solution, string projectName, string language, out ProjectId id) 73public 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, IImmutableSet<ProjectId>, 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, IImmutableSet<ProjectId> 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 (89)
EditAndContinue\ActiveStatementsMapTests.cs (3)
116var solution = workspace.CurrentSolution 171var solution = workspace.CurrentSolution 222var solution = workspace.CurrentSolution
EditAndContinue\CompileTimeSolutionProviderTests.cs (4)
41var designTimeSolution = workspace.CurrentSolution. 61var compileTimeSolution = provider.GetCompileTimeSolution(designTimeSolution); 126var compileTimeSolution1 = provider.GetCompileTimeSolution(workspace.CurrentSolution); 141var compileTimeSolution2 = provider.GetCompileTimeSolution(workspace.CurrentSolution);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (29)
80using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 166using var _ = CreateWorkspace(out var solution, out var service); 199using var _ = CreateWorkspace(out var solution, out var service); 233using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 280using var _ = CreateWorkspace(out var solution, out var service); 309using 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); 498using var _w = CreateWorkspace(out var solution, out var service); 567using var _ = CreateWorkspace(out var solution, out var service); 618using var _ = CreateWorkspace(out var solution, out var service); 676using var _ = CreateWorkspace(out var solution, out var service); 761using var _ = CreateWorkspace(out var solution, out var service); 813using var _ = CreateWorkspace(out var solution, out var service); 863using var _ = CreateWorkspace(out var solution, out var service); 914using var workspace = CreateWorkspace(out var solution, out var service); 962using var _ = CreateWorkspace(out var solution, out var service); 1029using var _ = CreateWorkspace(out var solution, out var service); 1105using var _ = CreateWorkspace(out var solution, out var service); 1139using var _ = CreateWorkspace(out var solution, out var service); 1240using var _ = CreateWorkspace(out var solution, out var service); 1283using var _ = CreateWorkspace(out var solution, out var service); 1344using var _ = CreateWorkspace(out var solution, out var service); 1448using var _ = CreateWorkspace(out var solution, out var service); 1488using var _ = CreateWorkspace(out var solution, out var service); 1532using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 1556var oldSolution = solution; 1600using var _ = CreateWorkspace(out var solution, out var service); 1655var oldSolution = solution;
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
34Solution solution, 68private static async Task<Solution> AddDefaultTestSolutionAsync(TestWorkspace workspace, string[] markedSources) 70var solution = workspace.CurrentSolution; 177var solution = await AddDefaultTestSolutionAsync(workspace, markedSources); 660var solution = await AddDefaultTestSolutionAsync(workspace, markedSources);
EditAndContinue\EmitSolutionUpdateResultsTests.cs (17)
25private static TestWorkspace CreateWorkspace(out Solution solution) 47private static EmitSolutionUpdateResults CreateMockResults(Solution solution, IEnumerable<ProjectId> updates, IEnumerable<ProjectId> rudeEdits) 73var solution = document.Project.Solution; 158using var _ = CreateWorkspace(out var solution); 163.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 184using var _ = CreateWorkspace(out var solution); 189.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 213using var _ = CreateWorkspace(out var solution); 218.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 239using var _ = CreateWorkspace(out var solution); 244.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 269using var _ = CreateWorkspace(out var solution); 274.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 299using var _ = CreateWorkspace(out var solution); 306.AddTestProject("R1", out var r1).AddProjectReferences([new(p1), new(p2)]).Solution 307.AddTestProject("R2", out var r2).AddProjectReferences([new(p2), new(p3)]).Solution 308.AddTestProject("R3", out var r3).AddProjectReferences([new(p3), new(p4)]).Solution
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
84var solution = localWorkspace.CurrentSolution;
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
34using var workspace = CreateWorkspace(out var solution, out var encService);
FindUsages\DefinitionItemFactoryTests.cs (29)
130var solution = workspace.CurrentSolution; 166var solution = workspace.CurrentSolution; 208var solution = workspace.CurrentSolution; 244var solution = workspace.CurrentSolution; 286var solution = workspace.CurrentSolution; 328var solution = workspace.CurrentSolution; 381var solution = workspace.CurrentSolution; 435var solution = workspace.CurrentSolution; 475var solution = workspace.CurrentSolution; 515var solution = workspace.CurrentSolution; 557var solution = workspace.CurrentSolution; 615var solution = workspace.CurrentSolution; 661var solution = workspace.CurrentSolution; 698var solution = workspace.CurrentSolution; 760var solution = workspace.CurrentSolution; 816var solution = workspace.CurrentSolution; 870var solution = workspace.CurrentSolution; 925var solution = workspace.CurrentSolution; 975var solution = workspace.CurrentSolution; 1030var solution = workspace.CurrentSolution; 1082var solution = workspace.CurrentSolution; 1144var solution = workspace.CurrentSolution; 1201var solution = workspace.CurrentSolution; 1258var solution = workspace.CurrentSolution; 1330var solution = workspace.CurrentSolution; 1390var solution = workspace.CurrentSolution; 1442var solution = workspace.CurrentSolution; 1505var solution = workspace.CurrentSolution; 1576var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.LanguageServer (2)
HostWorkspace\OpenSolutionHandler.cs (1)
39public required Uri Solution { get; set; }
LanguageServer\Handler\Restore\RestoreHandler.cs (1)
86private static ImmutableArray<string> GetRestorePaths(RestoreParams request, Solution solution, RequestContext context)
Microsoft.CodeAnalysis.LanguageServer.Protocol (61)
Extensions\Extensions.cs (8)
65public static ImmutableArray<TextDocument> GetTextDocuments(this Solution solution, Uri documentUri) 76public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri) 93public static async ValueTask<Document?> GetDocumentAsync(this Solution solution, TextDocumentIdentifier documentIdentifier, CancellationToken cancellationToken) 103public static async ValueTask<TextDocument?> GetTextDocumentAsync(this Solution solution, TextDocumentIdentifier documentIdentifier, CancellationToken cancellationToken) 151public static T FindDocumentInProjectContext<T>(this ImmutableArray<T> documents, TextDocumentIdentifier documentIdentifier, Func<Solution, DocumentId, T> documentGetter) where T : TextDocument 158var solution = documents.First().Project.Solution; 165public static Project? GetProject(this Solution solution, TextDocumentIdentifier projectIdentifier) 173public static TextDocument? GetAdditionalDocument(this Solution solution, TextDocumentIdentifier documentIdentifier)
Extensions\SourceGeneratedDocumentUri.cs (1)
50public static SourceGeneratedDocumentIdentity? DeserializeIdentity(Solution solution, Uri documentUri)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
63var solution = project.Solution;
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (2)
27var designTimeSolution = designTimeDocument.Project.Solution; 40var compileTimeSolution = services.GetRequiredService<ICompileTimeSolutionProvider>().GetCompileTimeSolution(designTimeSolution);
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 (4)
25var solution = context.Solution; 37public static async Task<LSP.WorkspaceEdit> GetCodeActionResolveEditsAsync(Solution solution, CodeActionResolveData data, ImmutableArray<CodeActionOperation> operations, ResourceOperationKind[] resourceOperations, Action<string> logFunction, CancellationToken cancellationToken) 325private static bool HasDocumentNameChange(DocumentId documentId, Solution newSolution, Solution oldSolution)
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (2)
223Solution solution, 248static 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)
57var solution = context.Solution;
Handler\Extensions\ExtensionDocumentMessageHandler.cs (1)
31var solution = context.Document.Project.Solution;
Handler\Extensions\ExtensionRegisterHandler.cs (1)
27var solution = context.Solution;
Handler\Extensions\ExtensionWorkspaceMessageHandler.cs (1)
27var solution = context.Solution;
Handler\PullHandlers\VersionedPullCache.cs (1)
95private static async Task<bool> IsFullyLoadedAsync(Solution solution, CancellationToken cancellationToken)
Handler\Rename\RenameHandler.cs (1)
36var oldSolution = document.Project.Solution;
Handler\RequestContext.cs (5)
56private readonly StrongBox<(Workspace Workspace, Solution Solution, TextDocument? Document)>? _lspSolution; 83public Solution? Solution 172Solution? solution, 187_lspSolution = new StrongBox<(Workspace Workspace, Solution Solution, TextDocument? Document)>((workspace, solution, document)); 262Solution? solution = null;
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (1)
37var solution = context.Solution;
Handler\Symbols\WorkspaceSymbolsHandler.cs (1)
54var 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 (9)
105private readonly Dictionary<Workspace, (int? forkedFromVersion, Solution solution)> _cachedLspSolutions = []; 260public async Task<(Workspace?, Solution?)> GetLspSolutionInfoAsync(CancellationToken cancellationToken) 278public async Task<(Workspace?, Solution?, TextDocument?)> GetLspDocumentInfoAsync(TextDocumentIdentifier textDocumentIdentifier, CancellationToken cancellationToken) 328private async Task<ImmutableArray<(Workspace workspace, Solution Solution, bool IsForked)>> GetLspSolutionsAsync(CancellationToken cancellationToken) 340var solutions = new FixedSizeArrayBuilder<(Workspace, Solution, bool)>(registeredWorkspaces.Length); 353async Task<(Solution Solution, bool IsForked)> GetLspSolutionForWorkspaceAsync(Workspace workspace, CancellationToken cancellationToken) 355var workspaceCurrentSolution = workspace.CurrentSolution; 482Solution workspaceSolution) 560private static ImmutableDictionary<Uri, ImmutableArray<TextDocument>> GetDocumentsForUris(ImmutableArray<Uri> trackedDocuments, Solution workspaceCurrentSolution)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (1)
102private static async Task<Solution> GetLSPSolutionAsync(TestLspServer testLspServer, Uri uri)
Ordering\RequestOrderingTests.cs (1)
268private static async Task<Solution?> GetLSPSolution(TestLspServer testLspServer, string methodName)
Symbols\WorkspaceSymbolsTests.cs (1)
246private static string GetContainerName(Solution solution, string? containingSymbolName = null)
Workspaces\LspWorkspaceManagerTests.cs (1)
775private static Task<(Workspace?, Solution?)> GetLspHostWorkspaceAndSolutionAsync(TestLspServer testLspServer)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (19)
AnnotatePublicApiFix.cs (5)
62static async Task<Solution> GetFixAsync(TextDocument publicSurfaceAreaDocument, string oldSymbolName, string newSymbolName, CancellationToken cancellationToken) 97private readonly Solution _solution; 99public FixAllAdditionalDocumentChangeAction(string title, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix) 108protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 172Solution newSolution = _solution;
DeclarePublicApiFix.cs (9)
85private static async Task<Solution> GetFixAsync(TextDocument? surfaceAreaDocument, bool isPublic, Project project, string newSymbolName, ImmutableHashSet<string> siblingSymbolNamesToRemove, CancellationToken cancellationToken) 102private static Solution AddPublicApiFiles(Project project, SourceText unshippedText, bool isPublic) 190private readonly Func<CancellationToken, Task<Solution>> _createChangedAdditionalDocument; 192public AdditionalDocumentChangeAction(string title, DocumentId? apiDocId, bool isPublic, Func<CancellationToken, Task<Solution>> createChangedAdditionalDocument) 203protected override Task<Solution> GetChangedSolutionAsync(CancellationToken cancellationToken) 214private readonly Solution _solution; 216public FixAllAdditionalDocumentChangeAction(string title, DocumentId? apiDocId, Solution solution, List<KeyValuePair<Project, ImmutableArray<Diagnostic>>> diagnosticsToFix, bool isPublic) 227protected override async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 306Solution 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 (83)
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)
36private readonly Task<Solution> _disconnectedSolutionTask; 43private Task<Solution>? _primaryBranchTask; 55Func<CancellationToken, Task<Solution>> computeDisconnectedSolutionAsync) 84public Task<Solution> PreferredSolutionTask_NoLock 103public void TryKickOffPrimaryBranchWork_NoLock(Func<Solution, CancellationToken, Task<Solution>> updatePrimaryBranchAsync) 133async Task<Solution> ComputePrimaryBranchAsync(CancellationToken cancellationToken) 135var solution = await _disconnectedSolutionTask.ConfigureAwait(false);
Host\RemoteWorkspace.SolutionCreator.cs (18)
27private readonly struct SolutionCreator(RemoteWorkspace workspace, AssetProvider assetService, Solution baseSolution) 32private readonly Solution _baseSolution = baseSolution; 34public async Task<Solution> CreateSolutionAsync(Checksum newSolutionChecksum, CancellationToken cancellationToken) 38var solution = _baseSolution; 147private async Task<Solution> UpdateProjectsAsync( 148Solution solution, SolutionStateChecksums oldSolutionChecksums, SolutionStateChecksums newSolutionChecksums, CancellationToken cancellationToken) 231private async Task<Solution> UpdateProjectsAsync( 232Solution solution, 339private async Task<Solution> UpdateProjectAsync(Project project, ProjectStateChecksums oldProjectChecksums, ProjectStateChecksums newProjectChecksums, CancellationToken cancellationToken) 428Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 429Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 473Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 474Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 603Solution incrementalSolutionBuilt,
Host\RemoteWorkspace_SolutionCaching.cs (4)
21private (Checksum checksum, Solution solution) _lastRequestedPrimaryBranchSolution; 27private readonly RemoteSolutionCache<Checksum, Solution> _lastRequestedAnyBranchSolutions = new(); 85var cachedSolution = _lastRequestedPrimaryBranchSolution.checksum == solutionChecksum 122public async ValueTask AddPinnedSolutionsAsync(HashSet<Solution> solutions, CancellationToken cancellationToken)
Host\RemoteWorkspaceManager.cs (2)
113public async ValueTask<Solution> GetSolutionAsync(ServiceBrokerClient client, Checksum solutionChecksum, CancellationToken cancellationToken) 131Func<Solution, ValueTask<T>> implementation,
Host\SolutionAssetCache.cs (2)
159using var _1 = PooledHashSet<Solution>.GetInstance(out var 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 (6)
55Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 73private static async Task<Solution> CleanupAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 76var final = newSolution;
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 (25)
EditAndContinue\ManagedHotReloadLanguageService.cs (5)
49private Solution? _committedDesignTimeSolution; 50private Solution? _pendingUpdatedDesignTimeSolution; 61private async ValueTask<Solution> GetCurrentDesignTimeSolutionAsync(CancellationToken cancellationToken) 71private static Solution GetCurrentCompileTimeSolution(Solution currentDesignTimeSolution)
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)
17Public 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)
613updatedSolution As Solution, 618cancellationToken As CancellationToken) As Task(Of Solution)
NavigationBar\VisualBasicNavigationBarItemService.vb (6)
102solution As Solution, 156solution As Solution, 182solution As Solution, 201solution As Solution, 310solution As Solution, 391solution As Solution,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (2)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (2)
24Private Shared Function AddDefaultTestProject(solution As Solution, source As String) As Solution
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
41Private ReadOnly _solution As Solution 686baseSolution As Solution, 687newSolution 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 (709)
ChangeNamespace\IChangeNamespaceService.cs (2)
55Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 61Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
CodeActions\CodeAction.cs (34)
127static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction)); 235Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 241Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 260Solution originalSolution, CancellationToken cancellationToken) 280var changedSolution = await GetChangedSolutionAsync(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false); 306var changedSolution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false); 328protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 340protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 357internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 359var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false); 398internal async Task<Solution?> GetChangedSolutionInternalAsync( 399Solution originalSolution, IProgress<CodeAnalysisProgress> progress, bool postProcessChanges = true, CancellationToken cancellationToken = default) 401var solution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false); 425Solution? originalSolution, IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken) 450protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken) 454private static async Task<Solution> PostProcessChangesAsync( 455Solution? originalSolution, 456Solution changedSolution, 524/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 528/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param> 531public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey) 535/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 539/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param> 542public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 545/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/> 547public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 706private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution; 710Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 721Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 730Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 735protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 756protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 757=> SpecializedTasks.Null<Solution>();
CodeActions\CodeAction_Cleanup.cs (11)
60Solution originalSolution, 61Solution changedSolution) 73internal static async Task<Solution> CleanSyntaxAndSemanticsAsync( 74Solution originalSolution, 75Solution changedSolution, 83var cleanedSolution = await RunAllCleanupPassesInOrderAsync( 124private static async Task<Solution> RunAllCleanupPassesInOrderAsync( 125Solution solution, 133var currentSolution = solution; 139async Task<Solution> RunParallelCleanupPassAsync( 140Solution 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)
55/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at 69/// 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) 35var solution = fixAllContext.Scope switch 51private static Task<Solution?> GetDocumentFixesAsync<TFixAllContext>( 53Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 57private static Task<Solution?> GetProjectFixesAsync<TFixAllContext>( 59Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 63private static Task<Solution?> GetSolutionFixesAsync<TFixAllContext>( 65Func<TFixAllContext, ImmutableArray<TFixAllContext>, Task<Solution?>> fixAllContextsAsync) 68var solution = fixAllContext.Solution;
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (7)
23public static async Task<Solution?> FixAllContextsAsync<TFixAllContext>( 35var originalSolution = originalFixAllContext.Solution; 41var dirtySolution = await GetInitialUncleanedSolutionAsync(originalSolution).ConfigureAwait(false); 47var cleanedSolution = await CodeAction.CleanSyntaxAndSemanticsAsync( 60var finalSolution = cleanedSolution.WithDocumentTexts(cleanedTexts); 63async Task<Solution> GetInitialUncleanedSolutionAsync(Solution originalSolution)
CodeFixesAndRefactorings\IFixAllContext.cs (1)
18Solution Solution { get; }
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)
55/// of it (like attributes), or changes to the <see cref="Project"/> or <see cref="Solution"/> it points at 69/// 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 (5)
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()
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)
62Solution solution, 400Solution solution, 448Solution solution, 462Solution solution, IEnumerable<Project> projectsToExamine) 479Solution 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)
31ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken); 845ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken) 858TSymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
27protected 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)
21Solution solution,
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (1)
29Solution 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 (3)
37protected Solution Solution => Engine._solution; 93Solution solution, MetadataUnifyingSymbolHashSet symbols, CancellationToken cancellationToken) 103Solution solution, ISymbol symbol, CancellationToken cancellationToken)
FindSymbols\SymbolFinder.cs (3)
139public static Task<ISymbol?> FindSourceDefinitionAsync(ISymbol? symbol, Solution solution, CancellationToken cancellationToken = default) 142internal static ISymbol? FindSourceDefinition(ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 189ISymbol 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, 70Solution solution, ISymbol searchSymbol, ISymbol symbolToMatch) 127Solution solution, 160Solution 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)
36var solution = project.Solution;
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
84var solution = project.Solution; 122var solution = _workspace.CurrentSolution;
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (2)
19internal sealed class LinkedFileDiffMergingSession(Solution oldSolution, Solution newSolution, SolutionChanges solutionChanges)
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\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 (3)
60Solution solution, ISymbol symbol, CancellationToken cancellationToken) 72ISymbol symbol, Solution solution, CancellationToken cancellationToken, 100Solution solution, 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) 344Solution solution, 400private static Location? GetSymbolLocation(Solution solution, ISymbol symbol, CancellationToken cancellationToken)
Rename\ConflictEngine\ConflictResolver.Session.cs (5)
97var baseSolution = _renameLocationSet.Solution; 706var solution = _renameLocationSet.Solution; 773private async Task<Solution> AnnotateAndRename_WorkerAsync( 774Solution originalSolution, 775Solution partiallyRenamedSolution,
Rename\ConflictEngine\MutableConflictResolution.cs (6)
22Solution oldSolution, 34public readonly Solution OldSolution = oldSolution; 50public Solution CurrentSolution { get; private set; } = oldSolution; 60internal void UpdateCurrentSolution(Solution solution) 63internal async Task<Solution> RemoveAllRenameAnnotationsAsync( 64Solution intermediateSolution,
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
146internal async Task<Solution> SimplifyAsync(Solution solution, IEnumerable<DocumentId> documentIds, bool replacementTextValid, AnnotationTable<RenameAnnotation> renameAnnotations, CancellationToken cancellationToken)
Rename\ConflictResolution.cs (5)
30private readonly Solution? _newSolutionWithoutRenamedDocument; 33public readonly Solution? OldSolution; 38public readonly Solution? NewSolution; 71Solution oldSolution, 72Solution newSolutionWithoutRenamedDocument,
Rename\IRemoteRenamerService.cs (1)
88public async ValueTask<RenameLocation> RehydrateAsync(Solution solution, CancellationToken cancellation)
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 (1)
39internal override async Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken)
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, 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, CancellationToken cancellationToken) 244internal static async Task<IEnumerable<RenameLocation>> GetRenamableReferenceLocationsAsync(ISymbol referencedSymbol, ISymbol originalSymbol, ReferenceLocation location, Solution solution, CancellationToken cancellationToken) 321Solution 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 (14)
16public static IEnumerable<DocumentId> GetChangedDocuments(this Solution? newSolution, Solution oldSolution) 32public static TextDocument? GetTextDocument(this Solution solution, DocumentId? documentId) 35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 38public static Project GetRequiredProject(this Solution solution, ProjectId projectId) 49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId) 76public static SourceGeneratedDocument GetRequiredSourceGeneratedDocumentForAlreadyGeneratedId(this Solution solution, DocumentId documentId) 89public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 92public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default) 96public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 99public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 102public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId) 109public static Solution WithUpToDateSourceGeneratorDocuments(this Solution solution, IEnumerable<ProjectId> projectIds)
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\SymbolFinder\SymbolFinderInternal.cs (2)
18ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 43Solution 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\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (14)
66private readonly Func<Solution, DocumentId, bool> _documentAlreadyInWorkspace; 69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction; 73Func<Solution, DocumentId, bool> documentAlreadyInWorkspace, 76Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction, 541Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 543Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 556Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 558Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments,
Workspace\ProjectSystem\ProjectSystemProject.cs (8)
234private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false) 301Solution solution, ProjectId projectId) 330private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue) 767public static (Solution newSolution, ProjectUpdateState newProjectUpdateState) UpdateProjectAnalyzerReferences( 768Solution solution, 824var newSolution = solution.WithProjectAnalyzerReferences(project.Id, isolatedReferences);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (10)
155var newSolution = w.CreateSolution(solutionInfo); 268public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation) 544Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")] 587Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")] 588private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectId projectIdWithMetadataReference, ProjectId referencedProjectId) 703Solution currentSolution, 833var newSolution = solution 873Func<Solution, ProjectId, ProjectUpdateState, TReference, TReference, (Solution newSolution, ProjectUpdateState newProjectUpdateState)> update,
Workspace\ProjectSystem\SolutionChangeAccumulator.cs (7)
10/// A little helper type to hold onto the <see cref="Solution"/> being updated in a batch, which also 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)
34internal Project(Solution solution, ProjectState projectState) 48public Solution Solution { get; }
Workspace\Solution\Solution.cs (110)
37private readonly AsyncLazy<Solution> _cachedFrozenSolution; 43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = []; 47AsyncLazy<Solution>? cachedFrozenSolution = null) 161private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject; 162private static Project CreateProject(ProjectId projectId, Solution solution) 348private Solution WithCompilationState(SolutionCompilationState compilationState) 364public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language) 368public Solution AddProject(ProjectInfo projectInfo) 376internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos) 380public Solution RemoveProject(ProjectId projectId) 388internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds) 395public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName) 410public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath) 420public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath) 430public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info) 440public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace) 450internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm) 460public Solution WithProjectName(ProjectId projectId, string name) 475public Solution WithProjectFilePath(ProjectId projectId, string? filePath) 486public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options) 502public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options) 517internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options) 525internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation) 537internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers) 548internal Solution WithHasSdkCodeStyleAnalyzers(ProjectId projectId, bool hasSdkCodeStyleAnalyzers) 564public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 579internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes) 588internal Solution WithProjectInfo(ProjectInfo info) 602public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference) 618public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences) 648public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 679public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences) 700public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference) 715public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences) 742public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference) 764public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences) 780public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 795public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 829public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 858public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 871public Solution AddAnalyzerReference(AnalyzerReference analyzerReference) 883public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 907public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference) 923public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 937public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 955public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false) 974public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue) 992private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated) 1006public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1031public Solution AddDocument(DocumentInfo documentInfo) 1035/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include 1038/// <returns>A new <see cref="Solution"/> with the documents added.</returns> 1039public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos) 1046public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 1053public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1074public Solution AddAdditionalDocument(DocumentInfo documentInfo) 1077public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos) 1084public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1129public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos) 1135public Solution RemoveDocument(DocumentId documentId) 1144public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds) 1150private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1156public Solution RemoveAdditionalDocument(DocumentId documentId) 1165public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1171private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1177public Solution RemoveAnalyzerConfigDocument(DocumentId documentId) 1186public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1192private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1198public Solution WithDocumentName(DocumentId documentId, string name) 1217public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders) 1232public Solution WithDocumentFilePath(DocumentId documentId, string? filePath) 1246public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1249internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue) 1269public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1290public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1311public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1332public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1353public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1374public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue) 1378internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue) 1394internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer) 1397internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 1404public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1427public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1448public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1469public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1490internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken) 1494internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken) 1497private Solution ComputeFrozenSolution(CancellationToken cancellationToken) 1505var frozenSolution = new Solution( 1520internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken) 1524AsyncLazy<Solution> GetLazySolution() 1539static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId) 1544static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken) 1547var solution = new Solution(newCompilationState); 1558internal async Task<Solution> WithMergedLinkedFileChangesAsync( 1559Solution oldSolution, 1582internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services) 1590public Solution GetIsolatedSolution() 1599public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1629var newSolution = WithCompilationState(newCompilationState); 1638internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents) 1642internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap) 1649internal Solution WithoutFrozenSourceGeneratedDocuments() 1660internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState) 1667public SolutionChanges GetChanges(Solution oldSolution) 1678/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a 1695/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/> 1716public Solution WithOptions(OptionSet options) 1729internal Solution WithOptions(SolutionOptionSet options)
Workspace\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)
987/// <inheritdoc cref="Solution.WithDocumentSyntaxRoots(ImmutableArray{ValueTuple{DocumentId, SyntaxNode}}, PreservationMode)"/> 1266/// 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)
21/// cref="Solution.WithFrozenSourceGeneratedDocuments"/> to ensure that a particular solution snapshot contains a
Workspace\Solution\SolutionState.cs (2)
225/// This implicitly also changes the value of <see cref="Solution.Workspace"/> for this solution, 1185/// <inheritdoc cref="Solution.GetDocumentIdsWithFilePath(string?)" />
Workspace\TextExtensions.cs (3)
26var solution = workspace.CurrentSolution; 62var solution = workspace.CurrentSolution; 109var solution = workspace.CurrentSolution;
Workspace\Workspace.cs (145)
34/// workspace's <see cref="TryApplyChanges(Solution)"/> method. 55private Solution _latestSolution; 59/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>. 126protected internal Solution CreateSolution(SolutionInfo solutionInfo) 135private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 141protected internal Solution CreateSolution(SolutionId id) 151/// after <see cref="TryApplyChanges(Solution)"/> is called. 153public Solution CurrentSolution 168protected Solution SetCurrentSolution(Solution solution) 180private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution) 187var oldSolution = this.CurrentSolution; 199/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 201Func<Solution, Solution> transformation, 205Action<Solution, Solution>? onBeforeUpdate = null, 206Action<Solution, Solution>? onAfterUpdate = null) 229internal (bool updated, Solution newSolution) SetCurrentSolution( 230Func<Solution, Solution> transformation, 231Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 232Action<Solution, Solution>? onBeforeUpdate = null, 233Action<Solution, Solution>? onAfterUpdate = null) 248internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync( 250Func<Solution, Solution> transformation, 251Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 252Action<Solution, Solution>? onBeforeUpdate, 253Action<Solution, Solution>? onAfterUpdate, 261var newSolution = data.transformation(oldSolution); 287static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution) 327static Solution UpdateAddedDocumentToExistingContentsInSolution( 328Solution solution, ArrayBuilder<DocumentId> addedDocumentIds) 368static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds) 403/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language. 405/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>. 412/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/> 413/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>. 415private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution) 465/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated 470/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated 472private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>( 474Func<Solution, TData, Solution> transformation, 476Action<Solution, Solution, TData>? onBeforeUpdate = null, 477Action<Solution, Solution, TData>? onAfterUpdate = null) 493/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/> 494private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>( 497Func<Solution, TData, Solution> transformation, 499Action<Solution, Solution, TData>? onBeforeUpdate, 500Action<Solution, Solution, TData>? onAfterUpdate, 507var oldSolution = Volatile.Read(ref _latestSolution); 519var newSolution = transformation(oldSolution, data); 557/// Gets or sets the set of all global options and <see cref="Solution.Options"/>. 558/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>. 742private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects) 754private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project) 770var newSolution = this.CreateSolution(solutionInfo); 786var newSolution = this.CreateSolution(reloadedSolutionInfo); 1016/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment. 1109var newSolution = oldSolution; 1253Func<Solution, DocumentId, TextDocument?> getDocumentInSolution, 1254Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText, 1289var newSolution = oldSolution; 1290var previousSolution = newSolution; 1444static Solution UpdateReferencesAfterAdd(Solution solution) 1501/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method. 1523public virtual bool TryApplyChanges(Solution newSolution) 1526internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker) 1560var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result; 1828/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1835/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1836/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1841/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed. 1848/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1849/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1854/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project 2057/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution. 2068/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution. 2079/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options. 2097/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options. 2114/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project. 2125/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project. 2136/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project. 2147/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project. 2158/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project. 2169/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project. 2180/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution. 2191/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution. 2202/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project. 2213/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project. 2246/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project. 2257/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project. 2279/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project. 2290/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project. 2320private static void CheckSolutionIsEmpty(Solution solution) 2334private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId) 2350private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId) 2447internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2458internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2472private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId) 2488private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId) 2504private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId) 2533private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2549private static void CheckAnalyzerConfigDocumentIsNotInSolution(Solution solution, DocumentId documentId)
Workspace\Workspace_Editor.cs (15)
554Action<Solution, DocumentId> checkTextDocumentIsInSolution, 555Func<Solution, DocumentId, SourceText, PreservationMode, Solution> withDocumentText, 556Func<Solution, DocumentId, TextAndVersion, PreservationMode, Solution> withDocumentTextAndVersion, 748Action<Solution, DocumentId> checkTextDocumentIsInSolution, 749Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader) 849private SourceText GetOpenDocumentText(Solution solution, DocumentId documentId) 862protected virtual Solution AdjustReloadedSolution(Solution oldSolution, Solution reloadedSolution) 864var newSolution = reloadedSolution; 881var oldSolution = oldProject.Solution; 882var newSolution = reloadedProject.Solution;
Workspace\Workspace_Events.cs (3)
66protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId projectId = null, DocumentId documentId = null) 270var 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 (84)
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)
383var solution = await workspace.OpenSolutionAsync(solutionFilePath);
VisualStudioMSBuildWorkspaceTests.cs (77)
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( 394var solution = await workspace.OpenSolutionAsync(solutionFilePath); 404var solution1 = solution.WithDocumentText(document.Id, SourceText.From("using test;")); 417var solution2 = solution1.WithProjectCompilationOptions(project.Id, project.CompilationOptions.WithOutputKind(OutputKind.NetModule)); 427var solution3 = solution2.AddProject(pid2, "foo", "foo", LanguageNames.CSharp); 593var solution = await workspace.OpenSolutionAsync(solutionFilePath); 793var solution = await workspace.OpenSolutionAsync(solutionFilePath); 811var solution = await workspace.OpenSolutionAsync(solutionFilePath); 829var solution = await workspace.OpenSolutionAsync(solutionFilePath); 847var solution = await workspace.OpenSolutionAsync(solutionFilePath); 960var solution = await ws.OpenSolutionAsync(GetSolutionFileName(@"TestSolution.sln")); 994var 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); 2663var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2680var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2686var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2692var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2710var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2736var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2897var noEncodingSolution = noEncodingDoc.Project.Solution; 2919var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2947var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3024var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3155var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3197var solution = await workspace.OpenSolutionAsync(fullPath); 3260var 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 (364)
CodeCleanup\AddMissingTokensTests.cs (1)
2728var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\CodeCleanupTests.cs (1)
416var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\FixIncorrectTokenTests.cs (1)
753var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (1)
1029var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\ReduceTokenTests.cs (1)
2016var solution = new AdhocWorkspace().CurrentSolution;
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (1)
1452var solution = new AdhocWorkspace().CurrentSolution;
FindAllDeclarationsTests.cs (19)
133var solution = workspace.CurrentSolution; 156var solution = workspace.CurrentSolution; 365using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 375var declarations = await SymbolFinder.FindSourceDeclarationsAsync((Solution)null, "Test", true); 384using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 394using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 483using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 491using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 499using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 509await SymbolFinder.FindSourceDeclarationsAsync((Solution)null, str => str.Contains("Test")); 518using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 528using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 614using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 627using var workspace = CreateWorkspaceWithSolution(workspaceKind, out var solution); 637await SymbolFinder.FindSourceDeclarationsWithPatternAsync((Solution)null, "test"); 646using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 656using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 666using var workspace = CreateWorkspaceWithSolution(SolutionKind.SingleClass, out var solution); 699var 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 102var solution = GetSingleDocumentSolution(workspace, text); 122var solution = workspace.CurrentSolution 172var sln = CreateWorkspace().CurrentSolution 211var sln = CreateWorkspace().CurrentSolution 275var sln = CreateWorkspace().CurrentSolution 322var solution = GetSingleDocumentSolution(workspace, text); 363var solution = CreateWorkspace().CurrentSolution; 432var solution = GetMultipleDocumentSolution(workspace, [implText, interface1Text, interface2Text]); 453var solution = CreateWorkspace().CurrentSolution; 512var solution = GetSingleDocumentSolution(workspace, text); 539var solution = GetSingleDocumentSolution(workspace, text); 572var solution = GetSingleDocumentSolution(workspace, text, LanguageNames.VisualBasic); 614var 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)
25var 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 (242)
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; 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 1696var solution = workspace.CurrentSolution 1719var solution = workspace.CurrentSolution 1736var solution = workspace.CurrentSolution 1761var solution = workspace.CurrentSolution 1911var solution = workspace.CurrentSolution; 1929var solution2 = solution.WithProjectReferences(projectId, projectRefs); 1944var solution = workspace.CurrentSolution; 1949var newSolution1 = solution.WithProjectReferences(projectId, projectRefs); 1960var solution = workspace.CurrentSolution; 1975var solution2 = solution.AddProjectReferences(projectId, EmptyEnumerable<ProjectReference>()); 1980var solution3 = solution.AddProjectReferences(projectId, e); 2002var solution = workspace.CurrentSolution; 2013var solution2 = solution.RemoveProjectReference(projectId, externalProjectRef); 2017var solution3 = solution.RemoveProjectReference(projectId, projectRef2); 2020var solution4 = solution3.RemoveProjectReference(projectId, externalProjectRef); 2037var solution = workspace.CurrentSolution; 2073var solution = workspace.CurrentSolution; 2091var solution = workspace.CurrentSolution; 2094var solution2 = solution.AddMetadataReferences(projectId, EmptyEnumerable<MetadataReference>()); 2100var solution3 = solution.AddMetadataReferences(projectId, OnceEnumerable(metadataRef1, metadataRef2)); 2116var solution = workspace.CurrentSolution; 2123var solution2 = solution.RemoveMetadataReference(projectId, metadataRef1); 2126var solution3 = solution2.RemoveMetadataReference(projectId, metadataRef2); 2143var solution = workspace.CurrentSolution; 2161var solution = workspace.CurrentSolution; 2164var solution2 = solution.AddAnalyzerReferences(projectId, EmptyEnumerable<AnalyzerReference>()); 2170var solution3 = solution.AddAnalyzerReferences(projectId, OnceEnumerable(analyzerRef1, analyzerRef2)); 2173var solution4 = solution3.AddAnalyzerReferences(projectId, []); 2189var solution = workspace.CurrentSolution; 2196var solution2 = solution.RemoveAnalyzerReference(projectId, analyzerRef1); 2199var solution3 = solution2.RemoveAnalyzerReference(projectId, analyzerRef2); 2216var solution = workspace.CurrentSolution; 2230var solution = workspace.CurrentSolution; 2232var solution2 = solution.AddAnalyzerReferences(EmptyEnumerable<AnalyzerReference>()); 2238var solution3 = solution.AddAnalyzerReferences(OnceEnumerable(analyzerRef1, analyzerRef2)); 2256var solution = workspace.CurrentSolution; 2262var solution2 = solution.RemoveAnalyzerReference(analyzerRef1); 2265var solution3 = solution2.RemoveAnalyzerReference(analyzerRef2); 2283var solution = workspace.CurrentSolution; 2287var solution2 = solution.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2294var solution3 = solution2.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2309var solution4 = solution3.AddAnalyzerConfigDocument(editorConfigId, ".editorconfig", SourceText.From(editorConfigContent), filePath: Path.Combine(s_projectDir, "subfolder", ".editorconfig")); 2313static void TestOptionValues(Solution solution, string expectedA, bool hasBWithoutFallback, string expectedB, string expectedBFile) 2359var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2367var solution2 = solution.AddDocument(documentId, "name", loader, folders); 2385var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2393var solution2 = solution.AddDocument(documentId, "name", "text", folders, filePath); 2415var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2424var solution2 = solution.AddDocument(documentId, "name", sourceText, folders, filePath, isGenerated: true); 2444var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2453var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 2473var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2484var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 2504var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2513var solution2 = solution.AddDocument(documentId, "name", root); 2527var solution = workspace.CurrentSolution; 2540var solution = workspace.CurrentSolution; 2552var solution = workspace.CurrentSolution; 2567var solution = workspace.CurrentSolution 2613var solution = workspace.CurrentSolution 2637var solution = workspace.CurrentSolution 2665var solution = workspace.CurrentSolution 2675var solution = workspace.CurrentSolution; 2689var solution = workspace.CurrentSolution 2710var solution = workspace.CurrentSolution 2731var solution = workspace.CurrentSolution 2750var solution = workspace.CurrentSolution 2769var solution = workspace.CurrentSolution 2784var solution = workspace.CurrentSolution 2803var solution = workspace.CurrentSolution 2820var solution = workspace.CurrentSolution 2835private static async Task ValidateSolutionAndCompilationsAsync(Solution solution) 2923var solution = workspace.CurrentSolution; 2944var solution = workspace.CurrentSolution; 2982var solution = workspace.CurrentSolution; 2991var newSolution = solution.AddAnalyzerReference(project1, analyzerReference); 3040var solution = workspace.CurrentSolution; 3058var sol = workspace.CurrentSolution; 3067var sol2 = sol.RemoveProject(pid); 3077var sol = workspace.CurrentSolution; 3089var sol2 = sol.RemoveProject(pid); 3103var sol = workspace.CurrentSolution; 3114var sol2 = sol.RemoveProject(pid); 3121var sol3 = sol2.AddProject(pid, "goo", "goo.dll", LanguageNames.CSharp); 3139var sol = workspace.CurrentSolution 3160var solution1 = workspace.CurrentSolution 3166var solution2 = solution1.WithDocumentSyntaxRoot(documentId, newRoot); 3183var sol = workspace.CurrentSolution 3194var sol2 = sol.WithDocumentSyntaxRoot(did, annotatedRoot); 3224var sol = workspace.CurrentSolution 3265var solution = workspace.CurrentSolution 3296var sol = workspace.CurrentSolution; 3327var sol = workspace.CurrentSolution 3349var sol = workspace.CurrentSolution 3370var sol = workspace.CurrentSolution 3394var sol = workspace.CurrentSolution 3416var sol = workspace.CurrentSolution 3437var sol = workspace.CurrentSolution 3457var sol = workspace.CurrentSolution 3477var sol = workspace.CurrentSolution 3497var sol = workspace.CurrentSolution 3516var sol = workspace.CurrentSolution 3526private static ObjectReference<SourceText> GetObservedText(Solution solution, DocumentId documentId, string expectedText = null) 3547var sol = workspace.CurrentSolution 3557private static ObjectReference<SourceText> GetObservedTextAsync(Solution solution, DocumentId documentId, string expectedText = null) 3579var sol = workspace.CurrentSolution 3589private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRoot(Solution solution, DocumentId documentId) 3605var sol = workspace.CurrentSolution 3615private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRootAsync(Solution solution, DocumentId documentId) 3639var sol = workspace.CurrentSolution 3669var sol = workspace.CurrentSolution 3676private static void TestRecoverableSyntaxTree(Solution sol, DocumentId did) 3720var sol = workspace.CurrentSolution 3730private static ObjectReference<Compilation> GetObservedCompilationAsync(Solution solution, ProjectId projectId) 3745var sol = workspace.CurrentSolution 3755private static ObjectReference<Compilation> GetObservedCompilation(Solution solution, ProjectId projectId) 3772var sol = workspace.CurrentSolution 3906var solution = workspace.CurrentSolution; 3959var solution = new AdhocWorkspace().CurrentSolution 3986var solution2 = solution.WithDocumentText(did3, SourceText.From(text4)); 4145var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }")); 4190var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }")); 4255var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 4367var solution = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution; 4423var currentSolution = workspace.CurrentSolution; 4563var solution = workspace.CurrentSolution; 4579var solution = workspace.CurrentSolution; 4650var solution = workspace.CurrentSolution; 4687var solution = workspace.CurrentSolution; 4723var solution = workspace.CurrentSolution; 4764var solution = workspace.CurrentSolution; 4810var solution = workspace.CurrentSolution; 4841var solution = workspace.CurrentSolution; 4951var solution = workspace.CurrentSolution; 4974var solution = workspace.CurrentSolution; 4996var solution = workspace.CurrentSolution; 5024var solution = workspace.CurrentSolution; 5052var solution = workspace.CurrentSolution; 5081var solution = workspace.CurrentSolution; 5112var solution = workspace.CurrentSolution; 5150var solution = workspace.CurrentSolution; 5167var solution = workspace.CurrentSolution; 5213var solution = workspace.CurrentSolution; 5257var solution = workspace.CurrentSolution; 5281var solution = workspace.CurrentSolution; 5419var s0 = workspace.CurrentSolution; 5429var s1 = s0.WithOptions(options); 5433var s2 = s1.AddProject("P1", "A1", LanguageNames.VisualBasic).Solution; 5437var s4 = s2.RemoveProject(s2.Projects.Single(p => p.Name == "P1").Id); 5465var solution = workspace.CurrentSolution.AddProject(projInfo); 5494var solution = workspace.CurrentSolution; 5548var solution = workspace.CurrentSolution 5576var solution = workspace.CurrentSolution 5596var solution = workspace.CurrentSolution 5615var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5634var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5656var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5686var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5716var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5746var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5819var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
SolutionTests\SolutionWithSourceGeneratorTests.cs (9)
388var solutionWithProjects = AddProjectWithReference(workspace.CurrentSolution, analyzerReference); 402static Solution AddProjectWithReference(Solution solution, TestGeneratorReference analyzerReference) 418var solution = AddEmptyProject(workspace.CurrentSolution) 659var solution = AddEmptyProject(workspace.CurrentSolution) 817var frozenSolution = originalDocument2.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 903var solution = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference).Solution; 1300static async Task<Solution> FreezeDocumentAndGetSolution(Project project, SourceGeneratedDocumentIdentity identity) 1335static async Task<Solution> FreezeDocumentAndGetSolution(Project project, SourceGeneratedDocumentIdentity identity)
SyntaxNodeTests.cs (1)
87var 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 (1)
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; 114var newSolution = await Renamer.RenameSymbolAsync(document.Project.Solution, typeSymbol, newName, optionSet, cancellationToken).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices (180)
CallHierarchy\CallHierarchyDetail.cs (1)
69var solution = _workspace.CurrentSolution;
CodeCleanup\AbstractCodeCleanUpFixer.cs (4)
158async Task<Solution> ApplyFixAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 170Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> applyFixAsync, 193private static async Task<Solution> FixProjectsAsync( 194Solution solution,
CodeLens\CodeLensCallbackListener.cs (6)
64var solution = _workspace.CurrentSolution; 81var solution = _workspace.CurrentSolution; 107var solution = _workspace.CurrentSolution; 129var solution = _workspace.CurrentSolution; 142Solution solution, CodeLensDescriptor descriptor, CodeLensDescriptorContext descriptorContext, CancellationToken cancellationToken) 206private Task<Document?> GetDocumentAsync(Solution solution, Guid projectGuid, string filePath, CodeLensDescriptorContext descriptorContext)
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)
119var solution = _workspace.CurrentSolution;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
220private 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)
48var solution = document.Project.Solution;
FindReferences\VisualStudioDefinitionsAndReferencesFactory.cs (1)
32Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken)
Implementation\AbstractEditorFactory.cs (1)
326var forkedSolution = projectToAddTo.Solution.AddDocument(
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,
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)
28private readonly Solution _newSolution; 29private readonly Solution _oldSolution; 41public Solution FinalSolution { get; private set; } 44public PreviewEngine(string title, string helpString, string description, string topLevelItemName, Glyph topLevelGlyph, Solution newSolution, Solution oldSolution, IComponentModel componentModel, bool showCheckBoxes = true) 55Solution newSolution, 56Solution oldSolution, 213var updatedSolution = _topLevelChange.GetUpdatedSolution(applyingChanges: false);
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)
24private readonly Solution _newSolution; 30Solution newSolution, 61public Solution GetUpdatedSolution(bool applyingChanges) 63var solution = ApplyFileChanges(_newSolution, Children.Changes.OfType<FileChange>(), applyingChanges); 72private static Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fileChanges, bool applyingChanges) 183private static Solution ApplyReferenceChanges(Solution solution, IEnumerable<ReferenceChange> referenceChanges)
Progression\GraphBuilder.cs (15)
43private readonly Solution _solution; 45public GraphBuilder(Solution solution) 51Solution solution, IEnumerable<GraphNode> inputNodes, CancellationToken cancellationToken) 256internal static async Task<GraphNode> GetOrCreateNodeAsync(Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken) 310private static async Task<GraphNode> GetOrCreateNodeForParameterAsync(Graph graph, IParameterSymbol parameterSymbol, Solution solution, CancellationToken cancellationToken) 323private static async Task<GraphNode> GetOrCreateNodeForLocalVariableAsync(Graph graph, ISymbol localSymbol, Solution solution, CancellationToken cancellationToken) 332private static async Task<GraphNode> GetOrCreateNodeAssemblyAsync(Graph graph, IAssemblySymbol assemblySymbol, Solution solution, CancellationToken cancellationToken) 341private static void UpdateLabelsForNode(ISymbol symbol, Solution solution, GraphNode node) 555private static async Task<GraphNode> GetOrCreateNodeForNamespaceAsync(Graph graph, INamespaceSymbol symbol, Solution solution, CancellationToken cancellationToken) 564private static async Task<GraphNode> GetOrCreateNodeForNamedTypeAsync(Graph graph, INamedTypeSymbol namedType, Solution solution, CancellationToken cancellationToken) 617private static async Task<GraphNode> GetOrCreateNodeForMethodAsync(Graph graph, IMethodSymbol method, Solution solution, CancellationToken cancellationToken) 635private static async Task<GraphNode> GetOrCreateNodeForFieldAsync(Graph graph, IFieldSymbol field, Solution solution, CancellationToken cancellationToken) 654private static async Task<GraphNode> GetOrCreateNodeForPropertyAsync(Graph graph, IPropertySymbol property, Solution solution, CancellationToken cancellationToken) 667private static async Task<GraphNode> GetOrCreateNodeForEventAsync(Graph graph, IEventSymbol eventSymbol, Solution solution, CancellationToken cancellationToken) 714public async Task<GraphNode?> CreateNodeAsync(Solution solution, INavigateToSearchResult result, CancellationToken cancellationToken)
Progression\GraphNodeCreation.cs (2)
19public static async Task<GraphNodeId> CreateNodeIdAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 60public static async Task<GraphNode> CreateNodeAsync(this Graph graph, ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Progression\GraphNodeIdCreation.cs (15)
36internal static async Task<GraphNodeId> GetIdForNamespaceAsync(INamespaceSymbol symbol, Solution solution, CancellationToken cancellationToken) 51internal static async Task<GraphNodeId> GetIdForTypeAsync(ITypeSymbol symbol, Solution solution, CancellationToken cancellationToken) 66private static async Task<IEnumerable<GraphNodeId>> GetPartialsForNamespaceAndTypeAsync(ITypeSymbol symbol, bool includeNamespace, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false) 121private static async Task<GraphNodeId> GetPartialForTypeAsync(ITypeSymbol symbol, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false) 153private static async Task<GraphNodeId> GetPartialForNamedTypeAsync(INamedTypeSymbol namedType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken, bool isInGenericArguments = false) 212private static async Task<GraphNodeId> GetPartialForPointerTypeAsync(IPointerTypeSymbol pointerType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken) 236private static async Task<GraphNodeId> GetPartialForArrayTypeAsync(IArrayTypeSymbol arrayType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken) 257private static async Task<GraphNodeId> GetPartialForTypeParameterSymbolAsync(ITypeParameterSymbol typeParameterSymbol, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken) 288public static async Task<GraphNodeId> GetIdForMemberAsync(ISymbol member, Solution solution, CancellationToken cancellationToken) 392private static async Task<Uri> GetAssemblyFullPathAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 398private static async Task<Uri> GetAssemblyFullPathAsync(IAssemblySymbol containingAssembly, Solution solution, CancellationToken cancellationToken) 446internal static async Task<GraphNodeId> GetIdForAssemblyAsync(IAssemblySymbol assemblySymbol, Solution solution, CancellationToken cancellationToken) 459internal static async Task<GraphNodeId> GetIdForParameterAsync(IParameterSymbol symbol, Solution solution, CancellationToken cancellationToken) 487internal static async Task<GraphNodeId> GetIdForLocalVariableAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 517private static async Task<int> GetLocalVariableIndexAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Progression\GraphQueries\CallsGraphQuery.cs (2)
19public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken) 42ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Progression\GraphQueries\ContainsChildrenGraphQuery.cs (1)
17public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ContainsGraphQuery.cs (1)
16public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ImplementedByGraphQuery.cs (1)
17public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ImplementsGraphQuery.cs (1)
18public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\InheritedByGraphQuery.cs (1)
17public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\InheritsGraphQuery.cs (1)
17public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\IsCalledByGraphQuery.cs (1)
18public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
18public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\OverriddenByGraphQuery.cs (1)
15public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\OverridesGraphQuery.cs (1)
16public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ProgressionNavigateToSearchCallback.cs (2)
18private readonly Solution _solution; 22public ProgressionNavigateToSearchCallback(Solution solution, IGraphContext context, GraphBuilder graphBuilder)
Progression\GraphQueries\SearchGraphQuery.cs (1)
19public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueryManager.cs (3)
60var solution = _workspace.CurrentSolution; 101var solution = _workspace.CurrentSolution; 112Solution solution,
Progression\IGraphQuery.cs (1)
14Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, 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)
314Microsoft.CodeAnalysis.Solution newSolution, 322var currentSolution = this.CurrentSolution;
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (2)
208var solution = _workspace.CurrentSolution; 327var 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 (2)
406private static ImmutableDictionary<Document, ImmutableArray<Diagnostic>> GetDocumentDiagnosticsMappedToNewSolution(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentDiagnosticsToFixMap, Solution newSolution, string language) 425private static ImmutableDictionary<Project, ImmutableArray<Diagnostic>> GetProjectDiagnosticsMappedToNewSolution(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectDiagnosticsToFixMap, Solution newSolution, string language)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (3)
198private static Microsoft.VisualStudio.RpcContracts.DiagnosticManagement.Diagnostic? CreateDiagnostic(ProjectId projectId, Guid projectHierarchyGuid, DiagnosticData diagnostic, Solution solution) 323public InProgressState(ExternalErrorDiagnosticUpdateSource owner, Solution solution) 329public 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)
26private readonly Solution _solution; 47Solution solution, 92Solution 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)
191var solution = workspace.CurrentSolution;
Workspace\VisualStudioSymbolNavigationService.cs (1)
56var 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 (1)
SemanticSearch\SemanticSearchQueryExecutor.cs (1)
43public async Task ExecuteAsync(string? query, Document? queryDocument, Solution solution, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (46)
CodeModel\AbstractFileCodeElementTests.cs (1)
50protected Microsoft.CodeAnalysis.Solution GetCurrentSolution()
DocumentOutline\DocumentOutlineTestsBase.cs (1)
100var solution = workspace.CurrentSolution;
PersistentStorage\AbstractPersistentStorageTests.cs (43)
113var solution = CreateOrOpenSolution(nullPaths: true); 133var solution = CreateOrOpenSolution(folder); 155var solution = CreateOrOpenSolution(); 176var solution = CreateOrOpenSolution(); 199var solution = CreateOrOpenSolution(); 215var solution = CreateOrOpenSolution(); 233var solution = CreateOrOpenSolution(); 251var solution = CreateOrOpenSolution(); 266var solution = CreateOrOpenSolution(); 281var solution = CreateOrOpenSolution(); 296var solution = CreateOrOpenSolution(); 308var solution = CreateOrOpenSolution(); 321var solution = CreateOrOpenSolution(); 333var solution = CreateOrOpenSolution(); 345var solution = CreateOrOpenSolution(); 364var solution = CreateOrOpenSolution(); 383var solution = CreateOrOpenSolution(); 402var solution = CreateOrOpenSolution(); 421var solution = CreateOrOpenSolution(); 441var solution = CreateOrOpenSolution(); 461var solution = CreateOrOpenSolution(); 481var solution = CreateOrOpenSolution(); 502var solution = CreateOrOpenSolution(); 523var solution = CreateOrOpenSolution(); 544var solution = CreateOrOpenSolution(); 565var solution = CreateOrOpenSolution(); 589var solution = CreateOrOpenSolution(); 613var solution = CreateOrOpenSolution(); 637var solution = CreateOrOpenSolution(); 661var solution = CreateOrOpenSolution(); 682var solution = CreateOrOpenSolution(); 703var solution = CreateOrOpenSolution(); 724var solution = CreateOrOpenSolution(); 745var solution = CreateOrOpenSolution(); 769var solution = CreateOrOpenSolution(); 793var solution = CreateOrOpenSolution(); 817var solution = CreateOrOpenSolution(); 852var solution = CreateOrOpenSolution(); 873var solution = CreateOrOpenSolution(); 893var solution = CreateOrOpenSolution(); 974protected Solution CreateOrOpenSolution(TempDirectory? persistentFolder = null, bool nullPaths = false) 985var solution = workspace.CurrentSolution; 1003Solution 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)
80Public Overrides Sub DisplayReferencedSymbols(solution As Solution, referencedSymbols As IEnumerable(Of ReferencedSymbol))
ProjectSystemShim\Framework\TestEnvironment.vb (1)
106Public Overrides Sub DisplayReferencedSymbols(solution As Solution, referencedSymbols As IEnumerable(Of ReferencedSymbol))
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Progression\ProgressionTestState.vb (2)
57Public Async Function GetGraphContextAfterQueryWithSolution(graph As Graph, solution As Solution, graphQuery As IGraphQuery, direction As GraphContextDirection) As Task(Of IGraphContext) 83Public Function GetSolution() As Solution
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 (1)
AbstractExposeMemberForTesting`1.cs (1)
100private async Task<Solution> AddMemberToTestAccessorAsync(Document document, TextSpan sourceSpan, string memberName, string memberDocumentationCommentId, CancellationToken cancellationToken)
Roslyn.Diagnostics.Analyzers.UnitTests (2)
RelaxTestNamingSuppressorTests.cs (2)
23private static Solution WithoutSuppressedDiagnosticsTransform(Solution solution, ProjectId projectId)
Roslyn.Diagnostics.CSharp.Analyzers (1)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
66private static async Task<Solution> RemoveOptSuffixOnVariableAsync(Document document, ISymbol variableSymbol, string newName, CancellationToken cancellationToken)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
77var solution = workspace.CurrentSolution;
Roslyn.VisualStudio.Next.UnitTests (92)
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 (1)
44internal static Solution SetFullSolution(Workspace workspace)
Services\AssetProviderTests.cs (2)
75var solution = workspace.CurrentSolution; 103var solution = workspace.CurrentSolution;
Services\ServiceHubServicesTests.cs (24)
68var solution = workspace.CurrentSolution; 90var solution = workspace.CurrentSolution; 118private static async Task<AssetProvider> GetAssetProviderAsync(Workspace workspace, Workspace remoteWorkspace, Solution solution, Dictionary<Checksum, object> map = null) 145var solution = workspace.CurrentSolution; 196var solution = workspace.CurrentSolution; 267var solution = workspace.CurrentSolution; 312var solution = workspace.CurrentSolution; 1480private static async Task<Solution> VerifyIncrementalUpdatesAsync( 1484Solution solution, 1489var remoteSolution = remoteWorkspace.CurrentSolution; 1503var currentSolution = UpdateSolution(solution, projectName, documentName, csAddition, vbAddition); 1528var currentRemoteSolution = remoteWorkspace.CurrentSolution; 1584private static void VerifyStates(Solution solution1, Solution solution2, string projectName, ImmutableArray<string> documentNames) 1620private static async Task VerifyAssetStorageAsync(InProcRemoteHostClient client, Solution solution) 1629private static Solution UpdateSolution(Solution solution, string projectName, string documentName, string csAddition, string vbAddition) 1646private static (Project project, Document document) GetProjectAndDocument(Solution solution, string projectName, string documentName) 1654private static (Project project, ImmutableArray<Document> documents) GetProjectAndDocuments(Solution solution, string projectName, ImmutableArray<string> documentNames) 1663private static async Task UpdatePrimaryWorkspace(RemoteHostClient client, Solution solution) 1671private static Solution Populate(Solution solution) 1736private static Solution AddProject( 1737Solution 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 (54)
50var solution = workspace.CurrentSolution; 67var solution = workspace.CurrentSolution; 142var solution = workspace.CurrentSolution; 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) 428var solution1 = workspace.CurrentSolution; 462static async Task<Solution> GetInitialOOPSolutionAsync(RemoteWorkspace remoteWorkspace, AssetProvider assetProvider, Solution solution) 472static async Task Verify(RemoteWorkspace remoteWorkspace, Solution givenSolution, Solution remoteSolution) 488var solution = workspace.CurrentSolution; 508var solution = workspace.CurrentSolution 522var frozenSolution1 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText1).Project.Solution; 531var frozenSolution2 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText2).Project.Solution; 547var solution = workspace.CurrentSolution; 588var solution = workspace.CurrentSolution; 629var solution = workspace.CurrentSolution; 662var solution = workspace.CurrentSolution; 703var solution = workspace.CurrentSolution; 743var solution = workspace.CurrentSolution; 783var solution = workspace.CurrentSolution; 816var solution = workspace.CurrentSolution; 871var solution = workspace.CurrentSolution; 917var solution = workspace.CurrentSolution; 940var solution = workspace.CurrentSolution; 985var solution = workspace.CurrentSolution; 1004var solution = workspace.CurrentSolution; 1036var solution = workspace.CurrentSolution; 1074var solution = workspace.CurrentSolution; 1100var solution = workspace.CurrentSolution; 1127var solution = workspace.CurrentSolution; 1156var solution = workspace.CurrentSolution; 1203var solution = workspace.CurrentSolution; 1258private static async Task VerifySolutionUpdate(string code, Func<Solution, Solution> newSolutionGetter) 1267Func<Solution, Solution> newSolutionGetter, 1268Action<Solution>? oldSolutionValidator = null, 1269Action<Solution>? newSolutionValidator = null) 1274Func<Solution, Solution> newSolutionGetter, 1275Action<Solution>? oldSolutionValidator, 1276Action<Solution>? oldRecoveredSolutionValidator, 1277Action<Solution>? newRecoveredSolutionValidator) 1279var solution = workspace.CurrentSolution; 1297var newSolution = newSolutionGetter(solution); 1315private 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.UnitTests (4)
IdentifiersShouldBeSpelledCorrectlyTests.cs (4)
175static Solution RenameProjectAssembly(Solution solution, ProjectId projectId) 205static Solution RenameProjectAssembly(Solution solution, ProjectId projectId)