152 references to ApplyChangesKind
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
28
if (service.CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
50
if (document != null && document.Project.Solution.Workspace.CanApplyChange(
ApplyChangesKind
.ChangeDocument))
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
81
if (!solution.CanApplyChange(
ApplyChangesKind
.ChangeDocument) ||
Microsoft.CodeAnalysis.EditorFeatures (12)
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
46
workspace.CanApplyChange(
ApplyChangesKind
.ChangeDocument) &&
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (2)
96
workspace.CanApplyChange(
ApplyChangesKind
.AddDocument) &&
97
workspace.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)
155
this.Document.Project.Solution.CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo))
InlineRename\CommandHandlers\AbstractRenameCommandHandler_RenameHandler.cs (1)
129
workspace.CanApplyChange(
ApplyChangesKind
.ChangeDocument) &&
Interactive\InteractiveWorkspace.cs (2)
24
public override bool CanApplyChange(
ApplyChangesKind
feature)
25
=> feature ==
ApplyChangesKind
.ChangeDocument;
NavigationBar\NavigationBarController_ModelComputation.cs (1)
135
workspace.CanApplyChange(
ApplyChangesKind
.ChangeDocument),
Organizing\OrganizeDocumentCommandHandler.cs (1)
77
if (!workspace.CanApplyChange(
ApplyChangesKind
.ChangeDocument))
Shared\Preview\PreviewWorkspace.cs (1)
60
public override bool CanApplyChange(
ApplyChangesKind
feature)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\MefTestWorkspace.cs (1)
23
public override bool CanApplyChange(
ApplyChangesKind
feature)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.cs (1)
91
workspace.CanApplyChange(
ApplyChangesKind
.ChangeDocument);
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
IRazorDocumentOperationService.cs (1)
10
/// document version of <see cref="Workspace.CanApplyChange(
ApplyChangesKind
)"/>
Microsoft.CodeAnalysis.Features (4)
GenerateType\AbstractGenerateTypeService.cs (1)
109
if (document.Project.Solution.CanApplyChange(
ApplyChangesKind
.AddDocument))
SemanticSearch\SemanticSearchWorkspace.cs (2)
26
public override bool CanApplyChange(
ApplyChangesKind
feature)
27
=> feature ==
ApplyChangesKind
.ChangeDocument;
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
28
if (service.CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo))
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Microsoft.CodeAnalysis.Workspaces (54)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Workspace\AdhocWorkspace.cs (1)
26
public override bool CanApplyChange(
ApplyChangesKind
feature)
Workspace\Host\DocumentService\IDocumentOperationService.cs (1)
14
/// document version of <see cref="Workspace.CanApplyChange(
ApplyChangesKind
)"/>
Workspace\Host\ISupportedChangesService.cs (2)
18
bool CanApplyChange(
ApplyChangesKind
kind);
41
public bool CanApplyChange(
ApplyChangesKind
kind)
Workspace\Workspace.cs (49)
1501
public virtual bool CanApplyChange(
ApplyChangesKind
feature)
1516
/// will still throw if the solution contains changes that are not supported according to the <see cref="CanApplyChange(
ApplyChangesKind
)"/>
1520
/// <see cref="CanApplyChange(
ApplyChangesKind
)"/> method.</exception>
1658
if (!CanApplyChange(
ApplyChangesKind
.RemoveProject) && solutionChanges.GetRemovedProjects().Any())
1663
if (!CanApplyChange(
ApplyChangesKind
.AddProject) && solutionChanges.GetAddedProjects().Any())
1668
if (!CanApplyChange(
ApplyChangesKind
.AddSolutionAnalyzerReference) && solutionChanges.GetAddedAnalyzerReferences().Any())
1673
if (!CanApplyChange(
ApplyChangesKind
.RemoveSolutionAnalyzerReference) && solutionChanges.GetRemovedAnalyzerReferences().Any())
1689
if (!CanApplyChange(
ApplyChangesKind
.ChangeCompilationOptions) &&
1720
if (!CanApplyChange(
ApplyChangesKind
.ChangeParseOptions) &&
1727
if (!CanApplyChange(
ApplyChangesKind
.AddDocument) && projectChanges.GetAddedDocuments().Any())
1732
if (!CanApplyChange(
ApplyChangesKind
.RemoveDocument) && projectChanges.GetRemovedDocuments().Any())
1737
if (!CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo)
1745
if (!CanApplyChange(
ApplyChangesKind
.ChangeDocument) && changedDocumentIds.Length > 0)
1762
if (!CanApplyChange(
ApplyChangesKind
.AddAdditionalDocument) && projectChanges.GetAddedAdditionalDocuments().Any())
1767
if (!CanApplyChange(
ApplyChangesKind
.RemoveAdditionalDocument) && projectChanges.GetRemovedAdditionalDocuments().Any())
1772
if (!CanApplyChange(
ApplyChangesKind
.ChangeAdditionalDocument) && projectChanges.GetChangedAdditionalDocuments().Any())
1777
if (!CanApplyChange(
ApplyChangesKind
.AddAnalyzerConfigDocument) && projectChanges.GetAddedAnalyzerConfigDocuments().Any())
1782
if (!CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerConfigDocument) && projectChanges.GetRemovedAnalyzerConfigDocuments().Any())
1787
if (!CanApplyChange(
ApplyChangesKind
.ChangeAnalyzerConfigDocument) && projectChanges.GetChangedAnalyzerConfigDocuments().Any())
1792
if (!CanApplyChange(
ApplyChangesKind
.AddProjectReference) && projectChanges.GetAddedProjectReferences().Any())
1797
if (!CanApplyChange(
ApplyChangesKind
.RemoveProjectReference) && projectChanges.GetRemovedProjectReferences().Any())
1802
if (!CanApplyChange(
ApplyChangesKind
.AddMetadataReference) && projectChanges.GetAddedMetadataReferences().Any())
1807
if (!CanApplyChange(
ApplyChangesKind
.RemoveMetadataReference) && projectChanges.GetRemovedMetadataReferences().Any())
1812
if (!CanApplyChange(
ApplyChangesKind
.AddAnalyzerReference) && projectChanges.GetAddedAnalyzerReferences().Any())
1817
if (!CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerReference) && projectChanges.GetRemovedAnalyzerReferences().Any())
1827
/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="
ApplyChangesKind
.ChangeCompilationOptions"/>.
1840
/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="
ApplyChangesKind
.ChangeParseOptions"/>.
2059
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddProject));
2070
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveProject));
2085
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeCompilationOptions) ||
2103
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeParseOptions) ||
2116
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddProjectReference));
2127
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveProjectReference));
2138
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddMetadataReference));
2149
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveMetadataReference));
2160
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddAnalyzerReference));
2171
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerReference));
2182
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddSolutionAnalyzerReference));
2193
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveSolutionAnalyzerReference));
2204
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddDocument));
2215
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveDocument));
2226
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeDocument));
2237
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo));
2248
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddAdditionalDocument));
2259
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveAdditionalDocument));
2270
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeAdditionalDocument));
2281
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddAnalyzerConfigDocument));
2292
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerConfigDocument));
2303
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeAnalyzerConfigDocument));
Microsoft.CodeAnalysis.Workspaces.MSBuild (11)
MSBuild\MSBuildWorkspace.cs (11)
271
public override bool CanApplyChange(
ApplyChangesKind
feature)
274
ApplyChangesKind
.ChangeDocument or
275
ApplyChangesKind
.AddDocument or
276
ApplyChangesKind
.RemoveDocument or
277
ApplyChangesKind
.AddMetadataReference or
278
ApplyChangesKind
.RemoveMetadataReference or
279
ApplyChangesKind
.AddProjectReference or
280
ApplyChangesKind
.RemoveProjectReference or
281
ApplyChangesKind
.AddAnalyzerReference or
282
ApplyChangesKind
.RemoveAnalyzerReference or
283
ApplyChangesKind
.ChangeAdditionalDocument;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2182
Assert.False(workspace.CanApplyChange(
ApplyChangesKind
.AddAdditionalDocument));
2192
Assert.False(workspace.CanApplyChange(
ApplyChangesKind
.RemoveAdditionalDocument));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (17)
Workspaces\TestWorkspace`1.cs (17)
334
public override bool CanApplyChange(
ApplyChangesKind
feature)
338
case
ApplyChangesKind
.AddDocument:
339
case
ApplyChangesKind
.RemoveDocument:
342
case
ApplyChangesKind
.AddAdditionalDocument:
343
case
ApplyChangesKind
.RemoveAdditionalDocument:
344
case
ApplyChangesKind
.AddAnalyzerConfigDocument:
345
case
ApplyChangesKind
.RemoveAnalyzerConfigDocument:
346
case
ApplyChangesKind
.AddAnalyzerReference:
347
case
ApplyChangesKind
.RemoveAnalyzerReference:
348
case
ApplyChangesKind
.AddSolutionAnalyzerReference:
349
case
ApplyChangesKind
.RemoveSolutionAnalyzerReference:
352
case
ApplyChangesKind
.ChangeDocument:
353
case
ApplyChangesKind
.ChangeAdditionalDocument:
354
case
ApplyChangesKind
.ChangeAnalyzerConfigDocument:
355
case
ApplyChangesKind
.ChangeDocumentInfo:
358
case
ApplyChangesKind
.AddProjectReference:
359
case
ApplyChangesKind
.AddMetadataReference:
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\TryApplyChangesTests.cs (7)
21
private readonly ImmutableArray<
ApplyChangesKind
> _allowedKinds;
25
public CustomizedCanApplyWorkspace(params
ApplyChangesKind
[] allowedKinds)
30
public CustomizedCanApplyWorkspace(
ApplyChangesKind
[] allowedKinds,
43
public override bool CanApplyChange(
ApplyChangesKind
feature)
75
allowedKinds: [
ApplyChangesKind
.ChangeCompilationOptions],
118
allowedKinds: [
ApplyChangesKind
.ChangeParseOptions],
163
using var workspace = new CustomizedCanApplyWorkspace(allowedKinds:
ApplyChangesKind
.AddAnalyzerConfigDocument);
WorkspaceTests\WorkspaceTests.cs (1)
124
public override bool CanApplyChange(
ApplyChangesKind
feature)
Microsoft.VisualStudio.LanguageServices (26)
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
51
var canAddDocument = solution.CanApplyChange(
ApplyChangesKind
.AddDocument);
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
47
var canAddDocument = solution.CanApplyChange(
ApplyChangesKind
.AddDocument);
ProjectSystem\MiscellaneousFilesWorkspace.cs (2)
322
public override bool CanApplyChange(
ApplyChangesKind
feature)
323
=> feature ==
ApplyChangesKind
.ChangeDocument;
ProjectSystem\VisualStudioWorkspaceImpl.cs (21)
354
public override bool CanApplyChange(
ApplyChangesKind
feature)
358
case
ApplyChangesKind
.AddDocument:
359
case
ApplyChangesKind
.RemoveDocument:
360
case
ApplyChangesKind
.ChangeDocument:
361
case
ApplyChangesKind
.AddMetadataReference:
362
case
ApplyChangesKind
.RemoveMetadataReference:
363
case
ApplyChangesKind
.AddProjectReference:
364
case
ApplyChangesKind
.RemoveProjectReference:
365
case
ApplyChangesKind
.AddAnalyzerReference:
366
case
ApplyChangesKind
.RemoveAnalyzerReference:
367
case
ApplyChangesKind
.AddAdditionalDocument:
368
case
ApplyChangesKind
.RemoveAdditionalDocument:
369
case
ApplyChangesKind
.ChangeAdditionalDocument:
370
case
ApplyChangesKind
.ChangeCompilationOptions:
371
case
ApplyChangesKind
.ChangeParseOptions:
372
case
ApplyChangesKind
.ChangeDocumentInfo:
373
case
ApplyChangesKind
.AddAnalyzerConfigDocument:
374
case
ApplyChangesKind
.RemoveAnalyzerConfigDocument:
375
case
ApplyChangesKind
.ChangeAnalyzerConfigDocument:
376
case
ApplyChangesKind
.AddSolutionAnalyzerReference:
377
case
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)
430
public override bool CanApplyChange(
ApplyChangesKind
feature)
434
case
ApplyChangesKind
.ChangeDocument:
435
case
ApplyChangesKind
.AddDocument:
436
case
ApplyChangesKind
.RemoveDocument:
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
9
public static bool CanApplyChange(this Solution solution,
ApplyChangesKind
kind)