146 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)
51workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (2)
96workspace.CanApplyChange(ApplyChangesKind.AddDocument) && 97workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
ExtractMethod\ExtractMethodCommandHandler.cs (1)
76!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) ||
Formatting\FormatCommandHandler.Paste.cs (1)
55!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 (5)
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
31if (!solution.CanApplyChange(ApplyChangesKind.AddDocument))
GenerateType\AbstractGenerateTypeService.cs (1)
114if (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)
1463public virtual bool CanApplyChange(ApplyChangesKind feature) 1478/// will still throw if the solution contains changes that are not supported according to the <see cref="CanApplyChange(ApplyChangesKind)"/> 1482/// <see cref="CanApplyChange(ApplyChangesKind)"/> method.</exception> 1622if (!CanApplyChange(ApplyChangesKind.RemoveProject) && solutionChanges.GetRemovedProjects().Any()) 1627if (!CanApplyChange(ApplyChangesKind.AddProject) && solutionChanges.GetAddedProjects().Any()) 1632if (!CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference) && solutionChanges.GetAddedAnalyzerReferences().Any()) 1637if (!CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference) && solutionChanges.GetRemovedAnalyzerReferences().Any()) 1653if (!CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) && 1684if (!CanApplyChange(ApplyChangesKind.ChangeParseOptions) && 1691if (!CanApplyChange(ApplyChangesKind.AddDocument) && projectChanges.GetAddedDocuments().Any()) 1696if (!CanApplyChange(ApplyChangesKind.RemoveDocument) && projectChanges.GetRemovedDocuments().Any()) 1701if (!CanApplyChange(ApplyChangesKind.ChangeDocumentInfo) 1709if (!CanApplyChange(ApplyChangesKind.ChangeDocument) && changedDocumentIds.Length > 0) 1726if (!CanApplyChange(ApplyChangesKind.AddAdditionalDocument) && projectChanges.GetAddedAdditionalDocuments().Any()) 1731if (!CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument) && projectChanges.GetRemovedAdditionalDocuments().Any()) 1736if (!CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument) && projectChanges.GetChangedAdditionalDocuments().Any()) 1741if (!CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument) && projectChanges.GetAddedAnalyzerConfigDocuments().Any()) 1746if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument) && projectChanges.GetRemovedAnalyzerConfigDocuments().Any()) 1751if (!CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument) && projectChanges.GetChangedAnalyzerConfigDocuments().Any()) 1756if (!CanApplyChange(ApplyChangesKind.AddProjectReference) && projectChanges.GetAddedProjectReferences().Any()) 1761if (!CanApplyChange(ApplyChangesKind.RemoveProjectReference) && projectChanges.GetRemovedProjectReferences().Any()) 1766if (!CanApplyChange(ApplyChangesKind.AddMetadataReference) && projectChanges.GetAddedMetadataReferences().Any()) 1771if (!CanApplyChange(ApplyChangesKind.RemoveMetadataReference) && projectChanges.GetRemovedMetadataReferences().Any()) 1776if (!CanApplyChange(ApplyChangesKind.AddAnalyzerReference) && projectChanges.GetAddedAnalyzerReferences().Any()) 1781if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference) && projectChanges.GetRemovedAnalyzerReferences().Any()) 1791/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeCompilationOptions"/>. 1804/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeParseOptions"/>. 2032Debug.Assert(CanApplyChange(ApplyChangesKind.AddProject)); 2043Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProject)); 2058Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) || 2076Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeParseOptions) || 2089Debug.Assert(CanApplyChange(ApplyChangesKind.AddProjectReference)); 2100Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProjectReference)); 2111Debug.Assert(CanApplyChange(ApplyChangesKind.AddMetadataReference)); 2122Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveMetadataReference)); 2133Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerReference)); 2144Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference)); 2155Debug.Assert(CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference)); 2166Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference)); 2177Debug.Assert(CanApplyChange(ApplyChangesKind.AddDocument)); 2188Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveDocument)); 2199Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocument)); 2210Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)); 2221Debug.Assert(CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2232Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument)); 2243Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument)); 2254Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument)); 2265Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument)); 2276Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument));
Microsoft.CodeAnalysis.Workspaces.MSBuild (11)
MSBuild\MSBuildWorkspace.cs (11)
269public override bool CanApplyChange(ApplyChangesKind feature) 272ApplyChangesKind.ChangeDocument or 273ApplyChangesKind.AddDocument or 274ApplyChangesKind.RemoveDocument or 275ApplyChangesKind.AddMetadataReference or 276ApplyChangesKind.RemoveMetadataReference or 277ApplyChangesKind.AddProjectReference or 278ApplyChangesKind.RemoveProjectReference or 279ApplyChangesKind.AddAnalyzerReference or 280ApplyChangesKind.RemoveAnalyzerReference or 281ApplyChangesKind.ChangeAdditionalDocument;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2203Assert.False(workspace.CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2213Assert.False(workspace.CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (17)
Workspaces\TestWorkspace`1.cs (17)
349public override bool CanApplyChange(ApplyChangesKind feature) 353case ApplyChangesKind.AddDocument: 354case ApplyChangesKind.RemoveDocument: 357case ApplyChangesKind.AddAdditionalDocument: 358case ApplyChangesKind.RemoveAdditionalDocument: 359case ApplyChangesKind.AddAnalyzerConfigDocument: 360case ApplyChangesKind.RemoveAnalyzerConfigDocument: 361case ApplyChangesKind.AddAnalyzerReference: 362case ApplyChangesKind.RemoveAnalyzerReference: 363case ApplyChangesKind.AddSolutionAnalyzerReference: 364case ApplyChangesKind.RemoveSolutionAnalyzerReference: 367case ApplyChangesKind.ChangeDocument: 368case ApplyChangesKind.ChangeAdditionalDocument: 369case ApplyChangesKind.ChangeAnalyzerConfigDocument: 370case ApplyChangesKind.ChangeDocumentInfo: 373case ApplyChangesKind.AddProjectReference: 374case 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 (24)
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