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)
771public override bool TryApplyChanges(Solution newSolution)
119 references to TryApplyChanges
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
71_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 (2)
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (2)
39Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution 368Assert.True(workspace.TryApplyChanges(newSolution));
Microsoft.CodeAnalysis.EditorFeatures (7)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
141if (workspace.TryApplyChanges(finalSolution))
InlineRename\InlineRenameSession.cs (1)
981if (!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);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractCompletionProviderTests.cs (1)
660document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (17)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (10)
60workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 82workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 96workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 111workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 131workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 150workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences([analyzerReference])); 174var applied = workspace.TryApplyChanges(document.Project.Solution); 242workspace.TryApplyChanges(solution.WithAnalyzerReferences([analyzerReference])); 336Assert.True(workspace.TryApplyChanges(solution)); 385var applied = workspace.TryApplyChanges(project.Solution);
Preview\PreviewWorkspaceTests.cs (7)
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));
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 (28)
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. 1858/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.CompilationOptions"/> is allowed. 1865/// <param name="newOptions">The new <see cref="CompilationOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1866/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1871/// Called during a call to <see cref="TryApplyChanges(Solution)"/> to determine if a specific change to <see cref="Project.ParseOptions"/> is allowed. 1878/// <param name="newOptions">The new <see cref="ParseOptions"/> of the project that was passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1879/// <param name="project">The project contained in the <see cref="Solution"/> passed to <see cref="TryApplyChanges(Solution)"/>.</param> 1884/// This method is called during <see cref="TryApplyChanges(Solution)"/> for each project 2087/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project to the current solution. 2098/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project from the current solution. 2109/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the compilation options. 2127/// This method is called during <see cref="TryApplyChanges(Solution)"/> to change the parse options. 2144/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a project reference to a project. 2155/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a project reference from a project. 2166/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a metadata reference to a project. 2177/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a metadata reference from a project. 2188/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to a project. 2199/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from a project. 2210/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add an analyzer reference to the solution. 2221/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer reference from the solution. 2232/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new document to a project. 2243/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove a document from a project. 2276/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new additional document to a project. 2287/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an additional document from a project. 2309/// This method is called during <see cref="TryApplyChanges(Solution)"/> to add a new analyzer config document to a project. 2320/// This method is called during <see cref="TryApplyChanges(Solution)"/> to remove an analyzer config document from a project.
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
2898Assert.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)
773var 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); 2301Assert.True(workspace.TryApplyChanges(solution3));
SolutionTests\TryApplyChangesTests.cs (7)
79Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 92Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 106() => workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("WrongThing")).Solution)); 122Assert.True(workspace.TryApplyChanges( 138workspace.TryApplyChanges( 153() => workspace.TryApplyChanges( 166Assert.True(workspace.TryApplyChanges(project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From("")).Project.Solution));
SymbolKeyTests.cs (2)
875workspace.TryApplyChanges(document.WithText(updated).Project.Solution); 922workspace.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)
160_workspace.TryApplyChanges(newSolution);
Venus\ContainedLanguageCodeSupport.cs (1)
339if (!workspace.TryApplyChanges(newSolution))
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
EditorConfigSettings\Aggregator\SettingsAggregatorTests.cs (1)
28Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
29Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution
PersistentStorage\AbstractPersistentStorageTests.cs (1)
997workspace.TryApplyChanges(solution);
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
54workspace.TryApplyChanges(newSolution);