151 references to ApplyChangesKind
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
28if (service.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo))
SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
117if (document != null && workspace != null && workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
66if (!solution.CanApplyChange(ApplyChangesKind.ChangeDocument) ||
Microsoft.CodeAnalysis.EditorFeatures (12)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
54workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (2)
102workspace.CanApplyChange(ApplyChangesKind.AddDocument) && 103workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
ExtractMethod\ExtractMethodCommandHandler.cs (1)
83!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) ||
Formatting\FormatCommandHandler.Paste.cs (1)
58!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
162this.Document.Project.Solution.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo))
InlineRename\CommandHandlers\AbstractRenameCommandHandler_RenameHandler.cs (1)
127workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) &&
Interactive\InteractiveWorkspace.cs (2)
40public override bool CanApplyChange(ApplyChangesKind feature) 41=> feature == ApplyChangesKind.ChangeDocument;
NavigationBar\NavigationBarController_ModelComputation.cs (1)
75workspace.CanApplyChange(ApplyChangesKind.ChangeDocument),
Organizing\OrganizeDocumentCommandHandler.cs (1)
102if (!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Shared\Preview\PreviewWorkspace.cs (1)
40public override bool CanApplyChange(ApplyChangesKind feature)
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (2)
Snippets\AbstractSnippetCommandHandler.cs (1)
237if (!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Snippets\CSharpSnippets\SnippetCommandHandler.cs (1)
75if (!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (18)
Workspaces\MefTestWorkspace.cs (1)
28public override bool CanApplyChange(ApplyChangesKind feature)
Workspaces\TestWorkspace.cs (17)
288public override bool CanApplyChange(ApplyChangesKind feature) 292case ApplyChangesKind.AddDocument: 293case ApplyChangesKind.RemoveDocument: 296case ApplyChangesKind.AddAdditionalDocument: 297case ApplyChangesKind.RemoveAdditionalDocument: 298case ApplyChangesKind.AddAnalyzerConfigDocument: 299case ApplyChangesKind.RemoveAnalyzerConfigDocument: 300case ApplyChangesKind.AddAnalyzerReference: 301case ApplyChangesKind.RemoveAnalyzerReference: 302case ApplyChangesKind.AddSolutionAnalyzerReference: 303case ApplyChangesKind.RemoveSolutionAnalyzerReference: 306case ApplyChangesKind.ChangeDocument: 307case ApplyChangesKind.ChangeAdditionalDocument: 308case ApplyChangesKind.ChangeAnalyzerConfigDocument: 309case ApplyChangesKind.ChangeDocumentInfo: 312case ApplyChangesKind.AddProjectReference: 313case ApplyChangesKind.AddMetadataReference:
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.cs (1)
92workspace.CanApplyChange(ApplyChangesKind.ChangeDocument);
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
IRazorDocumentOperationService.cs (1)
10/// document version of <see cref="Workspace.CanApplyChange(ApplyChangesKind)"/>
Microsoft.CodeAnalysis.Features (4)
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
28if (service.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo))
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
221if (!solution.CanApplyChange(ApplyChangesKind.ChangeDocument))
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
38if (!solution.CanApplyChange(ApplyChangesKind.AddDocument))
GenerateType\AbstractGenerateTypeService.cs (1)
117if (document.Project.Solution.CanApplyChange(ApplyChangesKind.AddDocument))
Microsoft.CodeAnalysis.Workspaces (54)
SupportedChangesServiceExtensions.cs (1)
9public static bool CanApplyChange(this Solution solution, ApplyChangesKind kind)
Workspace\AdhocWorkspace.cs (1)
31public 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); 48public bool CanApplyChange(ApplyChangesKind kind)
Workspace\Workspace.cs (49)
1254public virtual bool CanApplyChange(ApplyChangesKind feature) 1269/// will still throw if the solution contains changes that are not supported according to the <see cref="CanApplyChange(ApplyChangesKind)"/> 1273/// <see cref="CanApplyChange(ApplyChangesKind)"/> method.</exception> 1372if (!CanApplyChange(ApplyChangesKind.RemoveProject) && solutionChanges.GetRemovedProjects().Any()) 1377if (!CanApplyChange(ApplyChangesKind.AddProject) && solutionChanges.GetAddedProjects().Any()) 1382if (!CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference) && solutionChanges.GetAddedAnalyzerReferences().Any()) 1387if (!CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference) && solutionChanges.GetRemovedAnalyzerReferences().Any()) 1403if (!CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) && 1434if (!CanApplyChange(ApplyChangesKind.ChangeParseOptions) && 1441if (!CanApplyChange(ApplyChangesKind.AddDocument) && projectChanges.GetAddedDocuments().Any()) 1446if (!CanApplyChange(ApplyChangesKind.RemoveDocument) && projectChanges.GetRemovedDocuments().Any()) 1451if (!CanApplyChange(ApplyChangesKind.ChangeDocumentInfo) 1459if (!CanApplyChange(ApplyChangesKind.ChangeDocument) && changedDocumentIds.Length > 0) 1476if (!CanApplyChange(ApplyChangesKind.AddAdditionalDocument) && projectChanges.GetAddedAdditionalDocuments().Any()) 1481if (!CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument) && projectChanges.GetRemovedAdditionalDocuments().Any()) 1486if (!CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument) && projectChanges.GetChangedAdditionalDocuments().Any()) 1491if (!CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument) && projectChanges.GetAddedAnalyzerConfigDocuments().Any()) 1496if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument) && projectChanges.GetRemovedAnalyzerConfigDocuments().Any()) 1501if (!CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument) && projectChanges.GetChangedAnalyzerConfigDocuments().Any()) 1506if (!CanApplyChange(ApplyChangesKind.AddProjectReference) && projectChanges.GetAddedProjectReferences().Any()) 1511if (!CanApplyChange(ApplyChangesKind.RemoveProjectReference) && projectChanges.GetRemovedProjectReferences().Any()) 1516if (!CanApplyChange(ApplyChangesKind.AddMetadataReference) && projectChanges.GetAddedMetadataReferences().Any()) 1521if (!CanApplyChange(ApplyChangesKind.RemoveMetadataReference) && projectChanges.GetRemovedMetadataReferences().Any()) 1526if (!CanApplyChange(ApplyChangesKind.AddAnalyzerReference) && projectChanges.GetAddedAnalyzerReferences().Any()) 1531if (!CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference) && projectChanges.GetRemovedAnalyzerReferences().Any()) 1541/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeCompilationOptions"/>. 1554/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="ApplyChangesKind.ChangeParseOptions"/>. 1792Debug.Assert(CanApplyChange(ApplyChangesKind.AddProject)); 1803Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProject)); 1818Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) || 1836Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeParseOptions) || 1849Debug.Assert(CanApplyChange(ApplyChangesKind.AddProjectReference)); 1860Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProjectReference)); 1871Debug.Assert(CanApplyChange(ApplyChangesKind.AddMetadataReference)); 1882Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveMetadataReference)); 1893Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerReference)); 1904Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference)); 1915Debug.Assert(CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference)); 1926Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference)); 1937Debug.Assert(CanApplyChange(ApplyChangesKind.AddDocument)); 1948Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveDocument)); 1959Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocument)); 1970Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)); 1981Debug.Assert(CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 1992Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument)); 2003Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument)); 2014Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument)); 2025Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument)); 2036Debug.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)
2191Assert.False(workspace.CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2201Assert.False(workspace.CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument));
Microsoft.CodeAnalysis.Workspaces.UnitTests (12)
SolutionTests\TryApplyChangesTests.cs (11)
20private readonly ImmutableArray<ApplyChangesKind> _allowedKinds; 24public CustomizedCanApplyWorkspace(params ApplyChangesKind[] allowedKinds) 29public CustomizedCanApplyWorkspace(ApplyChangesKind[] allowedKinds, 42public override bool CanApplyChange(ApplyChangesKind feature) 74allowedKinds: new[] { ApplyChangesKind.ChangeCompilationOptions }, 87allowedKinds: new ApplyChangesKind[] { }, 100allowedKinds: new ApplyChangesKind[] { }, 117allowedKinds: new[] { ApplyChangesKind.ChangeParseOptions }, 132allowedKinds: new ApplyChangesKind[] { }, 147allowedKinds: new ApplyChangesKind[] { }, 162using var workspace = new CustomizedCanApplyWorkspace(allowedKinds: ApplyChangesKind.AddAnalyzerConfigDocument);
WorkspaceTests\WorkspaceTests.cs (1)
127public override bool CanApplyChange(ApplyChangesKind feature)
Microsoft.VisualStudio.LanguageServices (24)
ProjectSystem\MiscellaneousFilesWorkspace.cs (2)
317public override bool CanApplyChange(ApplyChangesKind feature) 318=> feature == ApplyChangesKind.ChangeDocument;
ProjectSystem\VisualStudioWorkspaceImpl.cs (21)
416public override bool CanApplyChange(ApplyChangesKind feature) 420case ApplyChangesKind.AddDocument: 421case ApplyChangesKind.RemoveDocument: 422case ApplyChangesKind.ChangeDocument: 423case ApplyChangesKind.AddMetadataReference: 424case ApplyChangesKind.RemoveMetadataReference: 425case ApplyChangesKind.AddProjectReference: 426case ApplyChangesKind.RemoveProjectReference: 427case ApplyChangesKind.AddAnalyzerReference: 428case ApplyChangesKind.RemoveAnalyzerReference: 429case ApplyChangesKind.AddAdditionalDocument: 430case ApplyChangesKind.RemoveAdditionalDocument: 431case ApplyChangesKind.ChangeAdditionalDocument: 432case ApplyChangesKind.ChangeCompilationOptions: 433case ApplyChangesKind.ChangeParseOptions: 434case ApplyChangesKind.ChangeDocumentInfo: 435case ApplyChangesKind.AddAnalyzerConfigDocument: 436case ApplyChangesKind.RemoveAnalyzerConfigDocument: 437case ApplyChangesKind.ChangeAnalyzerConfigDocument: 438case ApplyChangesKind.AddSolutionAnalyzerReference: 439case ApplyChangesKind.RemoveSolutionAnalyzerReference:
Snippets\AbstractSnippetCommandHandler.cs (1)
265!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetCommandHandler.cs (1)
87!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Client\RemoteLanguageServiceWorkspace.cs (4)
446public override bool CanApplyChange(ApplyChangesKind feature) 450case ApplyChangesKind.ChangeDocument: 451case ApplyChangesKind.AddDocument: 452case ApplyChangesKind.RemoveDocument:
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (1)
44Public Overrides Function CanApplyChange(feature As ApplyChangesKind) As Boolean