2 instantiations of Solution
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\Solution.cs (1)
340=> compilationState == CompilationState ? this : new Solution(compilationState);
Workspace\Workspace.cs (1)
128=> new(this, solutionInfo.Attributes, options, analyzerReferences, fallbackAnalyzerOptions);
2982 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
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.CodeStyle.Fixes (69)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
336? new Func<CancellationToken, Task<Solution>>(c => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, c)) 366private async Task<Solution> FixAsync(
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
73public static async Task<Solution> AddParameterAsync( 83var solution = invocationDocument.Project.Solution;
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)
90var solution = _project.Solution; 128var solution = _project.Solution;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
37protected override Task<Solution?> GetChangedSolutionAsync(
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (5)
102private async Task<Solution> FixNodeAsync( 154private async Task<Solution> RenameThenAddAsyncTokenAsync( 164var solution = document.Project.Solution; 170var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false); 184private 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)
24public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 54public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 57private bool CanAddTo(SyntaxNode? destination, Solution solution, CancellationToken cancellationToken, 127Solution solution, 137Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
92public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
179bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 184bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
219var 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) 73public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 76public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 79public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
24/// 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)
33private Func<Solution, ProjectId, Solution>? _remainingOptionsSolutionTransform; 45/// Gets a collection of options to apply to <see cref="Solution.Options"/> for testing. Values may be added
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
79private static async Task<Solution> ConvertToPositionalRecordAsync(
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
39private static Solution AllowUnsafeOnProject(Project project)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
88public override Solution UpgradeProject(Project project, string newVersion)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
88private static async Task<Solution> UsePrimaryConstructorAsync( 111var solution = document.Project.Solution;
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
61private static async Task<Solution> UseSystemThreadingLockAsync( 82var solution = document.Project.Solution;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
212private static async Task<(Solution solution, TextSpan renameSpan)?> TryGetNewSolutionWithAddedMethodAsync( 246var newSolution = document.Project.Solution.WithDocumentText(formattedDocument.Id, newText);
GoToBase\CSharpGoToBaseService.cs (1)
27Solution solution, IMethodSymbol constructor, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (124)
CodeActions\AddUsing\AddUsingNuGetTests.cs (4)
207installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "1.0")).Returns(ImmutableArray<Project>.Empty); 208installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "2.0")).Returns(ImmutableArray<Project>.Empty); 284installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "1.0")).Returns(ImmutableArray<Project>.Empty); 317installerServiceMock.Setup(i => i.GetProjectsWithInstalledPackage(It.IsAny<Solution>(), "NuGetPackage", "1.0")).Returns(ImmutableArray<Project>.Empty);
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)
80var oldSolution = result.Item1; 81var newSolution = result.Item2; 106async Task<List<Tuple<Solution, Solution>>> TestOperationAsync( 111var results = new List<Tuple<Solution, Solution>>(); 162var oldSolution = oldAndNewSolution.Item1; 163var newSolution = oldAndNewSolution.Item2; 220async 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)
2468var solution = testWorkspace.CurrentSolution; 2721var solution = testWorkspace.CurrentSolution; 2776var solution = testWorkspace.CurrentSolution;
EditAndContinue\ActiveStatementTrackingServiceTests.cs (1)
63var 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)
11213var solution = new AdhocWorkspace().CurrentSolution;
Formatting\CodeCleanupTests.TestFixers.cs (2)
87var solution = fixAllContext.Solution; 143var solution = fixAllContext.Solution;
NavigateTo\NavigateToSearcherTests.cs (9)
39It.IsAny<Solution>(), 48(Solution solution, 63It.IsAny<Solution>(), 71(Solution solution, 89It.IsAny<Solution>(), 98(Solution solution, 368public 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) 380public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 386public 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)
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)
63var solution = workspace.CurrentSolution; 85var solution = workspace.CurrentSolution; 101var solution = workspace.CurrentSolution; 116var solution = workspace.CurrentSolution; 132var solution = workspace.CurrentSolution; 143var solution = workspace.CurrentSolution; 157var solution = workspace.CurrentSolution; 184var solution = workspace.CurrentSolution; 242var currentSnapshot = workspaceSnapshotBuilder.CurrentSolution; 248private static async Task<TypeDeclarationSyntax> GetRootTypeDeclarationAsync(Solution currentSnapshot) 260var solution = workspace.CurrentSolution; 274var solution = workspace.CurrentSolution; 285var snapshot = workspace.CurrentSolution; 296var solution = workspace.CurrentSolution; 313var solution = workspace.CurrentSolution; 324var snapshot = workspace.CurrentSolution; 335var solution = workspace.CurrentSolution; 352var solution = workspace.CurrentSolution; 369var solution = workspace.CurrentSolution; 384var solution = workspace.CurrentSolution; 403var solution = workspace.CurrentSolution; 411var snapshot = workspace.CurrentSolution; 422var solution = workspace.CurrentSolution; 433var snapshot = workspace.CurrentSolution; 446var solution = workspace.CurrentSolution; 461var snapshot = workspace.CurrentSolution; 479var solutionX = workspace.CurrentSolution; 494var solutionY = workspace.CurrentSolution; 512var solutionZ = workspace.CurrentSolution; 533var solutionX = workspace.CurrentSolution; 548var solutionY = workspace.CurrentSolution; 572var cs = workspace.CurrentSolution; 601var solutionX = workspace.CurrentSolution; 616var solutionY = workspace.CurrentSolution; 643var cs = workspace.CurrentSolution; 665var cs = workspace.CurrentSolution; 693var solution = workspace.CurrentSolution; 732var oldSolution = workspace.CurrentSolution; 733var newSolution = oldSolution.WithDocumentText(document.Id, SourceText.From(newText)); 760var oldSolution = workspace.CurrentSolution; 761var newSolution = oldSolution.AddDocument(DocumentId.CreateNewId(project1.Id), "Doc2", SourceText.From(doc2Text)); 781var oldSolution = workspace.CurrentSolution; 782var newSolution = oldSolution.RemoveDocument(document.Id); 1113var oldSolution = workspace.CurrentSolution; 1114var newSolution = oldSolution.WithAdditionalDocumentText(additionalDoc.Id, SourceText.From(newText)); 1146var oldSolution = workspace.CurrentSolution; 1147var newSolution = oldSolution.WithAnalyzerConfigDocumentText(analyzerConfigDoc.Id, SourceText.From(newText)); 1236var oldSolution = workspace.CurrentSolution; 1237var newSolution = oldSolution.AddAdditionalDocument(newDocId, "app.config", "text"); 1272var oldSolution = workspace.CurrentSolution; 1273var newSolution = oldSolution.AddAnalyzerConfigDocument(newDocId, "app.config", SourceText.From("text")); 1463var solution = workspace1.CurrentSolution; 1471var newSolution = solution.WithOptions(newOptions); 1500var beforeSolutionForPrimaryWorkspace = primaryWorkspace.CurrentSolution; 1501var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
58var 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 (4)
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;
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
83var solution = document.Project.Solution;
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
65private static async Task<Solution> ConvertAsync( 92var solution = document.Project.Solution;
Debugging\BreakpointResolver.cs (1)
20internal 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)
745internal override async Task<Solution> TryAddUsingsOrImportToDocumentAsync( 746Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (2)
210private async Task<Solution> ChangeImplementationAsync( 213var solution = project.Solution;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
43var solution = project.Solution;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
135static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Solution>> createSolution)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (7)
28private static async Task<Solution> AddMultipleMembersAsync( 45var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 77static async Task<Solution> AddSingleMemberAsync( 85var solution = project.Solution; 168var solution = solutionEditor.OriginalSolution; 200private static async Task<Solution> UpdateExistingMemberAsync( 207var solution = project.Solution;
NavigationBar\CSharpNavigationBarItemService.cs (3)
57Solution solution, SyntaxTree tree, IEnumerable<INamedTypeSymbol> types, CancellationToken cancellationToken) 192Solution solution, ISymbol member, SyntaxTree tree, CancellationToken cancellationToken) 207Solution solution, ISymbol symbol, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
79private static async Task<Solution> ConvertToPositionalRecordAsync(
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
39private static Solution AllowUnsafeOnProject(Project project)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
88public override Solution UpgradeProject(Project project, string newVersion)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
88private static async Task<Solution> UsePrimaryConstructorAsync( 111var 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 (39)
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) 301var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 307var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 368var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 372var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 395var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 429var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 434var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 462var oldSolution = workspace.CurrentSolution. 511var oldSolution = workspace.CurrentSolution; 516var newSolution = workspace.CurrentSolution.WithDocumentText(documentId, SourceText.From(source2)); 542var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source); 580var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 585var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 619var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 624var newSolution = oldSolution.WithDocumentText(documentId, SourceText.From(source2)); 660var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 665var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 707var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 711var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 741var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 744var newSolution = oldSolution.AddDocument(documentId, "goo.cs", SourceText.From(source2), filePath: filePath); 795var oldSolution = AddDefaultTestProject(workspace.CurrentSolution, source1); 799var 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 (4)
64var solution = workspace.CurrentSolution; 101var solution = workspace.CurrentSolution; 151var solution = workspace.CurrentSolution; 205var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Rename\CSharpRenameRewriterLanguageService.cs (4)
52private readonly Solution _solution; 791Solution baseSolution, 792Solution newSolution, 935private static async Task<ISymbol?> GetVBPropertyFromAccessorOrAnOverrideAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken)
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 (95)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (2)
103private static void HandleResult(ChangeSignatureResult result, Solution oldSolution, Workspace workspace, CommandExecutionContext context) 121var 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 (7)
54private Solution? _pendingUpdatedDesignTimeSolution; 55private Solution? _committedDesignTimeSolution; 57public event Action<Solution>? SolutionCommitted; 78private Solution GetCurrentDesignTimeSolution() 81private Solution GetCurrentCompileTimeSolution(Solution currentDesignTimeSolution) 270private 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)
102public 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)
107var 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)
18public 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)
67var solution = document.Project.Solution;
GoToDefinition\GoToDefinitionHelpers.cs (2)
18Solution solution, 32Solution solution,
Host\IPreviewDialogService.cs (3)
30Solution PreviewChanges( 36Solution newSolution, 37Solution oldSolution,
InlineRename\AbstractEditorInlineRenameService.InlineRenameReplacementInfo.cs (1)
26public Solution NewSolution => _conflicts.NewSolution!;
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
135var solution = this.Document.Project.Solution;
InlineRename\IEditorInlineRenameService.cs (1)
111Solution NewSolution { get; }
InlineRename\InlineRenameSession.cs (1)
50private readonly Solution _baseSolution;
IntelliSense\Helpers.cs (1)
205var solution = workspace.CurrentSolution;
Interactive\InteractiveSession.cs (1)
255private Project CreateSubmissionProjectNoLock(Solution solution, ProjectId newSubmissionProjectId, ProjectId? previousSubmissionProjectId, string languageName, ImmutableArray<string> imports, ImmutableArray<MetadataReference> references)
Interactive\InteractiveWorkspace.cs (1)
68var emptySolution = CreateSolution(SolutionId.CreateNewId("InteractiveSolution"));
Navigation\AbstractDefinitionLocationService.cs (3)
32var solution = document.Project.Solution; 109Solution solution, Document document, TextSpan span, CancellationToken cancellationToken) 127var solution = project.Solution;
Preview\AbstractPreviewFactoryService.cs (6)
67public SolutionPreviewResult? GetSolutionPreviews(Solution oldSolution, Solution? newSolution, CancellationToken cancellationToken) 70public SolutionPreviewResult? GetSolutionPreviews(Solution oldSolution, Solution? newSolution, double zoomLevel, CancellationToken cancellationToken) 483var leftSolution = oldDocument.Project.Solution; 490var 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)
166var solution = _workspace.CurrentSolution; 197var solution = _workspace.CurrentSolution;
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
121Workspace 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)
16Solution originalSolution, 17Solution renamedSolution) 20public Solution OriginalSolution { get; } = originalSolution; 21public Solution RenamedSolution { get; } = renamedSolution;
SemanticSearch\SemanticSearchEditorWorkspace.cs (1)
42/// Used by code actions through <see cref="Workspace.TryApplyChanges(Solution)"/>.
Shared\Extensions\WorkspaceExtensions.cs (6)
22var oldSolution = workspace.CurrentSolution; 25var newSolution = oldSolution.UpdateDocument(newDocument.Id, changes, cancellationToken); 34var oldSolution = workspace.CurrentSolution; 35var newSolution = oldSolution.UpdateDocument(id, textChanges, cancellationToken); 39private 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 (20)
Completion\AbstractCompletionProviderTests.cs (3)
812var solution = testWorkspace.CurrentSolution; 868var solution = testWorkspace.CurrentSolution; 897var solution = testWorkspace.CurrentSolution;
Diagnostics\MockDiagnosticAnalyzerService.cs (3)
61public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 64public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 70public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
161var updatedSolution = await testState.ExtractViaCodeAction();
ExtractInterface\ExtractInterfaceTestState.cs (2)
30public Solution OriginalSolution { get; } 96public async Task<Solution> ExtractViaCodeAction()
Formatting\AbstractNewDocumentFormattingServiceTests.cs (1)
28var solution = workspace.CurrentSolution;
LanguageServer\AbstractLanguageServerProtocolTests.cs (4)
331var solution = workspace.CurrentSolution; 426var newSolution = workspace.CurrentSolution.AddDocument(generatedDocumentInfo); 430internal static async Task<Dictionary<string, IList<LSP.Location>>> GetAnnotatedLocationsAsync(EditorTestWorkspace workspace, Solution solution) 716public Solution GetCurrentSolution() => TestWorkspace.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)
881public Solution Solution { get { return Workspace.CurrentSolution; } }
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
290var solution = workspace.CurrentSolution; 375var solution = workspace.CurrentSolution;
EditAndContinue\EditAndContinueLanguageServiceTests.cs (3)
46private TestWorkspace CreateEditorWorkspace(out Solution solution, out EditAndContinueService service, out EditAndContinueLanguageService languageService, Type[] additionalParts = null) 121var solution = localWorkspace.CurrentSolution; 238using 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)
27private static Solution AddProjectWithMetadataReferences(Solution solution, string projectName, string languageName, string code, MetadataReference metadataReference, params ProjectId[] projectReferences) 53var solution = workspace.CurrentSolution; 94var solution = workspace.CurrentSolution; 131private static Project GetPortableProject(Solution solution) 134private static Project GetNormalProject(Solution solution) 141var solution = workspace.CurrentSolution; 186var solution = workspace.CurrentSolution; 227var solution = workspace.CurrentSolution; 269var solution = workspace.CurrentSolution; 311var solution = workspace.CurrentSolution; 351var solution = workspace.CurrentSolution; 392var solution = workspace.CurrentSolution; 432var solution = workspace.CurrentSolution; 463var solution = workspace.CurrentSolution; 512var solution = workspace.CurrentSolution; 564var solution = workspace.CurrentSolution; 591var solution = workspace.CurrentSolution; 638var solution = workspace.CurrentSolution; 664var solution = workspace.CurrentSolution; 728var solution = workspace.CurrentSolution; 771var solution = workspace.CurrentSolution;
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
40var solution = workspace.CurrentSolution;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (27)
NavigateTo\NavigateToItemProvider.Callback.cs (2)
23private readonly Solution _solution; 27public 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)
62var 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)
33public Solution GetFix( 51public Solution GetFix( 69private static Solution GetFixedSolution( 80Solution 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)
30Solution 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)
472Private Shared Function GetFilePathAndProjectLabel(solution As Solution, syntaxTree As SyntaxTree) As String 537Private Shared Async Function LinkedFileTestHelper(solution As Solution, expectedLinkedSymbolCount As Integer) As Task
Rename\RenameEngineResult.vb (1)
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.FSharp (6)
Editor\IFSharpEditorInlineRenameService.cs (1)
23Solution NewSolution { get; }
Editor\Implementation\Debugging\IFSharpBreakpointResolutionService.cs (1)
16Task<IEnumerable<FSharpBreakpointResolutionResult>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default);
Editor\InlineRename\FSharpInlineRenameReplacementInfo.cs (1)
20public abstract Solution NewSolution { get; }
Internal\Editor\FSharpEditorInlineRenameService.cs (1)
73public 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 (9)
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
Rename\OmniSharpRenamer.cs (2)
18public readonly record struct RenameResult(Solution? Solution, string? ErrorMessage); 21Solution solution,
Microsoft.CodeAnalysis.ExternalAccess.Razor (17)
Cohost\RazorCohostRequestContext.cs (1)
18internal Solution? Solution => context.Solution;
Remote\RazorRemoteHostClient.cs (4)
68public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) where TService : class 74public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) where TService : class 82public async ValueTask<bool> TryInvokeAsync<TService>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class 88public async ValueTask<Optional<TResult>> TryInvokeAsync<TService, TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, object callbackTarget, CancellationToken cancellationToken) where TService : class
Remote\RazorRemoteServiceConnectionWrapper.cs (4)
45public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 51public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken) 59public ValueTask<bool> TryInvokeAsync(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask> invocation, CancellationToken cancellationToken) 65public ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solution solution, Func<TService, RazorPinnedSolutionInfoWrapper, RazorRemoteServiceCallbackIdWrapper, CancellationToken, ValueTask<TResult>> invocation, CancellationToken cancellationToken)
SolutionExtensions.cs (3)
12public static ImmutableArray<TextDocument> GetTextDocuments(this Solution solution, Uri documentUri) 15public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri) 18public static int GetWorkspaceVersion(this Solution solution)
Testing\TestSolutionStore.cs (5)
13private readonly Dictionary<Checksum, Solution> _solutions = []; 15internal async Task<RazorPinnedSolutionInfoWrapper> AddAsync(Solution solution, CancellationToken cancellationToken) 23if (_solutions.TryGetValue(checksum, out var existingSolution)) 34internal Solution? Get(RazorPinnedSolutionInfoWrapper solutionInfo) 38_solutions.TryGetValue(solutionInfo.UnderlyingObject, out var solution);
Microsoft.CodeAnalysis.Features (519)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
44protected override Task<Solution?> GetChangedSolutionAsync( 66return Task.FromResult<Solution?>(constructorDocument.WithSyntaxRoot(newRoot).Project.Solution);
AddImport\AbstractAddImportFeatureService.cs (2)
319var solution = project.Solution; 449var solution = project.Solution;
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (1)
81Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (4)
64private async Task<Solution> GetUpdatedSolutionAsync(CancellationToken cancellationToken) 111Workspace workspace, Solution originalSolution, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 113var newSolution = workspace.CurrentSolution.WithDocumentText( 125var 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)
163var solution = document.Project.Solution; 228Solution solution, 247private async Task<(Solution updatedSolution, string? confirmationMessage)> CreateUpdatedSolutionAsync( 454private static bool TryGetNodeWithEditableSignatureOrAttributes(Location location, Solution solution, out SyntaxNode nodeToUpdate, out DocumentId documentId)
ChangeSignature\ChangeSignatureAnalyzedContext.cs (1)
21public 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)
21Solution GetFix( 36Solution GetFix(
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)
69protected sealed override Task<Solution?> GetChangedSolutionAsync(
CodeFixesAndRefactorings\AbstractFixAllGetFixesService.cs (9)
18protected abstract Solution? GetChangedSolution( 20Solution currentSolution, 21Solution newSolution, 26public async Task<Solution?> GetFixAllChangedSolutionAsync(IFixAllContext fixAllContext) 103public Solution? PreviewChanges( 105Solution currentSolution, 106Solution newSolution, 142var changedSolution = GetChangedSolution( 201protected 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)
62var solution = document.Project.Solution; 100var solution = document.Project.Solution; 225Solution newSolution;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
32public abstract Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken); 58public override async Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken)
CodeRefactorings\MoveType\AbstractMoveTypeService.Editor.cs (1)
50public abstract Task<Solution> GetModifiedSolutionAsync();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (6)
44public override async Task<Solution> GetModifiedSolutionAsync() 63var solutionWithNewDocument = documentWithMovedType.Project.Solution; 75private async Task<Solution> RemoveUnnecessaryImportsAsync( 76Solution solution, DocumentId sourceDocumentId, DocumentId documentWithMovedTypeId) 140var solutionWithNewDocument = projectToBeUpdated.Solution.AddDocument( 185private async Task<Solution> RemoveTypeFromSourceDocumentAsync(Document sourceDocument)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
25public override async Task<Solution> GetModifiedSolutionAsync() 38private static async Task<Solution> GetNamespaceScopeChangedSolutionAsync(
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameFileEditor.cs (1)
21public override Task<Solution> GetModifiedSolutionAsync()
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (1)
21public override async Task<Solution> GetModifiedSolutionAsync()
CodeRefactorings\MoveType\IMoveTypeService.cs (1)
21Task<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; 175public override async Task<Solution> ChangeNamespaceAsync( 194var solution = document.Project.Solution; 210var annotatedSolution = await AnnotateContainersAsync(solution, containersFromAllDocuments, cancellationToken).ConfigureAwait(false); 221var solutionAfterNamespaceChange = annotatedSolution; 268Solution solution, 310protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken) 347var solution = document.Project.Solution; 426private async Task<(Solution, ImmutableArray<DocumentId>)> ChangeNamespaceInSingleDocumentAsync( 427Solution solution, 755private static async Task<Solution> RemoveUnnecessaryImportsAsync( 756Solution solution, 845private static async Task<Solution> MergeDiffAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
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)
13CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution);
Completion\CompletionOptions.cs (1)
79var 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)
356var solution = document.Project.Solution;
Completion\Providers\CompletionUtilities.cs (1)
33Solution? solution = null;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
76var solution = currentProject.Solution; 184Solution solution,
Completion\Providers\SymbolCompletionItem.cs (1)
234public static SupportedPlatformData? GetSupportedPlatforms(CompletionItem item, Solution solution)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (10)
216public async Task<Solution> ConvertToStructAsync( 223var solution = document.Project.Solution; 249private static async Task<Solution> AddRenameTokenAsync( 250Solution solution, 262private async Task<Solution> ConvertToStructInCurrentProcessAsync( 318var updatedSolution = await ApplyChangesAsync( 438var solution = startingProject.Solution; 524var solution = startingDocument.Project.Solution; 583private static async Task<Solution> ApplyChangesAsync( 586var currentSolution = startingDocument.Project.Solution;
ConvertTupleToStruct\IConvertTupleToStructCodeRefactoringProvider.cs (1)
15Task<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\CodeAnalysisDiagnosticAnalyzerService.cs (1)
93public async Task RunAnalysisAsync(Solution solution, ProjectId? projectId, Action<Project> onAfterProjectAnalyzed, CancellationToken cancellationToken)
Diagnostics\DiagnosticsUpdatedArgs.cs (4)
14public readonly Solution? Solution; 28Solution? solution, 45Solution solution, 54Solution? solution,
Diagnostics\ICodeAnalysisDiagnosticAnalyzerService.cs (4)
23Task RunAnalysisAsync(Solution solution, ProjectId? projectId, Action<Project> onAfterProjectAnalyzed, CancellationToken cancellationToken); 26/// Returns true if <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> was invoked 36/// <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> invocation on the containing project or solution. 46/// <see cref="RunAnalysisAsync(Solution, ProjectId?, Action{Project}, CancellationToken)"/> invocation on the given project or solution.
Diagnostics\IDiagnosticAnalyzerService.cs (4)
58/// Note that for project case, this method returns diagnostics from all project documents as well. Use <see cref="GetProjectDiagnosticsForIdsAsync(Solution, ProjectId?, ImmutableHashSet{string}?, Func{DiagnosticAnalyzer, bool}?, bool, bool, CancellationToken)"/> 79Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocumentIds, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 98Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); 167this IDiagnosticAnalyzerService service, Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken)
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; 428public void CommitSolution(Solution solution)
EditAndContinue\DebuggingSession.cs (4)
107Solution solution, 519Solution solution, 615public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 778var newSolution = newProject.Solution;
EditAndContinue\EditAndContinueService.cs (4)
136Solution solution, 184private static IEnumerable<(Project, IEnumerable<DocumentState>)> GetDocumentStatesGroupedByProject(Solution solution, ImmutableArray<DocumentId> documentIds) 223Solution solution, 252public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (5)
259public static async ValueTask<bool> HasChangesAsync(Solution oldSolution, Solution newSolution, string sourceFilePath, CancellationToken cancellationToken) 282public static async ValueTask<bool> HasChangesAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 799public 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 (3)
22ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken); 27ValueTask<DebuggingSessionId> StartDebuggingSessionAsync(Solution solution, IManagedHotReloadService debuggerService, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<DocumentId> captureMatchingDocuments, bool captureAllMatchingDocuments, bool reportDiagnostics, CancellationToken cancellationToken); 31ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken);
EditAndContinue\ProjectDiagnostics.cs (1)
16public static ImmutableArray<DiagnosticData> ToDiagnosticData(this ImmutableArray<ProjectDiagnostics> diagnostics, Solution solution)
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (3)
57Solution solution, 95private static ImmutableArray<DiagnosticData> GetInternalErrorDiagnosticData(Solution solution, Exception e) 136public async ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken)
EditAndContinue\SolutionSnapshotRegistry.cs (5)
17SolutionSnapshotId RegisterSolutionSnapshot(Solution solution); 28private readonly Dictionary<SolutionSnapshotId, Solution> _pendingSolutionSnapshots = []; 39public SolutionSnapshotId RegisterSolutionSnapshot(Solution solution) 51public Solution GetRegisteredSolutionSnapshot(SolutionSnapshotId id) 55Contract.ThrowIfFalse(_pendingSolutionSnapshots.TryGetValue(id, out var solution));
EncapsulateField\AbstractEncapsulateFieldService.cs (14)
111public async Task<Solution> EncapsulateFieldsAsync( 119var solution = document.Project.Solution; 142private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken) 147var currentSolution = document.Project.Solution; 158var nextSolution = await EncapsulateFieldAsync(document, currentField, updateReferences, cancellationToken).ConfigureAwait(false); 168private async Task<Solution> EncapsulateFieldAsync( 183var solution = document.Project.Solution; 194var solutionNeedingProperty = await UpdateReferencesAsync( 231private async Task<Solution> UpdateReferencesAsync( 232bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken) 276private static async Task<Solution> RenameAsync( 277Solution solution, 312private ISet<(DocumentId documentId, TextSpan span)> GetConstructorLocations(Solution solution, INamedTypeSymbol containingType) 317Solution destinationSolution,
EncapsulateField\EncapsulateFieldResult.cs (3)
14internal class EncapsulateFieldResult(string name, Glyph glyph, Func<CancellationToken, Task<Solution>> getSolutionAsync) 18private readonly AsyncLazy<Solution> _lazySolution = AsyncLazy.Create(getSolutionAsync); 20public Task<Solution> GetSolutionAsync(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)
202private void EnqueueSolutionChangedEvent(Solution oldSolution, Solution newSolution, string eventName) 229private void EnqueueFullSolutionEvent(Solution solution, UnitTestingInvocationReasons invocationReasons, string eventName) 243private void EnqueueProjectChangedEvent(Solution oldSolution, Solution newSolution, ProjectId projectId, string eventName) 257private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, UnitTestingInvocationReasons invocationReasons, string eventName) 263private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, UnitTestingInvocationReasons invocationReasons, string eventName) 275private void EnqueueDocumentChangedEvent(Solution oldSolution, Solution newSolution, DocumentId documentId, string eventName) 543public string GetLanguagesStringForTelemetry(Solution solution) 589public int GetDocumentCount(Solution solution) 632public 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)
30var solution = context.Document.Project.Solution;
ExtractClass\ExtractClassWithDialogCodeAction.cs (5)
134private async Task<Solution> PullMembersUpAsync( 135Solution solution, 218private static async Task<Solution> GetSolutionWithBaseAddedAsync( 219Solution solution, 225var unformattedSolution = solution;
ExtractInterface\AbstractExtractInterfaceService.cs (12)
38protected abstract Task<Solution> UpdateMembersWithExplicitImplementationsAsync( 39Solution unformattedSolution, 139var solution = refactoringResult.DocumentToExtractFrom.Project.Solution; 175Solution solution, string containingNamespaceDisplay, INamedTypeSymbol extractedInterfaceSymbol, 217Solution solution, ExtractInterfaceTypeAnalysisResult refactoringResult, INamedTypeSymbol extractedInterfaceSymbol, 283private static async Task<Solution> GetFormattedSolutionAsync(Solution unformattedSolution, IEnumerable<DocumentId> documentIds, CancellationToken cancellationToken) 288var formattedSolution = unformattedSolution; 313private async Task<Solution> GetSolutionWithOriginalTypeUpdatedAsync( 314Solution solution, 331var unformattedSolution = solution; 358var updatedUnformattedSolution = await UpdateMembersWithExplicitImplementationsAsync(
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)
53Solution solution,
FindUsages\AbstractFindUsagesService_FindImplementations.cs (5)
43var solution = project.Solution; 75var solution = project.Solution; 94Solution solution, ISymbol symbol, CancellationToken cancellationToken) 137Solution solution, ISymbol symbol, CancellationToken cancellationToken) 159Solution solution, ISymbol symbol, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindReferences.cs (3)
66Solution solution, 132var solution = project.Solution; 221var solution = document.Project.Solution;
FindUsages\DefaultExternalDefinitionItemProvider.cs (1)
23public Task<DefinitionItem?> GetThirdPartyDefinitionItemAsync(Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken)
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
61private 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)
26/// Note that the <see cref="Solution"/> returned may absolutely *not* be
FindUsages\IExternalDefinitionItemProvider.cs (1)
14Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken);
FindUsages\IRemoteFindUsagesService.cs (2)
88internal sealed class FindUsagesServerCallback(Solution solution, IFindUsagesContext context, OptionsProvider<ClassificationOptions> classificationOptions) 90private readonly Solution _solution = solution;
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.cs (1)
125Solution originalSolution,
GenerateType\AbstractGenerateTypeService.cs (2)
62internal abstract Task<Solution> TryAddUsingsOrImportToDocumentAsync( 63Solution updatedSolution, SyntaxNode modifiedRoot, Document document, TSimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (4)
273var newSolution = projectToBeUpdated.Solution.AddDocument(newDocumentId, documentName, string.Empty, folders, fullFilePath); 350var updatedSolution = projectToBeUpdated.Solution.AddDocument( 373private static Solution AddProjectReference(Project projectToBeUpdated, Project triggeringProject, Solution updatedSolution)
GoToBase\AbstractGoToBaseService.cs (2)
18Solution solution, IMethodSymbol constructor, CancellationToken cancellationToken); 45var solution = project.Solution;
GoToBase\FindBaseHelpers.cs (1)
16ISymbol symbol, Solution solution, CancellationToken cancellationToken)
GoToDefinition\GoToDefinitionFeatureHelpers.cs (2)
19Solution solution, ISymbol? symbol, CancellationToken cancellationToken) 57Solution solution,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
36var solution = document.Project.Solution;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (11)
58var solution = project.Solution; 282Solution solution, 342Solution solution, 399Solution solution, 437Solution solution, 462Solution solution, 501Solution solution, 549Solution solution, 619Solution solution, 677Solution solution, 712private static DefinitionItem? ToSlimDefinitionItem(ISymbol symbol, Solution solution)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (4)
360private async Task<Solution> AddAllSymbolInitializationsAsync( 381var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 424private async Task<Solution> AddSingleSymbolInitializationAsync( 484var currentSolution = document.Project.Solution;
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (2)
289private async Task<Solution> InlineMethodAsync(Document document, 337var 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)
237private async Task<Solution> IntroduceParameterAsync(Document originalDocument, TExpressionSyntax expression, 241var modifiedSolution = originalDocument.Project.Solution;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
261private async Task<Location> RelocateSymbol_NoLockAsync(Solution solution, MetadataAsSourceGeneratedFileInfo fileInfo, SymbolKey symbolId, CancellationToken cancellationToken) 353var 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)
223var originalSolution = document.Project.Solution; 276private 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)
58Solution solution,
NavigateTo\AbstractNavigateToSearchService.cs (1)
36Solution solution, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
20Solution solution,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
27var solution = document.Project.Solution; 66Solution 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)
37async 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)
19Solution solution, ISymbol symbol, Location location, 27Solution solution, 38Solution 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)
101Solution solution,
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (1)
43var 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)
61public static Task<Solution> PullMembersUpAsync( 93private static async Task<Solution> PullMembersIntoInterfaceAsync( 98var solution = document.Project.Solution; 271private static async Task<Solution> PullMembersIntoClassAsync( 276var 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)
75private async Task<Solution> ReplacePropertyWithMethodsAsync( 88var originalSolution = document.Project.Solution; 106var updatedSolution = originalSolution; 198private async Task<Solution> UpdateReferencesAsync( 199Solution updatedSolution, 217private async Task<Solution> UpdateReferencesInDocumentAsync( 218Solution updatedSolution, 291private static async Task<Solution> ReplaceDefinitionsWithMethodsAsync( 292Solution originalSolution, 293Solution updatedSolution, 314Solution originalSolution, 341private static async Task<Solution> ReplaceDefinitionsWithMethodsAsync( 342Solution updatedSolution, 393Solution updatedSolution,
SemanticSearch\AbstractSemanticSearchService.cs (1)
61Solution solution,
SemanticSearch\IRemoteSemanticSearchService.cs (1)
59internal sealed class ServerCallback(Solution solution, ISemanticSearchResultsObserver observer, OptionsProvider<ClassificationOptions> classificationOptions)
SemanticSearch\ISemanticSearchService.cs (1)
26Solution solution,
SemanticSearch\SemanticSearchUtilities.cs (4)
66public static Document GetQueryDocument(Solution solution) 69public static ProjectId GetQueryProjectId(Solution solution) 72public static Project GetQueryProject(Solution solution) 75public static DocumentId GetQueryDocumentId(Solution solution)
Shared\Extensions\DocumentExtensions.cs (1)
83var 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)
14internal sealed class SupportedPlatformData(Solution solution, List<ProjectId> invalidProjects, IEnumerable<ProjectId> candidateProjects) 21public readonly Solution Solution = solution; 31var projects = CandidateProjects.Select(Solution.GetRequiredProject).OrderBy(p => p.Name);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
336? new Func<CancellationToken, Task<Solution>>(c => FixAsync(document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: true, c)) 366private async Task<Solution> FixAsync(
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
73public static async Task<Solution> AddParameterAsync( 83var solution = invocationDocument.Project.Solution;
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)
90var solution = _project.Solution; 128var solution = _project.Solution;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (1)
37protected override Task<Solution?> GetChangedSolutionAsync(
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (5)
102private async Task<Solution> FixNodeAsync( 154private async Task<Solution> RenameThenAddAsyncTokenAsync( 164var solution = document.Project.Solution; 170var newSolution = await Renamer.RenameSymbolAsync(solution, methodSymbol, new SymbolRenameOptions(), newName, cancellationToken).ConfigureAwait(false); 184private 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(Document? document, int line) GetDocumentAndLine(Solution solution, ParsedFrame frame); 20Task<DefinitionItem?> TryFindDefinitionAsync(Solution solution, ParsedFrame frame, StackFrameSymbolPart symbolPart, CancellationToken cancellationToken);
StackTraceExplorer\StackTraceExplorerService.cs (3)
28public (Document? document, int line) GetDocumentAndLine(Solution solution, ParsedFrame frame) 44public async Task<DefinitionItem?> TryFindDefinitionAsync(Solution solution, ParsedFrame frame, StackFrameSymbolPart symbolPart, CancellationToken cancellationToken) 76private static ImmutableArray<Document> 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)
23public Solution Solution => Project.Solution;
SyncNamespaces\AbstractSyncNamespacesService.cs (4)
31public async Task<Solution> SyncNamespacesAsync( 39var solution = projects[0].Solution; 93Solution solution, 133private static async Task<Solution> ApplyCodeFixAsync(
SyncNamespaces\ISyncNamespacesService.cs (1)
20Task<Solution> SyncNamespacesAsync(
UnusedReferences\IUnusedReferenceAnalysisService.cs (1)
15Solution solution,
UnusedReferences\UnusedReferencesRemover.cs (2)
25Solution solution, 263Solution solution,
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (5)
68private async Task<Solution> ProcessResultAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 74var solution = context.Document.Project.Solution; 231var updatedSolution = solution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot); 265Solution solution, 307Solution solution,
ValueTracking\IValueTrackingService.cs (1)
16Task<ImmutableArray<ValueTrackedItem>> TrackValueSourceAsync(Solution solution, ValueTrackedItem previousTrackedItem, CancellationToken cancellationToken);
ValueTracking\SerializableValueTrackedItem.cs (2)
33public static SerializableValueTrackedItem Dehydrate(Solution solution, ValueTrackedItem valueTrackedItem, CancellationToken cancellationToken) 44public async ValueTask<ValueTrackedItem> RehydrateAsync(Solution solution, CancellationToken cancellationToken)
ValueTracking\ValueTrackedItem.cs (1)
45public 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 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 (27)
EditAndContinue\EditAndContinueTestVerifier.cs (2)
443var newSolution = oldProject.Solution; 510public static void SetDocumentsState(DebuggingSession session, Solution solution, CommittedSolution.DocumentState state)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (8)
54internal TestWorkspace CreateWorkspace(out Solution solution, out EditAndContinueService service, Type[]? additionalParts = null) 69internal static (Solution, Document) AddDefaultTestProject( 70Solution solution, 80internal static Project AddEmptyTestProject(Solution solution) 85internal static Solution AddDefaultTestProject( 86Solution solution, 142Solution solution, 193Solution solution,
EditAndContinue\Extensions.cs (3)
53public static Project AddTestProject(this Solution solution, string projectName, string language = LanguageNames.CSharp) 56public static Project AddTestProject(this Solution solution, string projectName, out ProjectId id) 59public static Project AddTestProject(this Solution solution, string projectName, string language, out ProjectId 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 (6)
20public Func<Solution, ImmutableArray<DocumentId>, ImmutableArray<ImmutableArray<ActiveStatementSpan>>>? GetBaseActiveStatementSpansImpl; 23public Func<Solution, IManagedHotReloadService, IPdbMatchingSourceTextProvider, ImmutableArray<DocumentId>, bool, bool, DebuggingSessionId>? StartDebuggingSessionImpl; 26public Func<Solution, ActiveStatementSpanProvider, EmitSolutionUpdateResults>? EmitSolutionUpdateImpl; 42public ValueTask<EmitSolutionUpdateResults> EmitSolutionUpdateAsync(DebuggingSessionId sessionId, Solution solution, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken) 48public ValueTask<ImmutableArray<ImmutableArray<ActiveStatementSpan>>> GetBaseActiveStatementSpansAsync(DebuggingSessionId sessionId, Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) 60public 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. 58var compileTimeSolution = provider.GetCompileTimeSolution(designTimeSolution); 120var compileTimeSolution1 = provider.GetCompileTimeSolution(workspace.CurrentSolution); 135var compileTimeSolution2 = provider.GetCompileTimeSolution(workspace.CurrentSolution);
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (27)
79using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 165using var _ = CreateWorkspace(out var solution, out var service); 198using var _ = CreateWorkspace(out var solution, out var service); 232using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 267using var _ = CreateWorkspace(out var solution, out var service); 300using var _ = CreateWorkspace(out var solution, out var service); 351using var _ = CreateWorkspace(out var solution, out var service); 458using var _w = CreateWorkspace(out var solution, out var service); 527using var _ = CreateWorkspace(out var solution, out var service); 578using var _ = CreateWorkspace(out var solution, out var service); 636using var _ = CreateWorkspace(out var solution, out var service); 721using var _ = CreateWorkspace(out var solution, out var service); 773using var _ = CreateWorkspace(out var solution, out var service); 823using var _ = CreateWorkspace(out var solution, out var service); 874using var workspace = CreateWorkspace(out var solution, out var service); 922using var _ = CreateWorkspace(out var solution, out var service); 989using var _ = CreateWorkspace(out var solution, out var service); 1065using var _ = CreateWorkspace(out var solution, out var service); 1099using var _ = CreateWorkspace(out var solution, out var service); 1200using var _ = CreateWorkspace(out var solution, out var service); 1243using var _ = CreateWorkspace(out var solution, out var service); 1297using var _ = CreateWorkspace(out var solution, out var service); 1337using var _ = CreateWorkspace(out var solution, out var service); 1381using var _ = CreateWorkspace(out var solution, out var service, [typeof(NoCompilationLanguageService)]); 1405var oldSolution = solution; 1456using var _ = CreateWorkspace(out var solution, out var service); 1506var oldSolution = solution;
EditAndContinue\EditSessionActiveStatementsTests.cs (5)
34Solution solution, 64private static async Task<Solution> AddDefaultTestSolutionAsync(TestWorkspace workspace, string[] markedSources) 66var solution = workspace.CurrentSolution; 173var solution = await AddDefaultTestSolutionAsync(workspace, markedSources); 652var solution = await AddDefaultTestSolutionAsync(workspace, markedSources);
EditAndContinue\EmitSolutionUpdateResultsTests.cs (17)
27private static TestWorkspace CreateWorkspace(out Solution solution) 49private static EmitSolutionUpdateResults CreateMockResults(Solution solution, IEnumerable<ProjectId> updates, IEnumerable<ProjectId> rudeEdits) 73var solution = document.Project.Solution; 156using var _ = CreateWorkspace(out var solution); 161.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 179using var _ = CreateWorkspace(out var solution); 184.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 205using var _ = CreateWorkspace(out var solution); 210.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 228using var _ = CreateWorkspace(out var solution); 233.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 255using var _ = CreateWorkspace(out var solution); 260.AddTestProject("A", out var a).AddProjectReferences([new(c)]).Solution 282using var _ = CreateWorkspace(out var solution); 289.AddTestProject("R1", out var r1).AddProjectReferences([new(p1), new(p2)]).Solution 290.AddTestProject("R2", out var r2).AddProjectReferences([new(p2), new(p3)]).Solution 291.AddTestProject("R3", out var r3).AddProjectReferences([new(p3), new(p4)]).Solution
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
85var solution = localWorkspace.CurrentSolution;
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
35using var workspace = CreateWorkspace(out var solution, out var encService);
EditAndContinue\WatchHotReloadServiceTests.cs (2)
46using var workspace = CreateWorkspace(out var solution, out var encService); 121using 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)
37public 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 (67)
Extensions\Extensions.cs (9)
59public static ImmutableArray<Document> GetDocuments(this Solution solution, Uri documentUri) 62public static ImmutableArray<Document> GetDocuments(this Solution solution, string documentPath) 74public static ImmutableArray<TextDocument> GetTextDocuments(this Solution solution, Uri documentUri) 86public static ImmutableArray<DocumentId> GetDocumentIds(this Solution solution, Uri documentUri) 89public static Document? GetDocument(this Solution solution, TextDocumentIdentifier documentIdentifier) 128public static T FindDocumentInProjectContext<T>(this ImmutableArray<T> documents, TextDocumentIdentifier documentIdentifier, Func<Solution, DocumentId, T> documentGetter) where T : TextDocument 135var solution = documents.First().Project.Solution; 142public static Project? GetProject(this Solution solution, TextDocumentIdentifier projectIdentifier) 150public static TextDocument? GetAdditionalDocument(this Solution solution, TextDocumentIdentifier documentIdentifier)
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (1)
46var solution = document.Project.Solution;
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
113Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 120Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (8)
18public Task<ImmutableArray<DiagnosticData>> GetCachedDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 21public Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, Func<Project, DocumentId?, IReadOnlyList<DocumentId>>? getDocuments, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 24public Task<ImmutableArray<DiagnosticData>> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet<string>? diagnosticIds, Func<DiagnosticAnalyzer, bool>? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) 29Solution solution, 39protected readonly Solution Solution = solution; 72protected Task<ImmutableArray<DiagnosticData>> ProduceSolutionDiagnosticsAsync(Solution solution, CancellationToken cancellationToken) 104Solution solution, 140var project = Solution.GetProject(ProjectId);
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)
23/// Keeps <see cref="Solution.FallbackAnalyzerOptions"/> up-to-date with global option values maintained by <see cref="IGlobalOptionService"/>. 52Solution 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)
78var solution = document.Project.Solution;
Handler\CodeActions\CodeActionResolveHelper.cs (3)
25var solution = context.Solution; 306private static bool HasDocumentNameChange(DocumentId documentId, Solution newSolution, Solution oldSolution)
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (2)
223Solution solution, 247static ProjectOrDocumentId? GetIdForPreviousResult(TextDocumentIdentifier textDocumentIdentifier, Solution solution)
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)
58var solution = context.Solution;
Handler\PullHandlers\VersionedPullCache`2.cs (1)
127private 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; 81public Solution? Solution 170Solution? solution, 185_lspSolution = new StrongBox<(Workspace Workspace, Solution Solution, TextDocument? Document)>((workspace, solution, document)); 260Solution? 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)
104private readonly Dictionary<Workspace, (int? forkedFromVersion, Solution solution)> _cachedLspSolutions = []; 250public async Task<(Workspace?, Solution?)> GetLspSolutionInfoAsync(CancellationToken cancellationToken) 268public async Task<(Workspace?, Solution?, TextDocument?)> GetLspDocumentInfoAsync(TextDocumentIdentifier textDocumentIdentifier, CancellationToken cancellationToken) 320private async Task<ImmutableArray<(Workspace workspace, Solution Solution, bool IsForked)>> GetLspSolutionsAsync(CancellationToken cancellationToken) 329var solutions = new FixedSizeArrayBuilder<(Workspace, Solution, bool)>(registeredWorkspaces.Length); 342async Task<(Solution Solution, bool IsForked)> GetLspSolutionForWorkspaceAsync(Workspace workspace, CancellationToken cancellationToken) 344var workspaceCurrentSolution = workspace.CurrentSolution; 398var lspSolution = workspaceCurrentSolution; 483private 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)
715private static Task<(Workspace?, Solution?)> GetLspHostWorkspaceAndSolutionAsync(TestLspServer testLspServer)
Microsoft.CodeAnalysis.Remote.ServiceHub (84)
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)
68/// cref="Solution"/> snapshot for it, and then invokes <paramref name="implementation"/> with that snapshot. That 79public ValueTask<(Solution solution, T result)> RunWithSolutionAsync<T>( 82Func<Solution, ValueTask<T>> implementation, 88private async ValueTask<(Solution solution, T result)> RunWithSolutionAsync<T>( 92Func<Solution, ValueTask<T>> implementation, 118async ValueTask<(InFlightSolution inFlightSolution, Task<Solution> solutionTask)> AcquireSolutionAndIncrementInFlightCountAsync() 142async ValueTask<(Solution solution, T result)> ProcessSolutionAsync(InFlightSolution inFlightSolution, Task<Solution> solutionTask) 150var solution = await solutionTask.WithCancellation(cancellationToken).ConfigureAwait(false); 206private async Task<Solution> GetOrCreateSolutionToUpdateAsync( 212var currentSolution = this.CurrentSolution; 236/// Create an appropriate <see cref="Solution"/> instance corresponding to the <paramref 252private async Task<Solution> ComputeDisconnectedSolutionAsync( 259var solutionToUpdate = await GetOrCreateSolutionToUpdateAsync( 272private Solution CreateSolutionFromInfo(SolutionInfo solutionInfo) 274var solution = this.CreateSolution(solutionInfo); 286private async Task<Solution> UpdateWorkspaceCurrentSolutionAsync( 287Solution newSolution, 315static bool IsAddingSolution(Solution oldSolution, Solution newSolution) 331public Solution CreateSolutionFromInfo(SolutionInfo solutionInfo) 334public Task<Solution> UpdateWorkspaceCurrentSolutionAsync(Solution newSolution) 337public async ValueTask<Solution> GetSolutionAsync(
Host\RemoteWorkspace.InFlightSolution.cs (8)
38private readonly Task<Solution> _disconnectedSolutionTask; 45private Task<Solution>? _primaryBranchTask; 57Func<CancellationToken, Task<Solution>> computeDisconnectedSolutionAsync) 86public Task<Solution> PreferredSolutionTask_NoLock 105public void TryKickOffPrimaryBranchWork_NoLock(Func<Solution, CancellationToken, Task<Solution>> updatePrimaryBranchAsync) 135async Task<Solution> ComputePrimaryBranchAsync(CancellationToken cancellationToken) 137var solution = await _disconnectedSolutionTask.ConfigureAwait(false);
Host\RemoteWorkspace.SolutionCreator.cs (18)
29private readonly struct SolutionCreator(RemoteWorkspace workspace, AssetProvider assetService, Solution baseSolution) 36private readonly Solution _baseSolution = baseSolution; 38public async Task<Solution> CreateSolutionAsync(Checksum newSolutionChecksum, CancellationToken cancellationToken) 42var solution = _baseSolution; 148private async Task<Solution> UpdateProjectsAsync( 149Solution solution, SolutionStateChecksums oldSolutionChecksums, SolutionStateChecksums newSolutionChecksums, CancellationToken cancellationToken) 232private async Task<Solution> UpdateProjectsAsync( 233Solution solution, 339private async Task<Solution> UpdateProjectAsync(Project project, ProjectStateChecksums oldProjectChecksums, ProjectStateChecksums newProjectChecksums, CancellationToken cancellationToken) 421Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 422Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 466Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 467Func<Solution, ImmutableArray<DocumentId>, Solution> removeDocuments, 592Solution 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)
111public async ValueTask<Solution> GetSolutionAsync(ServiceBrokerClient client, Checksum solutionChecksum, CancellationToken cancellationToken) 129Func<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)
87Func<Solution, ValueTask<T>> implementation, 107Checksum solutionChecksum, Func<Solution, ValueTask<T>> implementation, CancellationToken cancellationToken) 131Checksum solutionChecksum, Func<Solution, ValueTask> implementation, CancellationToken cancellationToken) 150Func<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)
58Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 76private static async Task<Solution> CleanupAsync(Solution oldSolution, Solution newSolution, CancellationToken cancellationToken) 79var final = newSolution;
Services\EditAndContinue\RemoteEditAndContinueService.cs (1)
167private static ImmutableArray<DiagnosticData> GetUnexpectedUpdateError(Solution solution, Exception e)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
116var solution = document.Project.Solution;
Services\SymbolFinder\RemoteSymbolFinderService.cs (3)
84private static ImmutableArray<SerializableSymbolAndProjectId> Convert(ImmutableArray<ISymbol> items, Solution solution, CancellationToken cancellationToken) 202private readonly Solution _solution; 208public FindReferencesProgressCallback(Solution solution, RemoteCallback<IRemoteSymbolFinderService.ICallback> callback, RemoteServiceCallbackId callbackId)
Microsoft.CodeAnalysis.Remote.Workspaces (25)
EditAndContinue\ManagedHotReloadLanguageService.cs (5)
46private Solution? _committedDesignTimeSolution; 47private Solution? _pendingUpdatedDesignTimeSolution; 58private async ValueTask<Solution> GetCurrentDesignTimeSolutionAsync(CancellationToken cancellationToken) 68private 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)
53public ValueTask<Scope> StoreAssetsAsync(Solution solution, CancellationToken cancellationToken) 56/// <inheritdoc cref="StoreAssetsAsync(Solution, CancellationToken)"/> 60/// <inheritdoc cref="StoreAssetsAsync(Solution, CancellationToken)"/> 64/// <inheritdoc cref="StoreAssetsAsync(Solution, CancellationToken)"/>
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)
624updatedSolution As Solution, 629cancellationToken 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 (5)
Rename\LocalConflictVisitor.vb (2)
14Private ReadOnly _newSolution As Solution 17Public Sub New(tokenBeingRenamed As SyntaxToken, newSolution As Solution, cancellationToken As CancellationToken)
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
42Private ReadOnly _solution As Solution 687baseSolution As Solution, 688newSolution As Solution,
Microsoft.CodeAnalysis.Workspaces (700)
ChangeNamespace\IChangeNamespaceService.cs (2)
56Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 62Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
CodeActions\CodeAction.cs (34)
128static codeAction => new Func<CancellationToken, Task<Solution?>>(codeAction.GetChangedSolutionAsync).Method.DeclaringType != typeof(CodeAction)); 236Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 242Solution originalSolution, IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 261Solution originalSolution, CancellationToken cancellationToken) 281var changedSolution = await GetChangedSolutionAsync(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false); 307var changedSolution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false); 329protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) 341protected virtual async Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 358internal async Task<Solution> GetRequiredChangedSolutionAsync(IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 360var solution = await this.GetChangedSolutionAsync(progressTracker, cancellationToken).ConfigureAwait(false); 399internal async Task<Solution?> GetChangedSolutionInternalAsync( 400Solution originalSolution, IProgress<CodeAnalysisProgress> progress, bool postProcessChanges = true, CancellationToken cancellationToken = default) 402var solution = await GetChangedSolutionAsync(progress, cancellationToken).ConfigureAwait(false); 426Solution? originalSolution, IEnumerable<CodeActionOperation> operations, CancellationToken cancellationToken) 451protected Task<Solution> PostProcessChangesAsync(Solution changedSolution, CancellationToken cancellationToken) 455private static async Task<Solution> PostProcessChangesAsync( 456Solution? originalSolution, 457Solution changedSolution, 525/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 529/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param> 532public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey) 536/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 540/// <param name="createChangedSolution">Function to create the <see cref="Solution"/>.</param> 543public static CodeAction Create(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 546/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Solution}}, string?, CodeActionPriority)"/> 548public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 695private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> _createChangedSolution; 699Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 710Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 719Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> createChangedSolution, 724protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 745protected sealed override Task<Solution?> GetChangedSolutionAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 746=> SpecializedTasks.Null<Solution>();
CodeActions\CodeAction_Cleanup.cs (11)
60Solution originalSolution, 61Solution changedSolution) 72internal static async Task<Solution> CleanSyntaxAndSemanticsAsync( 73Solution originalSolution, 74Solution changedSolution, 82var cleanedSolution = await RunAllCleanupPassesInOrderAsync( 120private static async Task<Solution> RunAllCleanupPassesInOrderAsync( 121Solution solution, 129var currentSolution = solution; 135async Task<Solution> RunParallelCleanupPassAsync( 136Solution 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)
38private async Task<Solution?> FixAllContextsAsync( 69var currentSolution = originalFixAllContext.Solution; 140var solution = fixAllContext.Solution; 167var changedSolution = await codeAction.GetChangedSolutionInternalAsync( 252private static async Task<Solution> ApplyChangesAsync( 253Solution 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)
30public 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)
22public 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)
22Solution 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\DiagnosticData.cs (1)
189public static DiagnosticData Create(Solution solution, Diagnostic diagnostic, Project? project)
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) 72Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 103Solution solution, ImmutableArray<ISymbol> symbols, CancellationToken cancellationToken) 133Solution solution, 161Solution solution, 191Solution solution, Project? sourceProject, HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, CancellationToken cancellationToken) 256Solution solution,
FindSymbols\FindReferences\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); 843ISymbol symbol, Solution solution, FindReferencesSearchOptions options, CancellationToken cancellationToken) 856TSymbol 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)
25Solution solution, 38private readonly Solution _solution = solution;
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (3)
38protected Solution Solution => Engine._solution; 94Solution solution, MetadataUnifyingSymbolHashSet symbols, CancellationToken cancellationToken) 104Solution solution, ISymbol symbol, CancellationToken cancellationToken)
FindSymbols\LinkedFileReferenceLocationEqualityComparer.cs (1)
12/// Helper comparer to enable consumers of <see cref="SymbolFinder.FindReferencesAsync(ISymbol, Solution,
FindSymbols\SymbolFinder.cs (4)
122public static Task<ISymbol?> FindSourceDefinitionAsync(ISymbol? symbol, Solution solution, CancellationToken cancellationToken = default) 127ISymbol? symbol, Solution solution, CancellationToken cancellationToken) 152Solution solution, 249ISymbol symbol, Solution solution, CancellationToken cancellationToken)
FindSymbols\SymbolFinder.FindLiteralsServerCallback.cs (1)
15Solution solution,
FindSymbols\SymbolFinder.FindReferencesServerCallback.cs (1)
23Solution 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 (6)
27Solution solution, 40Solution solution, 60Solution solution, 82Solution solution, 98Solution solution, 117Solution 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) 66internal static bool IsOverride(Solution solution, ISymbol member, ISymbol symbol) 81ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 90ISymbol symbol, Solution solution, CancellationToken cancellationToken) 103Solution solution, 191/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution, 201INamedTypeSymbol type, Solution solution, IImmutableSet<Project>? projects, CancellationToken cancellationToken) 208/// "derived", but can be found with <see cref="FindImplementationsAsync(ISymbol, Solution, 219INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 231/// <inheritdoc cref="FindDerivedClassesArrayAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/> 234INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 255INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 267/// <inheritdoc cref="FindDerivedInterfacesAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/> 270INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 291INamedTypeSymbol type, Solution solution, bool transitive = true, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 303/// <inheritdoc cref="FindImplementationsAsync(INamedTypeSymbol, Solution, bool, IImmutableSet{Project}, CancellationToken)"/> 306INamedTypeSymbol type, Solution solution, bool transitive, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 320ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default) 339/// <inheritdoc cref="FindImplementationsAsync(ISymbol, Solution, IImmutableSet{Project}, CancellationToken)"/> 344ISymbol symbol, Solution solution, IImmutableSet<Project>? projects = null, CancellationToken cancellationToken = default)
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)
83var solution = project.Solution; 121var 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)
19/// same <see cref="Solution"/> snapshot alive on the OOP side, computed attached values (like <see 98/// cref="CreateAsync(Solution, CancellationToken)"/> is not possible (for example, in a constructor). 100public static RemoteKeepAliveSession Create(Solution solution, IAsynchronousOperationListener listener) 109public static Task<RemoteKeepAliveSession> CreateAsync(Solution solution, CancellationToken cancellationToken) 112/// <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)
63var solution = lightweightRenameLocations.Solution; 152private static bool IsIdentifierValid_Worker(Solution solution, string replacementText, IEnumerable<ProjectId> projectIds) 345Solution solution, 401private static async Task<Location?> GetSymbolLocationAsync(Solution solution, ISymbol symbol, CancellationToken cancellationToken)
Rename\ConflictEngine\ConflictResolver.Session.cs (5)
98var baseSolution = _renameLocationSet.Solution; 709var solution = _renameLocationSet.Solution; 776private async Task<Solution> AnnotateAndRename_WorkerAsync( 777Solution originalSolution, 778Solution 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)
92public async ValueTask<RenameLocation> RehydrateAsync(Solution solution, CancellationToken cancellation)
Rename\IRenameRewriterLanguageService.cs (4)
57Solution baseSolution, 58Solution newSolution, 126public abstract Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(string replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable<ISymbol> referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary<Location, Location> reverseMappedLocations, CancellationToken cancellationToken);
Rename\LightweightRenameLocations.cs (3)
26public readonly Solution Solution; 34Solution solution, 74ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken)
Rename\Renamer.cs (7)
40public static Task<Solution> RenameSymbolAsync(Solution solution, ISymbol symbol, string newName, OptionSet? optionSet, CancellationToken cancellationToken = default) 43public static async Task<Solution> RenameSymbolAsync( 44Solution solution, ISymbol symbol, SymbolRenameOptions options, string newName, CancellationToken cancellationToken = default) 141internal static Task<LightweightRenameLocations> FindRenameLocationsAsync(Solution solution, ISymbol symbol, SymbolRenameOptions options, CancellationToken cancellationToken) 145Solution solution, 190Solution solution,
Rename\Renamer.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)
40internal 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) 205ISymbol symbol, Solution solution, CancellationToken cancellationToken) 316ISymbol symbol, Solution solution, CancellationToken cancellationToken)
Rename\SymbolicRenameLocations.cs (5)
26public readonly Solution Solution; 36Solution solution, 59ISymbol symbol, Solution solution, SymbolRenameOptions options, CancellationToken cancellationToken) 115ISymbol symbol, Solution solution, CancellationToken cancellationToken) 127Solution 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)
24public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken) 54public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 57private bool CanAddTo(SyntaxNode? destination, Solution solution, CancellationToken cancellationToken, 127Solution solution, 137Solution solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
12Solution Solution,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
92public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
179bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken); 184bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
219var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (13)
16public static IEnumerable<DocumentId> GetChangedDocuments(this Solution? newSolution, Solution oldSolution) 32public static TextDocument? GetTextDocument(this Solution solution, DocumentId? documentId) 35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 38public static Project GetRequiredProject(this Solution solution, ProjectId projectId) 49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId) 66public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 69public static async ValueTask<TextDocument> GetRequiredTextDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken = default) 73public static TextDocument GetRequiredAdditionalDocument(this Solution solution, DocumentId documentId) 76public static TextDocument GetRequiredAnalyzerConfigDocument(this Solution solution, DocumentId documentId) 79public static TextDocument GetRequiredTextDocument(this Solution solution, DocumentId documentId) 86public static Solution WithUpToDateSourceGeneratorDocuments(this Solution solution, IEnumerable<ProjectId> projectIds)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
24/// 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)
15public Solution Solution { get; } 20public 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 (5)
230private void ChangeProjectProperty<T>(ref T field, T newValue, Func<Solution, Solution> updateSolution, bool logThrowAwayTelemetry = false) 297Solution solution, ProjectId projectId) 326private void ChangeProjectOutputPath(ref string? field, string? newValue, Func<Solution, Solution> withNewValue)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (11)
153var newSolution = w.CreateSolution(solutionInfo); 266public void ApplyChangeToWorkspace(ProjectId projectId, Func<CodeAnalysis.Solution, CodeAnalysis.Solution> solutionTransformation) 542Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")] 584Constraint = "Avoid calling " + nameof(CodeAnalysis.Solution.GetProject) + " to avoid realizing all projects.")] 585private static bool CanConvertMetadataReferenceToProjectReference(Solution solution, ProjectId projectIdWithMetadataReference, ProjectId referencedProjectId) 693Solution currentSolution, 823var newSolution = solution 852var newSolution = solution 872Func<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 (3)
502var solution = this.Project.Solution; 511var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken); 527/// Returns the options that should be applied to this document. This consists of global options from <see cref="Solution.Options"/>,
Workspace\Solution\Project.cs (3)
34internal Project(Solution solution, ProjectState projectState) 48public Solution Solution { get; } 330/// generated. This method exists to implement <see cref="Solution.GetDocument(SyntaxTree?)"/> and is best avoided unless you're doing something
Workspace\Solution\Solution.cs (109)
37private readonly AsyncLazy<Solution> _cachedFrozenSolution; 43private readonly Dictionary<DocumentId, AsyncLazy<Solution>> _documentIdToFrozenSolution = []; 47AsyncLazy<Solution>? cachedFrozenSolution = null) 152private static readonly Func<ProjectId, Solution, Project> s_createProjectFunction = CreateProject; 153private static Project CreateProject(ProjectId projectId, Solution solution) 339private Solution WithCompilationState(SolutionCompilationState compilationState) 355public Solution AddProject(ProjectId projectId, string name, string assemblyName, string language) 359public Solution AddProject(ProjectInfo projectInfo) 367internal Solution AddProjects(ArrayBuilder<ProjectInfo> projectInfos) 371public Solution RemoveProject(ProjectId projectId) 379internal Solution RemoveProjects(ArrayBuilder<ProjectId> projectIds) 386public Solution WithProjectAssemblyName(ProjectId projectId, string assemblyName) 401public Solution WithProjectOutputFilePath(ProjectId projectId, string? outputFilePath) 411public Solution WithProjectOutputRefFilePath(ProjectId projectId, string? outputRefFilePath) 421public Solution WithProjectCompilationOutputInfo(ProjectId projectId, in CompilationOutputInfo info) 431public Solution WithProjectDefaultNamespace(ProjectId projectId, string? defaultNamespace) 441internal Solution WithProjectChecksumAlgorithm(ProjectId projectId, SourceHashAlgorithm checksumAlgorithm) 451public Solution WithProjectName(ProjectId projectId, string name) 466public Solution WithProjectFilePath(ProjectId projectId, string? filePath) 477public Solution WithProjectCompilationOptions(ProjectId projectId, CompilationOptions options) 493public Solution WithProjectParseOptions(ProjectId projectId, ParseOptions options) 508internal Solution WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions> options) 516internal Solution WithHasAllInformation(ProjectId projectId, bool hasAllInformation) 528internal Solution WithRunAnalyzers(ProjectId projectId, bool runAnalyzers) 544public Solution WithProjectDocumentsOrder(ProjectId projectId, ImmutableList<DocumentId> documentIds) 559internal Solution WithProjectAttributes(ProjectInfo.ProjectAttributes attributes) 568internal Solution WithProjectInfo(ProjectInfo info) 582public Solution AddProjectReference(ProjectId projectId, ProjectReference projectReference) 598public Solution AddProjectReferences(ProjectId projectId, IEnumerable<ProjectReference> projectReferences) 628public Solution RemoveProjectReference(ProjectId projectId, ProjectReference projectReference) 659public Solution WithProjectReferences(ProjectId projectId, IEnumerable<ProjectReference>? projectReferences) 680public Solution AddMetadataReference(ProjectId projectId, MetadataReference metadataReference) 695public Solution AddMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences) 722public Solution RemoveMetadataReference(ProjectId projectId, MetadataReference metadataReference) 744public Solution WithProjectMetadataReferences(ProjectId projectId, IEnumerable<MetadataReference> metadataReferences) 760public Solution AddAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 775public Solution AddAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 807public Solution RemoveAnalyzerReference(ProjectId projectId, AnalyzerReference analyzerReference) 829public Solution WithProjectAnalyzerReferences(ProjectId projectId, IEnumerable<AnalyzerReference> analyzerReferences) 842public Solution AddAnalyzerReference(AnalyzerReference analyzerReference) 854public Solution AddAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 878public Solution RemoveAnalyzerReference(AnalyzerReference analyzerReference) 894public Solution WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 908public Solution AddDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 926public Solution AddDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false) 945public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue) 963private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated) 977public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1002public Solution AddDocument(DocumentInfo documentInfo) 1006/// Create a new <see cref="Solution"/> instance with the corresponding <see cref="Project"/>s updated to include 1009/// <returns>A new <see cref="Solution"/> with the documents added.</returns> 1010public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos) 1017public Solution AddAdditionalDocument(DocumentId documentId, string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 1024public Solution AddAdditionalDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1045public Solution AddAdditionalDocument(DocumentInfo documentInfo) 1048public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos) 1055public Solution AddAnalyzerConfigDocument(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 1100public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos) 1106public Solution RemoveDocument(DocumentId documentId) 1115public Solution RemoveDocuments(ImmutableArray<DocumentId> documentIds) 1121private Solution RemoveDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1127public Solution RemoveAdditionalDocument(DocumentId documentId) 1136public Solution RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 1142private Solution RemoveAdditionalDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1148public Solution RemoveAnalyzerConfigDocument(DocumentId documentId) 1157public Solution RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 1163private Solution RemoveAnalyzerConfigDocumentsImpl(ImmutableArray<DocumentId> documentIds) 1169public Solution WithDocumentName(DocumentId documentId, string name) 1188public Solution WithDocumentFolders(DocumentId documentId, IEnumerable<string>? folders) 1203public Solution WithDocumentFilePath(DocumentId documentId, string? filePath) 1217public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1220internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.PreserveValue) 1240public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1261public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1282public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1303public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1324public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1345public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue) 1349internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue) 1365internal Solution WithDocumentContentsFrom(DocumentId documentId, DocumentState documentState, bool forceEvenIfTreesWouldDiffer) 1368internal Solution WithDocumentContentsFrom(ImmutableArray<(DocumentId documentId, DocumentState documentState)> documentIdsAndStates, bool forceEvenIfTreesWouldDiffer) 1375public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1398public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1419public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1440public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1461internal Solution WithFrozenPartialCompilations(CancellationToken cancellationToken) 1465internal Task<Solution> WithFrozenPartialCompilationsAsync(CancellationToken cancellationToken) 1468private Solution ComputeFrozenSolution(CancellationToken cancellationToken) 1476var frozenSolution = new Solution( 1491internal Solution WithFrozenPartialCompilationIncludingSpecificDocument(DocumentId documentId, CancellationToken cancellationToken) 1495AsyncLazy<Solution> GetLazySolution() 1510static AsyncLazy<Solution> CreateLazyFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId) 1515static Solution ComputeFrozenSolution(SolutionCompilationState compilationState, DocumentId documentId, CancellationToken cancellationToken) 1518var solution = new Solution(newCompilationState); 1529internal async Task<Solution> WithMergedLinkedFileChangesAsync( 1530Solution oldSolution, 1554internal Solution WithNewWorkspace(string? workspaceKind, int workspaceVersion, SolutionServices services) 1562public Solution GetIsolatedSolution() 1571public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.PreserveValue) 1600var newSolution = WithCompilationState(newCompilationState); 1609internal Solution WithFrozenSourceGeneratedDocuments(ImmutableArray<(SourceGeneratedDocumentIdentity documentIdentity, DateTime generationDateTime, SourceText text)> documents) 1613internal Solution UpdateSpecificSourceGeneratorExecutionVersions(SourceGeneratorExecutionVersionMap sourceGeneratorExecutionVersionMap) 1620internal Solution WithoutFrozenSourceGeneratedDocuments() 1631internal Solution WithCachedSourceGeneratorState(ProjectId projectToUpdate, Project projectWithCachedGeneratorState) 1638public SolutionChanges GetChanges(Solution oldSolution) 1649/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a 1660/// Returns the options that should be applied to this solution. This is equivalent to <see cref="Workspace.Options" /> when the <see cref="Solution"/> 1681public Solution WithOptions(OptionSet options) 1694internal Solution WithOptions(SolutionOptionSet options)
Workspace\Solution\SolutionChanges.cs (5)
13private readonly Solution _newSolution; 14private readonly Solution _oldSolution; 16internal SolutionChanges(Solution newSolution, Solution oldSolution) 35var old = _oldSolution;
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (1)
137/// queried for (for example: <see cref="Solution.GetOriginatingProject(ISymbol)"/>. If <see
Workspace\Solution\SolutionCompilationState.cs (3)
960/// <inheritdoc cref="Solution.WithDocumentSyntaxRoots(ImmutableArray{ValueTuple{DocumentId, SyntaxNode}}, PreservationMode)"/> 1210/// generated. This method exists to implement <see cref="Solution.GetDocument(SyntaxTree?)"/> and is best avoided unless you're doing something 1733/// <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)
215/// This implicitly also changes the value of <see cref="Solution.Workspace"/> for this solution, 1184/// Gets the set of <see cref="DocumentId"/>s in this <see cref="Solution"/> with a
Workspace\TextExtensions.cs (3)
27var solution = workspace.CurrentSolution; 63var solution = workspace.CurrentSolution; 110var solution = workspace.CurrentSolution;
Workspace\Workspace.cs (147)
33/// workspace's <see cref="TryApplyChanges(Solution)"/> method. 48private Solution _latestSolution; 57/// when they are applied to workspace via <see cref="TryApplyChanges(Solution, IProgress{CodeAnalysisProgress})"/>. 118protected internal Solution CreateSolution(SolutionInfo solutionInfo) 127private Solution CreateSolution(SolutionInfo solutionInfo, SolutionOptionSet options, IReadOnlyList<AnalyzerReference> analyzerReferences, ImmutableDictionary<string, StructuredAnalyzerConfigOptions> fallbackAnalyzerOptions) 133protected internal Solution CreateSolution(SolutionId id) 143/// after <see cref="TryApplyChanges(Solution)"/> is called. 145public Solution CurrentSolution 160protected Solution SetCurrentSolution(Solution solution) 172private protected (Solution oldSolution, Solution newSolution) SetCurrentSolutionEx(Solution solution) 179var oldSolution = this.CurrentSolution; 191/// <inheritdoc cref="SetCurrentSolution(Func{Solution, Solution}, Func{Solution, Solution, ValueTuple{WorkspaceChangeKind, ProjectId?, DocumentId?}}, Action{Solution, Solution}?, Action{Solution, Solution}?)"/> 193Func<Solution, Solution> transformation, 197Action<Solution, Solution>? onBeforeUpdate = null, 198Action<Solution, Solution>? onAfterUpdate = null) 221internal (bool updated, Solution newSolution) SetCurrentSolution( 222Func<Solution, Solution> transformation, 223Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 224Action<Solution, Solution>? onBeforeUpdate = null, 225Action<Solution, Solution>? onAfterUpdate = null) 240internal async ValueTask<(bool updated, Solution newSolution)> SetCurrentSolutionAsync( 242Func<Solution, Solution> transformation, 243Func<Solution, Solution, (WorkspaceChangeKind changeKind, ProjectId? projectId, DocumentId? documentId)> changeKind, 244Action<Solution, Solution>? onBeforeUpdate, 245Action<Solution, Solution>? onAfterUpdate, 253var newSolution = data.transformation(oldSolution); 279static Solution UnifyLinkedDocumentContents(Solution oldSolution, Solution newSolution) 319static Solution UpdateAddedDocumentToExistingContentsInSolution( 320Solution solution, ArrayBuilder<DocumentId> addedDocumentIds) 360static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds) 395/// allow the host to initialize <see cref="Solution.FallbackAnalyzerOptions"/> for that language. 397/// we clear out its <see cref="Solution.FallbackAnalyzerOptions"/>. 404/// the host had the opportunity to initialize <see cref="Solution.FallbackAnalyzerOptions"/> 405/// of any <see cref="Solution"/> snapshot stored in <see cref="CurrentSolution"/>. 407private Solution InitializeAnalyzerFallbackOptions(Solution oldSolution, Solution newSolution) 457/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated 462/// name="transformation"/> as it will have its <see cref="Solution.WorkspaceVersion"/> updated 464private protected (Solution oldSolution, Solution newSolution) SetCurrentSolution<TData>( 466Func<Solution, TData, Solution> transformation, 468Action<Solution, Solution, TData>? onBeforeUpdate = null, 469Action<Solution, Solution, TData>? onAfterUpdate = null) 485/// <inheritdoc cref="SetCurrentSolution{TData}(TData, Func{Solution, TData, Solution}, bool, Action{Solution, Solution, TData}?, Action{Solution, Solution, TData}?)"/> 486private protected async ValueTask<(Solution oldSolution, Solution newSolution)> SetCurrentSolutionAsync<TData>( 489Func<Solution, TData, Solution> transformation, 491Action<Solution, Solution, TData>? onBeforeUpdate, 492Action<Solution, Solution, TData>? onAfterUpdate, 499var oldSolution = Volatile.Read(ref _latestSolution); 511var newSolution = transformation(oldSolution, data); 549/// Gets or sets the set of all global options and <see cref="Solution.Options"/>. 550/// Setter also force updates the <see cref="CurrentSolution"/> to have the updated <see cref="Solution.Options"/>. 702private static Solution CheckAndAddProjects(Solution solution, IReadOnlyList<ProjectInfo> projects) 714private static Solution CheckAndAddProject(Solution newSolution, ProjectInfo project) 730var newSolution = this.CreateSolution(solutionInfo); 746var newSolution = this.CreateSolution(reloadedSolutionInfo); 976/// Call this method when <see cref="Solution.FallbackAnalyzerOptions"/> change in the host environment. 1069var newSolution = oldSolution; 1213Func<Solution, DocumentId, TextDocument?> getDocumentInSolution, 1214Func<Solution, DocumentId, TArg, Solution> updateSolutionWithText, 1249var newSolution = oldSolution; 1250var previousSolution = newSolution; 1402static Solution UpdateReferencesAfterAdd(Solution solution) 1459/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method. 1481public virtual bool TryApplyChanges(Solution newSolution) 1484internal virtual bool TryApplyChanges(Solution newSolution, IProgress<CodeAnalysisProgress> progressTracker) 1518var solutionWithLinkedFileChangesMerged = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, solutionChanges, cancellationToken: CancellationToken.None).Result; 1786/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1793/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1794/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1799/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed. 1806/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1807/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1812/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project 1985private static void CheckNoChanges(Solution oldSolution, Solution newSolution) 2024/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution. 2035/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution. 2046/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options. 2064/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options. 2081/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project. 2092/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project. 2103/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project. 2114/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project. 2125/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project. 2136/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project. 2147/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution. 2158/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution. 2169/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project. 2180/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project. 2213/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project. 2224/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project. 2246/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project. 2257/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project. 2287private static void CheckSolutionIsEmpty(Solution solution) 2301private static void CheckProjectIsInSolution(Solution solution, ProjectId projectId) 2317private static void CheckProjectIsNotInSolution(Solution solution, ProjectId projectId) 2414internal static void CheckSolutionHasAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2425internal static void CheckSolutionDoesNotHaveAnalyzerReference(Solution solution, AnalyzerReference analyzerReference) 2439private static void CheckDocumentIsInSolution(Solution solution, DocumentId documentId) 2455private static void CheckAdditionalDocumentIsInSolution(Solution solution, DocumentId documentId) 2471private static void CheckAnalyzerConfigDocumentIsInSolution(Solution solution, DocumentId documentId) 2500private static void CheckAdditionalDocumentIsNotInSolution(Solution solution, DocumentId documentId) 2516private 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)
45protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId projectId = null, DocumentId documentId = null) 231var currentSolution = this.CurrentSolution;
Workspace\Workspace_SourceGeneration.cs (1)
61Solution 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)
174public Task<Solution> OpenSolutionAsync( 190public async Task<Solution> OpenSolutionAsync( 304public override bool TryApplyChanges(Solution newSolution) 309internal 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> 60public static ProjectMap Create(Solution solution)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (84)
MSBuildWorkspaceTestBase.cs (6)
60var sol = await workspace.OpenSolutionAsync(solutionFilePath); 69var sol = await workspace.OpenSolutionAsync(solutionFilePath); 78var sol = await workspace.OpenSolutionAsync(solutionFilePath); 87var sol = await workspace.OpenSolutionAsync(solutionFilePath); 116var sol = await workspace.OpenSolutionAsync(solutionFilePath); 132protected async Task<Solution> SolutionAsync(params IBuilder[] inputs)
NetCoreTests.cs (1)
376var solution = await workspace.OpenSolutionAsync(solutionFilePath);
VisualStudioMSBuildWorkspaceTests.cs (77)
58var solution = await workspace.OpenSolutionAsync(solutionFilePath); 74var solution = await workspace.OpenSolutionAsync(solutionFilePath); 113var solution = await workspace.OpenSolutionAsync(solutionFilePath); 206var solution = await workspace.OpenSolutionAsync(solutionFilePath); 218var solution = await workspace.OpenSolutionAsync(solutionFilePath); 242var sol = await workspace.OpenSolutionAsync(solutionFilePath); 257var sol = await workspace.OpenSolutionAsync(solutionFilePath); 278var solution = await workspace.OpenSolutionAsync(solutionFilePath); 296var sol = await workspace.OpenSolutionAsync(solutionFilePath); 311var sol = await workspace.OpenSolutionAsync(solutionFilePath); 334var sol = await workspace.OpenSolutionAsync(solutionFilePath); 356var solution = await SolutionAsync( 388var solution = await workspace.OpenSolutionAsync(solutionFilePath); 398var solution1 = solution.WithDocumentText(document.Id, SourceText.From("using test;")); 411var solution2 = solution1.WithProjectCompilationOptions(project.Id, project.CompilationOptions.WithOutputKind(OutputKind.NetModule)); 421var solution3 = solution2.AddProject(pid2, "foo", "foo", LanguageNames.CSharp); 587var solution = await workspace.OpenSolutionAsync(solutionFilePath); 787var solution = await workspace.OpenSolutionAsync(solutionFilePath); 805var solution = await workspace.OpenSolutionAsync(solutionFilePath); 823var solution = await workspace.OpenSolutionAsync(solutionFilePath); 841var solution = await workspace.OpenSolutionAsync(solutionFilePath); 954var solution = await ws.OpenSolutionAsync(GetSolutionFileName(@"TestSolution.sln")); 988var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1006var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1019var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1048var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1078var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1091var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1106var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1168var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1654var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1835var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1861var solution = await workspace.OpenSolutionAsync(solutionFilePath); 1895var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1918var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1942var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1965var sol = await workspace.OpenSolutionAsync(solutionFilePath); 1990var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2011var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2018var solution2 = workspace.CurrentSolution; 2037var solutionB = await workspaceB.OpenSolutionAsync(solutionFilePath); 2052var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2061var solution2 = workspace.CurrentSolution; 2086var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2094var solution2 = workspace.CurrentSolution; 2113var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2118var newSolution = solution.WithDocumentText(document.Id, newText); 2123var solution2 = workspace.CurrentSolution; 2139var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2145var newSolution = solution.WithAdditionalDocumentText(document.Id, newText); 2150var solution2 = workspace.CurrentSolution; 2167var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2171var newSolution = solution.AddDocument(newDocId, "Bar.cs", newText); 2176var solution2 = workspace.CurrentSolution; 2229var originalSolution = workspace.CurrentSolution; 2259var originalSolution = workspace.CurrentSolution; 2427var sol = await workspace.OpenSolutionAsync(fullPath); 2446var sol = await workspace.OpenSolutionAsync(fullPath); 2519var sol = await workspace.OpenSolutionAsync(fullPath); 2534var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2550var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2568var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2586var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2663var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2678var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2695var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2701var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2707var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2725var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2751var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2912var noEncodingSolution = noEncodingDoc.Project.Solution; 2934var solution = await workspace.OpenSolutionAsync(solutionFilePath); 2962var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3039var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3170var solution = await workspace.OpenSolutionAsync(solutionFilePath); 3212var solution = await workspace.OpenSolutionAsync(fullPath); 3275var solution = await workspace.OpenSolutionAsync(solutionFilePath);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (33)
SolutionUtilities.cs (19)
15public static ProjectChanges GetSingleChangedProjectChanges(Solution oldSolution, Solution newSolution) 31private static IEnumerable<ProjectChanges> GetChangedProjectChanges(Solution oldSolution, Solution newSolution) 37public static Document GetSingleChangedDocument(Solution oldSolution, Solution newSolution) 45public static TextDocument GetSingleChangedAdditionalDocument(Solution oldSolution, Solution newSolution) 53public static IEnumerable<DocumentId> GetChangedDocuments(Solution oldSolution, Solution newSolution) 65public static Document GetSingleAddedDocument(Solution oldSolution, Solution newSolution) 73public static IEnumerable<DocumentId> GetTextChangedDocuments(Solution oldSolution, Solution newSolution) 85public static IEnumerable<DocumentId> GetAddedDocuments(Solution oldSolution, Solution newSolution) 97public static Tuple<Project, ProjectReference> GetSingleAddedProjectReference(Solution oldSolution, Solution newSolution) 103public 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)
120/// Use to set specified editorconfig options as <see cref="Solution.FallbackAnalyzerOptions"/>. 133/// Use to set specified editorconfig options as <see cref="Solution.FallbackAnalyzerOptions"/>. 148/// Use to set specified options both as global options and as <see cref="Solution.FallbackAnalyzerOptions"/>. 545public Task ChangeDocumentAsync(DocumentId documentId, Solution solution) 575public Task ChangeProjectAsync(ProjectId projectId, Solution solution) 585public Task ChangeSolutionAsync(Solution solution) 798public override bool TryApplyChanges(Solution newSolution)
Microsoft.CodeAnalysis.Workspaces.UnitTests (360)
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)
91private Workspace CreateWorkspaceWithSingleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) 108private Workspace CreateWorkspaceWithMultipleProjectSolution(TestHost testHost, string[] sourceTexts, out Solution solution) 125private Workspace CreateWorkspaceWithSolution(SolutionKind solutionKind, out Solution solution, TestHost testHost = TestHost.OutOfProcess) 142var 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 (240)
117var solution = workspace.CurrentSolution; 126var solution = workspace.CurrentSolution; 136var solution = workspace.CurrentSolution; 145var solution = workspace.CurrentSolution; 155var solution = workspace.CurrentSolution; 164var solution = workspace.CurrentSolution; 174var solution = workspace.CurrentSolution; 178var newSolution1 = solution.WithDocumentName(documentId, name); 181var newSolution2 = newSolution1.WithDocumentName(documentId, name); 194var solution = workspace.CurrentSolution; 198var newSolution1 = solution.WithDocumentFolders(documentId, folders); 201var newSolution2 = newSolution1.WithDocumentFolders(documentId, folders); 205var newSolution3 = solution.WithDocumentFolders(documentId, []); 208var newSolution4 = solution.WithDocumentFolders(documentId, []); 211var newSolution5 = solution.WithDocumentFolders(documentId, null); 225var solution = workspace.CurrentSolution; 229var newSolution1 = solution.WithDocumentFilePath(documentId, path); 233var newSolution2 = newSolution1.WithDocumentFilePath(documentId, path); 236var newSolution3 = solution.WithDocumentFilePath(documentId, ""); 240var newSolution4 = solution.WithDocumentFilePath(documentId, null); 252var solution = workspace.CurrentSolution; 257var newSolution1 = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Script); 271var solution = workspace.CurrentSolution; 290var solution = workspace.CurrentSolution; 293var newSolution = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Interactive); 301var solution = workspace.CurrentSolution; 309var newSolution1 = solution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity); 316var newSolution2 = newSolution1.WithDocumentSyntaxRoot(documentId, actualRoot); 331var solution = workspace.CurrentSolution 347var solution = workspace.CurrentSolution; 352var newSolution1 = solution.WithDocumentText(documentId, text, PreservationMode.PreserveIdentity); 358var newSolution2 = newSolution1.WithDocumentText(documentId, text, PreservationMode.PreserveIdentity); 372var solution = workspace.CurrentSolution; 376var newSolution1 = solution.WithDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 382var newSolution2 = newSolution1.WithDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 396var solution = workspace.CurrentSolution; 429var solution = workspace.CurrentSolution; 496private static Solution UpdateSolution(PreservationMode mode, TextUpdateType updateType, Solution solution, DocumentId documentId1, SourceText text, TextAndVersion textAndVersion) 517var solution = workspace.CurrentSolution; 596var solution = workspace.CurrentSolution; 682var solution = workspace.CurrentSolution; 759var solution = workspace.CurrentSolution; 830var solution = workspace.CurrentSolution; 834var newSolution1 = solution.WithAdditionalDocumentText(documentId, text, PreservationMode.PreserveIdentity); 838var newSolution2 = newSolution1.WithAdditionalDocumentText(documentId, text, PreservationMode.PreserveIdentity); 852var solution = workspace.CurrentSolution; 856var newSolution1 = solution.WithAdditionalDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 862var newSolution2 = newSolution1.WithAdditionalDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 876var solution = workspace.CurrentSolution; 880var newSolution1 = solution.WithAnalyzerConfigDocumentText(documentId, text, PreservationMode.PreserveIdentity); 884var newSolution2 = newSolution1.WithAnalyzerConfigDocumentText(documentId, text, PreservationMode.PreserveIdentity); 898var solution = workspace.CurrentSolution; 902var newSolution1 = solution.WithAnalyzerConfigDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 908var newSolution2 = newSolution1.WithAnalyzerConfigDocumentText(documentId, textAndVersion, PreservationMode.PreserveIdentity); 922var solution = workspace.CurrentSolution; 926var newSolution1 = solution.WithDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 930var newSolution2 = solution.WithDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 944var solution = workspace.CurrentSolution; 948var newSolution1 = solution.WithAdditionalDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 952var newSolution2 = solution.WithAdditionalDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 966var solution = workspace.CurrentSolution; 970var newSolution1 = solution.WithAnalyzerConfigDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 974var newSolution2 = solution.WithAnalyzerConfigDocumentTextLoader(documentId, loader, PreservationMode.PreserveIdentity); 1002var solution = workspace.CurrentSolution 1117var newSolution = solution.WithProjectInfo(newInfo); 1207var solution = workspace.CurrentSolution 1242var solution = workspace.CurrentSolution 1277var solution = workspace.CurrentSolution 1312var solution = workspace.CurrentSolution 1346var solution = workspace.CurrentSolution 1352var newSolution = solution.WithProjectAssemblyName(projectId, assemblyName); 1368var solution = workspace.CurrentSolution 1391var solution = workspace.CurrentSolution 1414var solution = workspace.CurrentSolution 1437var solution = workspace.CurrentSolution. 1460var solution = workspace.CurrentSolution. 1497var solution = workspace.CurrentSolution 1551var solution = workspace.CurrentSolution 1574var solution = workspace.CurrentSolution 1597var solution = workspace.CurrentSolution 1614var solution = workspace.CurrentSolution 1639var solution = workspace.CurrentSolution 1789var solution = workspace.CurrentSolution; 1807var solution2 = solution.WithProjectReferences(projectId, projectRefs); 1822var solution = workspace.CurrentSolution; 1827var newSolution1 = solution.WithProjectReferences(projectId, projectRefs); 1838var solution = workspace.CurrentSolution; 1853var solution2 = solution.AddProjectReferences(projectId, EmptyEnumerable<ProjectReference>()); 1858var solution3 = solution.AddProjectReferences(projectId, e); 1880var solution = workspace.CurrentSolution; 1891var solution2 = solution.RemoveProjectReference(projectId, externalProjectRef); 1895var solution3 = solution.RemoveProjectReference(projectId, projectRef2); 1898var solution4 = solution3.RemoveProjectReference(projectId, externalProjectRef); 1915var solution = workspace.CurrentSolution; 1951var solution = workspace.CurrentSolution; 1969var solution = workspace.CurrentSolution; 1972var solution2 = solution.AddMetadataReferences(projectId, EmptyEnumerable<MetadataReference>()); 1978var solution3 = solution.AddMetadataReferences(projectId, OnceEnumerable(metadataRef1, metadataRef2)); 1994var solution = workspace.CurrentSolution; 2001var solution2 = solution.RemoveMetadataReference(projectId, metadataRef1); 2004var solution3 = solution2.RemoveMetadataReference(projectId, metadataRef2); 2021var solution = workspace.CurrentSolution; 2039var solution = workspace.CurrentSolution; 2042var solution2 = solution.AddAnalyzerReferences(projectId, EmptyEnumerable<AnalyzerReference>()); 2048var solution3 = solution.AddAnalyzerReferences(projectId, OnceEnumerable(analyzerRef1, analyzerRef2)); 2051var solution4 = solution3.AddAnalyzerReferences(projectId, []); 2067var solution = workspace.CurrentSolution; 2074var solution2 = solution.RemoveAnalyzerReference(projectId, analyzerRef1); 2077var solution3 = solution2.RemoveAnalyzerReference(projectId, analyzerRef2); 2094var solution = workspace.CurrentSolution; 2108var solution = workspace.CurrentSolution; 2110var solution2 = solution.AddAnalyzerReferences(EmptyEnumerable<AnalyzerReference>()); 2116var solution3 = solution.AddAnalyzerReferences(OnceEnumerable(analyzerRef1, analyzerRef2)); 2134var solution = workspace.CurrentSolution; 2140var solution2 = solution.RemoveAnalyzerReference(analyzerRef1); 2143var solution3 = solution2.RemoveAnalyzerReference(analyzerRef2); 2161var solution = workspace.CurrentSolution; 2165var solution2 = solution.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2172var solution3 = solution2.WithFallbackAnalyzerOptions(ImmutableDictionary<string, StructuredAnalyzerConfigOptions>.Empty 2187var solution4 = solution3.AddAnalyzerConfigDocument(editorConfigId, "editorconfig2", SourceText.From(editorConfigContent), filePath: Path.Combine(s_projectDir, "editorconfig2")); 2191static void TestOptionValues(Solution solution, string expectedA, string expectedB) 2218var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2226var solution2 = solution.AddDocument(documentId, "name", loader, folders); 2244var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2252var solution2 = solution.AddDocument(documentId, "name", "text", folders, filePath); 2274var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2283var solution2 = solution.AddDocument(documentId, "name", sourceText, folders, filePath, isGenerated: true); 2303var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2312var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 2332var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2343var solution2 = solution.AddDocument(documentId, "name", root, folders, filePath); 2363var solution = workspace.CurrentSolution.AddProject(projectId, "proj1", "proj1.dll", LanguageNames.CSharp). 2372var solution2 = solution.AddDocument(documentId, "name", root); 2386var solution = workspace.CurrentSolution; 2399var solution = workspace.CurrentSolution; 2411var solution = workspace.CurrentSolution; 2426var solution = workspace.CurrentSolution 2472var solution = workspace.CurrentSolution 2496var solution = workspace.CurrentSolution 2524var solution = workspace.CurrentSolution 2534var solution = workspace.CurrentSolution; 2548var solution = workspace.CurrentSolution 2569var solution = workspace.CurrentSolution 2590var solution = workspace.CurrentSolution 2609var solution = workspace.CurrentSolution 2628var solution = workspace.CurrentSolution 2643var solution = workspace.CurrentSolution 2662var solution = workspace.CurrentSolution 2679var solution = workspace.CurrentSolution 2691private static async Task ValidateSolutionAndCompilationsAsync(Solution solution) 2779var solution = workspace.CurrentSolution; 2800var solution = workspace.CurrentSolution; 2838var solution = workspace.CurrentSolution; 2847var newSolution = solution.AddAnalyzerReference(project1, analyzerReference); 2896var solution = workspace.CurrentSolution; 2914var sol = workspace.CurrentSolution; 2923var sol2 = sol.RemoveProject(pid); 2933var sol = workspace.CurrentSolution; 2945var sol2 = sol.RemoveProject(pid); 2959var sol = workspace.CurrentSolution; 2970var sol2 = sol.RemoveProject(pid); 2977var sol3 = sol2.AddProject(pid, "goo", "goo.dll", LanguageNames.CSharp); 2995var sol = workspace.CurrentSolution 3016var solution1 = workspace.CurrentSolution 3022var solution2 = solution1.WithDocumentSyntaxRoot(documentId, newRoot); 3039var sol = workspace.CurrentSolution 3050var sol2 = sol.WithDocumentSyntaxRoot(did, annotatedRoot); 3080var sol = workspace.CurrentSolution 3121var solution = workspace.CurrentSolution 3152var sol = workspace.CurrentSolution; 3183var sol = workspace.CurrentSolution 3205var sol = workspace.CurrentSolution 3226var sol = workspace.CurrentSolution 3250var sol = workspace.CurrentSolution 3272var sol = workspace.CurrentSolution 3293var sol = workspace.CurrentSolution 3313var sol = workspace.CurrentSolution 3333var sol = workspace.CurrentSolution 3353var sol = workspace.CurrentSolution 3372var sol = workspace.CurrentSolution 3382private static ObjectReference<SourceText> GetObservedText(Solution solution, DocumentId documentId, string expectedText = null) 3403var sol = workspace.CurrentSolution 3413private static ObjectReference<SourceText> GetObservedTextAsync(Solution solution, DocumentId documentId, string expectedText = null) 3435var sol = workspace.CurrentSolution 3445private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRoot(Solution solution, DocumentId documentId) 3461var sol = workspace.CurrentSolution 3471private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRootAsync(Solution solution, DocumentId documentId) 3495var sol = workspace.CurrentSolution 3525var sol = workspace.CurrentSolution 3532private static void TestRecoverableSyntaxTree(Solution sol, DocumentId did) 3576var sol = workspace.CurrentSolution 3586private static ObjectReference<Compilation> GetObservedCompilationAsync(Solution solution, ProjectId projectId) 3601var sol = workspace.CurrentSolution 3611private static ObjectReference<Compilation> GetObservedCompilation(Solution solution, ProjectId projectId) 3628var sol = workspace.CurrentSolution 3762var solution = workspace.CurrentSolution; 3815var solution = new AdhocWorkspace().CurrentSolution 3835var solution2 = solution.WithDocumentText(did3, SourceText.From(text4)); 3990var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }")); 4035var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }")); 4096var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 4208var solution = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution; 4264var currentSolution = workspace.CurrentSolution; 4404var solution = workspace.CurrentSolution; 4420var solution = workspace.CurrentSolution; 4491var solution = workspace.CurrentSolution; 4528var solution = workspace.CurrentSolution; 4564var solution = workspace.CurrentSolution; 4605var solution = workspace.CurrentSolution; 4651var solution = workspace.CurrentSolution; 4682var solution = workspace.CurrentSolution; 4792var solution = workspace.CurrentSolution; 4815var solution = workspace.CurrentSolution; 4837var solution = workspace.CurrentSolution; 4865var solution = workspace.CurrentSolution; 4893var solution = workspace.CurrentSolution; 4922var solution = workspace.CurrentSolution; 4953var solution = workspace.CurrentSolution; 4991var solution = workspace.CurrentSolution; 5008var solution = workspace.CurrentSolution; 5054var solution = workspace.CurrentSolution; 5098var solution = workspace.CurrentSolution; 5122var solution = workspace.CurrentSolution; 5243var s0 = workspace.CurrentSolution; 5253var s1 = s0.WithOptions(options); 5257var s2 = s1.AddProject("P1", "A1", LanguageNames.VisualBasic).Solution; 5261var s4 = s2.RemoveProject(s2.Projects.Single(p => p.Name == "P1").Id); 5289var solution = workspace.CurrentSolution.AddProject(projInfo); 5318var solution = workspace.CurrentSolution; 5372var solution = workspace.CurrentSolution 5399var solution = workspace.CurrentSolution 5419var solution = workspace.CurrentSolution 5438var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5457var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5479var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5509var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5539var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5569var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5639var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
SolutionTests\SolutionWithSourceGeneratorTests.cs (7)
369var solutionWithProjects = AddProjectWithReference(workspace.CurrentSolution, analyzerReference); 383static Solution AddProjectWithReference(Solution solution, TestGeneratorReference analyzerReference) 398var solution = AddEmptyProject(workspace.CurrentSolution) 639var solution = AddEmptyProject(workspace.CurrentSolution) 767var frozenSolution = originalDocument2.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 853var solution = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference).Solution;
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)
73var newSolution1 = workspace1.CurrentSolution.WithOptions(newSet); 78var oldSolution2 = workspace2.CurrentSolution; 84var newSolution2 = workspace2.CurrentSolution; 104var newSolution1 = workspace1.CurrentSolution.WithOptions(newSet); 108var 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.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 (183)
CallHierarchy\CallHierarchyDetail.cs (1)
69var solution = _workspace.CurrentSolution;
CodeCleanup\AbstractCodeCleanUpFixer.cs (6)
66var solution = _workspace.CurrentSolution; 126var solution = _workspace.CurrentSolution; 169async Task<Solution> ApplyFixAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 181Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Solution>> applyFixAsync, 204private static async Task<Solution> FixProjectsAsync( 205Solution 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)
36public ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken) 42public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, 67public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 88public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 113public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 139Solution solution, ImmutableArray<ReferenceLocationDescriptor> descriptors, CancellationToken cancellationToken) 253private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (2)
135var solution = document.Project.Solution; 172var forkedSolution = solution.WithDocumentText(document.Id, _projectionBuffer.CurrentSnapshot.AsText(), PreservationMode.PreserveIdentity);
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
14public DebuggerIntelliSenseWorkspace(Solution solution)
DesignerAttribute\VisualStudioDesignerAttributeService.cs (1)
115var solution = _workspace.CurrentSolution;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (3)
93var currentSolution = _workspace.CurrentSolution; 206static BackgroundAnalysisScope? GetBackgroundAnalysisScope(Solution solution, IGlobalOptionService globalOptions) 309var solution = _workspace.CurrentSolution;
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
87var solution = _workspace.CurrentSolution;
EditorConfigSettings\SettingsEditorControl.xaml.cs (1)
83var solution = _workspace.CurrentSolution;
FindReferences\VisualStudioDefinitionsAndReferencesFactory.cs (1)
32Solution solution, DefinitionItem definitionItem, CancellationToken cancellationToken)
Implementation\AbstractEditorFactory.cs (2)
295var solution = workspace.CurrentSolution; 330var forkedSolution = projectToAddTo.Solution.AddDocument(
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (1)
209var solution = _languageService.Workspace.CurrentSolution;
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
464public ImmutableHashSet<Tuple<ProjectId, IAssemblySymbol>> GetAssemblySet(Solution solution, string languageName, CancellationToken cancellationToken) 586public ImmutableArray<ObjectListItem> GetProjectListItems(Solution solution, string languageName, uint listFlags)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_ListItems.cs (2)
25internal ImmutableHashSet<Tuple<ProjectId, IAssemblySymbol>> GetAssemblySet(Solution solution, string languageName, CancellationToken cancellationToken) 43internal ImmutableArray<ObjectListItem> GetProjectListItems(Solution solution, string languageName, uint listFlags)
NavigateTo\RoslynNavigateToSearchCallback.cs (2)
24private readonly Solution _solution; 29Solution solution,
Packaging\PackageInstallerServiceFactory.cs (4)
480var solution = Workspace.CurrentSolution; 520ImmutableSegmentedList<(bool solutionChanged, ProjectId? changedProject)> workQueue, Solution solution, HashSet<ProjectId> projectsToProcess) 540Solution solution, 656public 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)
31public Solution PreviewChanges( 37Solution newSolution, 38Solution oldSolution,
Preview\PreviewUpdater.PreviewDialogWorkspace.cs (1)
21public PreviewDialogWorkspace(Solution solution) : base(solution)
Preview\ReferenceChange.AnalyzerReferenceChange.cs (4)
24internal override Solution AddToSolution(Solution solution) 27internal 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)
23internal override Solution AddToSolution(Solution solution) 26internal override Solution RemoveFromSolution(Solution solution)
Preview\ReferenceChange.ProjectReferenceChange.cs (4)
25internal override Solution AddToSolution(Solution solution) 28internal 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)
21public static async Task<GraphNodeId> CreateNodeIdAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) 62public 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)
19public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ContainsGraphQuery.cs (1)
18public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ImplementedByGraphQuery.cs (1)
19public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\ImplementsGraphQuery.cs (1)
20public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\InheritedByGraphQuery.cs (1)
19public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\InheritsGraphQuery.cs (1)
19public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\IsCalledByGraphQuery.cs (1)
20public 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)
17public async Task<GraphBuilder> GetGraphAsync(Solution solution, IGraphContext context, CancellationToken cancellationToken)
Progression\GraphQueries\OverridesGraphQuery.cs (1)
18public 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)
59var solution = _workspace.CurrentSolution; 100var solution = _workspace.CurrentSolution; 111Solution solution,
Progression\IGraphQuery.cs (1)
16Task<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)
313Microsoft.CodeAnalysis.Solution newSolution, 321var 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)
35var updatedSolution = _workspace.CurrentSolution.WithDocumentName(documentId, _toName);
PullMemberUp\MainDialog\BaseTypeTreeNodeViewModel.cs (1)
45Solution solution,
SyncNamespaces\SyncNamespacesCommandHandler.cs (3)
120var solution = _workspace.CurrentSolution; 135Solution? solution = null; 149var newSolution = previewChangeService.PreviewChanges(
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
422private static ImmutableDictionary<Document, ImmutableArray<Diagnostic>> GetDocumentDiagnosticsMappedToNewSolution(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentDiagnosticsToFixMap, Solution newSolution, string language) 441private 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)
124var solution = document.Project.Solution;
Venus\ContainedLanguageCodeSupport.cs (1)
330var newSolution = Renamer.RenameSymbolAsync(document.Project.Solution, symbol, options, newName, cancellationToken).WaitAndGetResult_Venus(cancellationToken);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
64var solution = visualStudioWorkspace.CurrentSolution;
Workspace\VisualStudioDocumentNavigationService.cs (1)
186var solution = workspace.CurrentSolution;
Workspace\VisualStudioSymbolNavigationService.cs (1)
56var solution = project.Solution;
Workspace\VisualStudioSymbolRenamedCodeActionOperationFactoryWorkspaceService.cs (6)
35public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution) 50private readonly Solution _startingSolution; 51private readonly Solution _updatedSolution; 57Solution startingSolution, 58Solution updatedSolution)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (46)
CodeModel\AbstractFileCodeElementTests.cs (1)
50protected Microsoft.CodeAnalysis.Solution GetCurrentSolution()
DocumentOutline\DocumentOutlineTestsBase.cs (1)
99var 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 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 (4)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (2)
327Public Function GetDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, documentId As DocumentId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), getDocuments As Func(Of Project, DocumentId, IReadOnlyList(Of DocumentId)), includeSuppressedDiagnostics As Boolean, includeLocalDocumentDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetDiagnosticsForIdsAsync 331Public Function GetProjectDiagnosticsForIdsAsync(solution As Solution, projectId As ProjectId, diagnosticIds As ImmutableHashSet(Of String), shouldIncludeAnalyzer As Func(Of DiagnosticAnalyzer, Boolean), includeSuppressedDiagnostics As Boolean, includeNonLocalDocumentDiagnostics As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of DiagnosticData)) Implements IDiagnosticAnalyzerService.GetProjectDiagnosticsForIdsAsync
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 (9)
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\XamlEditAndContinueSolutionProvider.cs (2)
34public event Action<Solution>? SolutionCommitted; 44private void OnEditAndContinueSolutionCommitted(Solution solution)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
77var solution = workspace.CurrentSolution;
Roslyn.VisualStudio.Next.UnitTests (83)
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) 209internal async Task VerifySolutionStateSerializationAsync(Solution solution, Checksum solutionChecksum)
Remote\SnapshotSerializationTests.cs (1)
48internal static Solution SetFullSolution(Workspace workspace)
Services\AssetProviderTests.cs (2)
74var solution = workspace.CurrentSolution; 102var solution = workspace.CurrentSolution;
Services\ServiceHubServicesTests.cs (23)
56var solution = workspace.CurrentSolution; 78var solution = workspace.CurrentSolution; 106private static async Task<AssetProvider> GetAssetProviderAsync(Workspace workspace, Workspace remoteWorkspace, Solution solution, Dictionary<Checksum, object> map = null) 133var solution = workspace.CurrentSolution; 184var solution = workspace.CurrentSolution; 255var solution = workspace.CurrentSolution; 300var solution = workspace.CurrentSolution; 1462private static async Task<Solution> VerifyIncrementalUpdatesAsync( 1466Solution solution, 1471var remoteSolution = remoteWorkspace.CurrentSolution; 1510var currentRemoteSolution = remoteWorkspace.CurrentSolution; 1566private static void VerifyStates(Solution solution1, Solution solution2, string projectName, ImmutableArray<string> documentNames) 1602private static async Task VerifyAssetStorageAsync(InProcRemoteHostClient client, Solution solution) 1611private static Solution UpdateSolution(Solution solution, string projectName, string documentName, string csAddition, string vbAddition) 1628private static (Project project, Document document) GetProjectAndDocument(Solution solution, string projectName, string documentName) 1636private static (Project project, ImmutableArray<Document> documents) GetProjectAndDocuments(Solution solution, string projectName, ImmutableArray<string> documentNames) 1645private static async Task UpdatePrimaryWorkspace(RemoteHostClient client, Solution solution) 1653private static Solution Populate(Solution solution) 1718private static Solution AddProject(Solution solution, string language, string[] documents, string[] additionalDocuments, ProjectId[] p2pReferences)
Services\SolutionAssetCacheTests.cs (1)
74var solution = workspace.CurrentSolution;
Services\SolutionServiceTests.cs (53)
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) 249static Solution SetProjectProperties(Solution solution, int version) 265static void ValidateProperties(Solution solution, int version) 426var solution1 = workspace.CurrentSolution; 457static async Task<Solution> GetInitialOOPSolutionAsync(RemoteWorkspace remoteWorkspace, AssetProvider assetProvider, Solution solution) 467static async Task Verify(RemoteWorkspace remoteWorkspace, Solution givenSolution, Solution remoteSolution) 483var solution = workspace.CurrentSolution; 503var solution = workspace.CurrentSolution 517var frozenSolution1 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText1).Project.Solution; 526var frozenSolution2 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText2).Project.Solution; 542var solution = workspace.CurrentSolution; 583var solution = workspace.CurrentSolution; 624var solution = workspace.CurrentSolution; 657var solution = workspace.CurrentSolution; 698var solution = workspace.CurrentSolution; 738var solution = workspace.CurrentSolution; 778var solution = workspace.CurrentSolution; 811var solution = workspace.CurrentSolution; 866var solution = workspace.CurrentSolution; 912var solution = workspace.CurrentSolution; 935var solution = workspace.CurrentSolution; 980var solution = workspace.CurrentSolution; 999var solution = workspace.CurrentSolution; 1031var solution = workspace.CurrentSolution; 1053var solution = workspace.CurrentSolution; 1080var solution = workspace.CurrentSolution; 1109var solution = workspace.CurrentSolution; 1156var solution = workspace.CurrentSolution; 1211private static async Task VerifySolutionUpdate(string code, Func<Solution, Solution> newSolutionGetter) 1220Func<Solution, Solution> newSolutionGetter, 1221Action<Solution>? oldSolutionValidator = null, 1222Action<Solution>? newSolutionValidator = null) 1227Func<Solution, Solution> newSolutionGetter, 1228Action<Solution>? oldSolutionValidator, 1229Action<Solution>? oldRecoveredSolutionValidator, 1230Action<Solution>? newRecoveredSolutionValidator) 1232var solution = workspace.CurrentSolution; 1250var newSolution = newSolutionGetter(solution); 1268private static async Task<AssetProvider> GetAssetProviderAsync(Workspace workspace, RemoteWorkspace remoteWorkspace, Solution solution, Dictionary<Checksum, object>? map = null)