2 overrides of TryApplyChanges
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildWorkspace.cs (1)
306public override bool TryApplyChanges(Solution newSolution)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace`1.cs (1)
775public override bool TryApplyChanges(Solution newSolution)
128 references to TryApplyChanges
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
72_workspace.TryApplyChanges(updatedSolution);
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
66Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
66Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
174if (!workspace.TryApplyChanges(solutionAndRenameSpan.Value.solution))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3540document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution);
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (2)
39Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 352Assert.True(workspace.TryApplyChanges(newSolution));
Microsoft.CodeAnalysis.EditorFeatures (11)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
165document.Project.Solution.Workspace.TryApplyChanges(updatedDocument.Project.Solution);
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
141if (workspace.TryApplyChanges(finalSolution))
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (1)
129if (workspace.TryApplyChanges(finalSolution))
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (1)
79if (!document.Project.Solution.Workspace.TryApplyChanges(result.UpdatedSolution))
InlineRename\InlineRenameSession.cs (1)
906if (!Workspace.TryApplyChanges(finalSolution))
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
236if (!workspace.TryApplyChanges(newSolution)) 276if (!workspace.TryApplyChanges(newSolution))
SemanticSearch\SemanticSearchEditorWorkspace.cs (1)
42/// Used by code actions through <see cref="Workspace.TryApplyChanges(Solution)"/>.
Shared\Extensions\WorkspaceExtensions.cs (2)
33workspace.TryApplyChanges(newSolution); 43workspace.TryApplyChanges(newSolution);
SpellCheck\RoslynSpellCheckFixerProvider.cs (1)
110if (!workspace.TryApplyChanges(replacements.NewSolution))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractCompletionProviderTests.cs (1)
650document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (18)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (10)
61workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 83workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 97workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 112workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 132workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 151workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 173var applied = workspace.TryApplyChanges(document.Project.Solution); 241workspace.TryApplyChanges(solution.WithAnalyzerReferences([analyzerReference])); 334Assert.True(workspace.TryApplyChanges(solution)); 383var applied = workspace.TryApplyChanges(project.Solution);
Preview\PreviewWorkspaceTests.cs (8)
56Assert.True(previewWorkspace.TryApplyChanges(project.Solution)); 59Assert.True(previewWorkspace.TryApplyChanges(newSolution)); 70Assert.True(previewWorkspace.TryApplyChanges(project.Solution)); 75Assert.True(previewWorkspace.TryApplyChanges(addedSolution)); 81Assert.True(previewWorkspace.TryApplyChanges(changedSolution)); 88Assert.True(previewWorkspace.TryApplyChanges(removedSolution)); 102Assert.True(previewWorkspace.TryApplyChanges(document.Project.Solution)); 134Assert.True(previewWorkspace.TryApplyChanges(project.Solution));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (1)
148workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(analyzeReferences))
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (1)
56return workspace.TryApplyChanges(newSolution);
Microsoft.CodeAnalysis.Workspaces (29)
Workspace\Solution\SolutionState.cs (1)
46/// <see cref="Workspace.TryApplyChanges(Solution)"/>.
Workspace\Workspace.cs (28)
35/// workspace's <see cref="TryApplyChanges(Solution)"/> method. 152/// after <see cref="TryApplyChanges(Solution)"/> is called. 1531/// Determines if the specific kind of change is supported by the <see cref="TryApplyChanges(Solution)"/> method. 1856/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1863/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1864/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1869/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed. 1876/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1877/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1882/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project 2085/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution. 2096/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution. 2107/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options. 2125/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options. 2142/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project. 2153/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project. 2164/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project. 2175/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project. 2186/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project. 2197/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project. 2208/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution. 2219/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution. 2230/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project. 2241/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project. 2274/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project. 2285/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project. 2307/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project. 2318/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
2901Assert.True(noEncodingSolution.Workspace.TryApplyChanges(noEncodingSolution));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
WorkspaceExtensions.cs (3)
20workspace.TryApplyChanges(newSolution); 28workspace.TryApplyChanges(newSolution); 35workspace.TryApplyChanges(newSolution);
Workspaces\TestWorkspace`1.cs (1)
777var result = base.TryApplyChanges(newSolution);
Microsoft.CodeAnalysis.Workspaces.UnitTests (34)
SolutionTests\SolutionTests.cs (10)
56Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 78Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 473workspace.TryApplyChanges(solution); 561workspace.TryApplyChanges(solution); 647workspace.TryApplyChanges(solution); 727workspace.TryApplyChanges(solution); 803workspace.TryApplyChanges(solution); 839Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 892workspace.TryApplyChanges(solution); 2304Assert.True(workspace.TryApplyChanges(solution3));
SolutionTests\TryApplyChangesTests.cs (7)
80Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 93Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 107() => workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("WrongThing")).Solution)); 123Assert.True(workspace.TryApplyChanges( 139workspace.TryApplyChanges( 154() => workspace.TryApplyChanges( 167Assert.True(workspace.TryApplyChanges(project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From("")).Project.Solution));
SymbolKeyTests.cs (2)
863workspace.TryApplyChanges(document.WithText(updated).Project.Solution); 910workspace.TryApplyChanges(document.WithText(updated).Project.Solution);
WorkspaceServiceTests\GlobalOptionServiceTests.cs (2)
81Assert.True(workspace1.TryApplyChanges(newSolution1)); 110Assert.True(workspace1.TryApplyChanges(newSolution1));
WorkspaceTests\AdhocWorkspaceTests.cs (7)
169var result = ws.TryApplyChanges(newSolution); 203var result = ws.TryApplyChanges(newSolution); 432Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 465Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 499Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 530Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 560Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution));
WorkspaceTests\WorkspaceTests.cs (6)
30Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 46Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 64Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 81Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 97Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 109Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(newSolution)).Message);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.VisualStudio.LanguageServices (9)
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
36Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (1)
39Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
51Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (1)
37Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
40Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (1)
37Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs (1)
37_workspace.TryApplyChanges(updatedSolution);
SyncNamespaces\SyncNamespacesCommandHandler.cs (1)
159_workspace.TryApplyChanges(newSolution);
Venus\ContainedLanguageCodeSupport.cs (1)
339if (!workspace.TryApplyChanges(newSolution))
Microsoft.VisualStudio.LanguageServices.CSharp (2)
SemanticSearch\SemanticSearchToolWindowImpl.cs (2)
459success = changedSolution != null && workspace.TryApplyChanges(changedSolution); 465success = workspace.TryApplyChanges(changedSolution);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
29Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
30Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution
PersistentStorage\AbstractPersistentStorageTests.cs (1)
995workspace.TryApplyChanges(solution);
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
54workspace.TryApplyChanges(newSolution);