153 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)
85
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)
130
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)
34
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)
1533
public virtual bool CanApplyChange(
ApplyChangesKind
feature)
1548
/// will still throw if the solution contains changes that are not supported according to the <see cref="CanApplyChange(
ApplyChangesKind
)"/>
1552
/// <see cref="CanApplyChange(
ApplyChangesKind
)"/> method.</exception>
1690
if (!CanApplyChange(
ApplyChangesKind
.RemoveProject) && solutionChanges.GetRemovedProjects().Any())
1695
if (!CanApplyChange(
ApplyChangesKind
.AddProject) && solutionChanges.GetAddedProjects().Any())
1700
if (!CanApplyChange(
ApplyChangesKind
.AddSolutionAnalyzerReference) && solutionChanges.GetAddedAnalyzerReferences().Any())
1705
if (!CanApplyChange(
ApplyChangesKind
.RemoveSolutionAnalyzerReference) && solutionChanges.GetRemovedAnalyzerReferences().Any())
1721
if (!CanApplyChange(
ApplyChangesKind
.ChangeCompilationOptions) &&
1752
if (!CanApplyChange(
ApplyChangesKind
.ChangeParseOptions) &&
1759
if (!CanApplyChange(
ApplyChangesKind
.AddDocument) && projectChanges.GetAddedDocuments().Any())
1764
if (!CanApplyChange(
ApplyChangesKind
.RemoveDocument) && projectChanges.GetRemovedDocuments().Any())
1769
if (!CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo)
1777
if (!CanApplyChange(
ApplyChangesKind
.ChangeDocument) && changedDocumentIds.Length > 0)
1794
if (!CanApplyChange(
ApplyChangesKind
.AddAdditionalDocument) && projectChanges.GetAddedAdditionalDocuments().Any())
1799
if (!CanApplyChange(
ApplyChangesKind
.RemoveAdditionalDocument) && projectChanges.GetRemovedAdditionalDocuments().Any())
1804
if (!CanApplyChange(
ApplyChangesKind
.ChangeAdditionalDocument) && projectChanges.GetChangedAdditionalDocuments().Any())
1809
if (!CanApplyChange(
ApplyChangesKind
.AddAnalyzerConfigDocument) && projectChanges.GetAddedAnalyzerConfigDocuments().Any())
1814
if (!CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerConfigDocument) && projectChanges.GetRemovedAnalyzerConfigDocuments().Any())
1819
if (!CanApplyChange(
ApplyChangesKind
.ChangeAnalyzerConfigDocument) && projectChanges.GetChangedAnalyzerConfigDocuments().Any())
1824
if (!CanApplyChange(
ApplyChangesKind
.AddProjectReference) && projectChanges.GetAddedProjectReferences().Any())
1829
if (!CanApplyChange(
ApplyChangesKind
.RemoveProjectReference) && projectChanges.GetRemovedProjectReferences().Any())
1834
if (!CanApplyChange(
ApplyChangesKind
.AddMetadataReference) && projectChanges.GetAddedMetadataReferences().Any())
1839
if (!CanApplyChange(
ApplyChangesKind
.RemoveMetadataReference) && projectChanges.GetRemovedMetadataReferences().Any())
1844
if (!CanApplyChange(
ApplyChangesKind
.AddAnalyzerReference) && projectChanges.GetAddedAnalyzerReferences().Any())
1849
if (!CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerReference) && projectChanges.GetRemovedAnalyzerReferences().Any())
1859
/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="
ApplyChangesKind
.ChangeCompilationOptions"/>.
1872
/// This method is only called if <see cref="CanApplyChange" /> returns false for <see cref="
ApplyChangesKind
.ChangeParseOptions"/>.
2091
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddProject));
2102
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveProject));
2117
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeCompilationOptions) ||
2135
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeParseOptions) ||
2148
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddProjectReference));
2159
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveProjectReference));
2170
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddMetadataReference));
2181
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveMetadataReference));
2192
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddAnalyzerReference));
2203
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerReference));
2214
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddSolutionAnalyzerReference));
2225
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveSolutionAnalyzerReference));
2236
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddDocument));
2247
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveDocument));
2258
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeDocument));
2269
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeDocumentInfo));
2280
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddAdditionalDocument));
2291
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveAdditionalDocument));
2302
Debug.Assert(CanApplyChange(
ApplyChangesKind
.ChangeAdditionalDocument));
2313
Debug.Assert(CanApplyChange(
ApplyChangesKind
.AddAnalyzerConfigDocument));
2324
Debug.Assert(CanApplyChange(
ApplyChangesKind
.RemoveAnalyzerConfigDocument));
2335
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)
2188
Assert.False(workspace.CanApplyChange(
ApplyChangesKind
.AddAdditionalDocument));
2198
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:
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (1)
41
Public Overrides Function CanApplyChange(feature As
ApplyChangesKind
) As Boolean
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)