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)
125workspace.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)
1461public virtual bool CanApplyChange(ApplyChangesKind feature) 1476/// will still throw if the solution contains changes that are not supported according to the <see cref="CanApplyChange(ApplyChangesKind)"/> 1480/// <see cref="CanApplyChange(ApplyChangesKind)"/> method.</exception> 1620if (!CanApplyChange(ApplyChangesKind.RemoveProject) && solutionChanges.GetRemovedProjects().Any()) 1625if (!CanApplyChange(ApplyChangesKind.AddProject) && solutionChanges.GetAddedProjects().Any()) 1630if (!CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference) && solutionChanges.GetAddedAnalyzerReferences().Any()) 1635if (!CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference) && solutionChanges.GetRemovedAnalyzerReferences().Any()) 1651if (!CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) && 1682if (!CanApplyChange(ApplyChangesKind.ChangeParseOptions) && 1689if (!CanApplyChange(ApplyChangesKind.AddDocument) && projectChanges.GetAddedDocuments().Any()) 1694if (!CanApplyChange(ApplyChangesKind.RemoveDocument) && projectChanges.GetRemovedDocuments().Any()) 1699if (!CanApplyChange(ApplyChangesKind.ChangeDocumentInfo) 1707if (!CanApplyChange(ApplyChangesKind.ChangeDocument) && changedDocumentIds.Length > 0) 1724if (!CanApplyChange(ApplyChangesKind.AddAdditionalDocument) && projectChanges.GetAddedAdditionalDocuments().Any()) 1729if (!CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument) && projectChanges.GetRemovedAdditionalDocuments().Any()) 1734if (!CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument) && projectChanges.GetChangedAdditionalDocuments().Any()) 1739if (!CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument) && projectChanges.GetAddedAnalyzerConfigDocuments().Any()) 1744if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument) && projectChanges.GetRemovedAnalyzerConfigDocuments().Any()) 1749if (!CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument) && projectChanges.GetChangedAnalyzerConfigDocuments().Any()) 1754if (!CanApplyChange(ApplyChangesKind.AddProjectReference) && projectChanges.GetAddedProjectReferences().Any()) 1759if (!CanApplyChange(ApplyChangesKind.RemoveProjectReference) && projectChanges.GetRemovedProjectReferences().Any()) 1764if (!CanApplyChange(ApplyChangesKind.AddMetadataReference) && projectChanges.GetAddedMetadataReferences().Any()) 1769if (!CanApplyChange(ApplyChangesKind.RemoveMetadataReference) && projectChanges.GetRemovedMetadataReferences().Any()) 1774if (!CanApplyChange(ApplyChangesKind.AddAnalyzerReference) && projectChanges.GetAddedAnalyzerReferences().Any()) 1779if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference) && projectChanges.GetRemovedAnalyzerReferences().Any()) 1789/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeCompilationOptions"/>. 1802/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeParseOptions"/>. 2030Debug.Assert(CanApplyChange(ApplyChangesKind.AddProject)); 2041Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProject)); 2056Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) || 2074Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeParseOptions) || 2087Debug.Assert(CanApplyChange(ApplyChangesKind.AddProjectReference)); 2098Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProjectReference)); 2109Debug.Assert(CanApplyChange(ApplyChangesKind.AddMetadataReference)); 2120Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveMetadataReference)); 2131Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerReference)); 2142Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference)); 2153Debug.Assert(CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference)); 2164Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference)); 2175Debug.Assert(CanApplyChange(ApplyChangesKind.AddDocument)); 2186Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveDocument)); 2197Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocument)); 2208Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)); 2219Debug.Assert(CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2230Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument)); 2241Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument)); 2252Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument)); 2263Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument)); 2274Debug.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