147 references to ApplyChangesKind
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
28if (service.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
50if (document != null && document.Project.Solution.Workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
84if (!solution.CanApplyChange(ApplyChangesKind.ChangeDocument) ||
Microsoft.CodeAnalysis.EditorFeatures (12)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
46workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (2)
96workspace.CanApplyChange(ApplyChangesKind.AddDocument) && 97workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
ExtractMethod\ExtractMethodCommandHandler.cs (1)
72!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) ||
Formatting\FormatCommandHandler.Paste.cs (1)
53!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
157this.Document.Project.Solution.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo))
InlineRename\CommandHandlers\AbstractRenameCommandHandler_RenameHandler.cs (1)
132workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
Interactive\InteractiveWorkspace.cs (2)
25public override bool CanApplyChange(ApplyChangesKind feature) 26=> feature == ApplyChangesKind.ChangeDocument;
NavigationBar\NavigationBarController_ModelComputation.cs (1)
135workspace.CanApplyChange(ApplyChangesKind.ChangeDocument),
Organizing\OrganizeDocumentCommandHandler.cs (1)
78if (!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Shared\Preview\PreviewWorkspace.cs (1)
34public override bool CanApplyChange(ApplyChangesKind feature)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\MefTestWorkspace.cs (1)
23public override bool CanApplyChange(ApplyChangesKind feature)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.cs (1)
91workspace.CanApplyChange(ApplyChangesKind.ChangeDocument);
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
IRazorDocumentOperationService.cs (1)
10/// document version of <see cref="Workspace.CanApplyChange(ApplyChangesKind)"/>
Microsoft.CodeAnalysis.Features (4)
GenerateType\AbstractGenerateTypeService.cs (1)
110if (document.Project.Solution.CanApplyChange(ApplyChangesKind.AddDocument))
SemanticSearch\SemanticSearchWorkspace.cs (2)
19public override bool CanApplyChange(ApplyChangesKind feature) 20=> feature == ApplyChangesKind.ChangeDocument;
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
28if (service.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo))
Microsoft.CodeAnalysis.Workspaces (54)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Workspace\AdhocWorkspace.cs (1)
26public override bool CanApplyChange(ApplyChangesKind feature)
Workspace\Host\DocumentService\IDocumentOperationService.cs (1)
16/// document version of <see cref="Workspace.CanApplyChange(ApplyChangesKind)"/>
Workspace\Host\ISupportedChangesService.cs (2)
18bool CanApplyChange(ApplyChangesKind kind); 41public bool CanApplyChange(ApplyChangesKind kind)
Workspace\Workspace.cs (49)
1506public virtual bool CanApplyChange(ApplyChangesKind feature) 1521/// will still throw if the solution contains changes that are not supported according to the <see cref="CanApplyChange(ApplyChangesKind)"/> 1525/// <see cref="CanApplyChange(ApplyChangesKind)"/> method.</exception> 1665if (!CanApplyChange(ApplyChangesKind.RemoveProject) && solutionChanges.GetRemovedProjects().Any()) 1670if (!CanApplyChange(ApplyChangesKind.AddProject) && solutionChanges.GetAddedProjects().Any()) 1675if (!CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference) && solutionChanges.GetAddedAnalyzerReferences().Any()) 1680if (!CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference) && solutionChanges.GetRemovedAnalyzerReferences().Any()) 1696if (!CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) && 1727if (!CanApplyChange(ApplyChangesKind.ChangeParseOptions) && 1734if (!CanApplyChange(ApplyChangesKind.AddDocument) && projectChanges.GetAddedDocuments().Any()) 1739if (!CanApplyChange(ApplyChangesKind.RemoveDocument) && projectChanges.GetRemovedDocuments().Any()) 1744if (!CanApplyChange(ApplyChangesKind.ChangeDocumentInfo) 1752if (!CanApplyChange(ApplyChangesKind.ChangeDocument) && changedDocumentIds.Length > 0) 1769if (!CanApplyChange(ApplyChangesKind.AddAdditionalDocument) && projectChanges.GetAddedAdditionalDocuments().Any()) 1774if (!CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument) && projectChanges.GetRemovedAdditionalDocuments().Any()) 1779if (!CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument) && projectChanges.GetChangedAdditionalDocuments().Any()) 1784if (!CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument) && projectChanges.GetAddedAnalyzerConfigDocuments().Any()) 1789if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument) && projectChanges.GetRemovedAnalyzerConfigDocuments().Any()) 1794if (!CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument) && projectChanges.GetChangedAnalyzerConfigDocuments().Any()) 1799if (!CanApplyChange(ApplyChangesKind.AddProjectReference) && projectChanges.GetAddedProjectReferences().Any()) 1804if (!CanApplyChange(ApplyChangesKind.RemoveProjectReference) && projectChanges.GetRemovedProjectReferences().Any()) 1809if (!CanApplyChange(ApplyChangesKind.AddMetadataReference) && projectChanges.GetAddedMetadataReferences().Any()) 1814if (!CanApplyChange(ApplyChangesKind.RemoveMetadataReference) && projectChanges.GetRemovedMetadataReferences().Any()) 1819if (!CanApplyChange(ApplyChangesKind.AddAnalyzerReference) && projectChanges.GetAddedAnalyzerReferences().Any()) 1824if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference) && projectChanges.GetRemovedAnalyzerReferences().Any()) 1834/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeCompilationOptions"/>. 1847/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeParseOptions"/>. 2066Debug.Assert(CanApplyChange(ApplyChangesKind.AddProject)); 2077Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProject)); 2092Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) || 2110Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeParseOptions) || 2123Debug.Assert(CanApplyChange(ApplyChangesKind.AddProjectReference)); 2134Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProjectReference)); 2145Debug.Assert(CanApplyChange(ApplyChangesKind.AddMetadataReference)); 2156Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveMetadataReference)); 2167Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerReference)); 2178Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference)); 2189Debug.Assert(CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference)); 2200Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference)); 2211Debug.Assert(CanApplyChange(ApplyChangesKind.AddDocument)); 2222Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveDocument)); 2233Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocument)); 2244Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)); 2255Debug.Assert(CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2266Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument)); 2277Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument)); 2288Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument)); 2299Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument)); 2310Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument));
Microsoft.CodeAnalysis.Workspaces.MSBuild (11)
MSBuild\MSBuildWorkspace.cs (11)
271public override bool CanApplyChange(ApplyChangesKind feature) 274ApplyChangesKind.ChangeDocument or 275ApplyChangesKind.AddDocument or 276ApplyChangesKind.RemoveDocument or 277ApplyChangesKind.AddMetadataReference or 278ApplyChangesKind.RemoveMetadataReference or 279ApplyChangesKind.AddProjectReference or 280ApplyChangesKind.RemoveProjectReference or 281ApplyChangesKind.AddAnalyzerReference or 282ApplyChangesKind.RemoveAnalyzerReference or 283ApplyChangesKind.ChangeAdditionalDocument;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2208Assert.False(workspace.CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2218Assert.False(workspace.CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (17)
Workspaces\TestWorkspace`1.cs (17)
330public override bool CanApplyChange(ApplyChangesKind feature) 334case ApplyChangesKind.AddDocument: 335case ApplyChangesKind.RemoveDocument: 338case ApplyChangesKind.AddAdditionalDocument: 339case ApplyChangesKind.RemoveAdditionalDocument: 340case ApplyChangesKind.AddAnalyzerConfigDocument: 341case ApplyChangesKind.RemoveAnalyzerConfigDocument: 342case ApplyChangesKind.AddAnalyzerReference: 343case ApplyChangesKind.RemoveAnalyzerReference: 344case ApplyChangesKind.AddSolutionAnalyzerReference: 345case ApplyChangesKind.RemoveSolutionAnalyzerReference: 348case ApplyChangesKind.ChangeDocument: 349case ApplyChangesKind.ChangeAdditionalDocument: 350case ApplyChangesKind.ChangeAnalyzerConfigDocument: 351case ApplyChangesKind.ChangeDocumentInfo: 354case ApplyChangesKind.AddProjectReference: 355case ApplyChangesKind.AddMetadataReference:
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\TryApplyChangesTests.cs (7)
20private readonly ImmutableArray<ApplyChangesKind> _allowedKinds; 24public CustomizedCanApplyWorkspace(params ApplyChangesKind[] allowedKinds) 29public CustomizedCanApplyWorkspace(ApplyChangesKind[] allowedKinds, 42public override bool CanApplyChange(ApplyChangesKind feature) 74allowedKinds: [ApplyChangesKind.ChangeCompilationOptions], 117allowedKinds: [ApplyChangesKind.ChangeParseOptions], 162using var workspace = new CustomizedCanApplyWorkspace(allowedKinds: ApplyChangesKind.AddAnalyzerConfigDocument);
WorkspaceTests\WorkspaceTests.cs (1)
124public override bool CanApplyChange(ApplyChangesKind feature)
Microsoft.VisualStudio.LanguageServices (26)
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
51var canAddDocument = solution.CanApplyChange(ApplyChangesKind.AddDocument);
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
46var canAddDocument = solution.CanApplyChange(ApplyChangesKind.AddDocument);
ProjectSystem\MiscellaneousFilesWorkspace.cs (2)
318public override bool CanApplyChange(ApplyChangesKind feature) 319=> feature == ApplyChangesKind.ChangeDocument;
ProjectSystem\VisualStudioWorkspaceImpl.cs (21)
408public override bool CanApplyChange(ApplyChangesKind feature) 412case ApplyChangesKind.AddDocument: 413case ApplyChangesKind.RemoveDocument: 414case ApplyChangesKind.ChangeDocument: 415case ApplyChangesKind.AddMetadataReference: 416case ApplyChangesKind.RemoveMetadataReference: 417case ApplyChangesKind.AddProjectReference: 418case ApplyChangesKind.RemoveProjectReference: 419case ApplyChangesKind.AddAnalyzerReference: 420case ApplyChangesKind.RemoveAnalyzerReference: 421case ApplyChangesKind.AddAdditionalDocument: 422case ApplyChangesKind.RemoveAdditionalDocument: 423case ApplyChangesKind.ChangeAdditionalDocument: 424case ApplyChangesKind.ChangeCompilationOptions: 425case ApplyChangesKind.ChangeParseOptions: 426case ApplyChangesKind.ChangeDocumentInfo: 427case ApplyChangesKind.AddAnalyzerConfigDocument: 428case ApplyChangesKind.RemoveAnalyzerConfigDocument: 429case ApplyChangesKind.ChangeAnalyzerConfigDocument: 430case ApplyChangesKind.AddSolutionAnalyzerReference: 431case ApplyChangesKind.RemoveSolutionAnalyzerReference:
Snippets\AbstractSnippetCommandHandler.cs (1)
244!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetCommandHandler.cs (1)
72!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Client\RemoteLanguageServiceWorkspace.cs (4)
430public override bool CanApplyChange(ApplyChangesKind feature) 434case ApplyChangesKind.ChangeDocument: 435case ApplyChangesKind.AddDocument: 436case ApplyChangesKind.RemoveDocument:
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (1)
45Public Overrides Function CanApplyChange(feature As ApplyChangesKind) As Boolean