167 references to SyntaxRemoveOptions
Microsoft.AspNetCore.App.CodeFixes (2)
Kestrel\ListenOnIPv6AnyFixer.cs (1)
57var adjustedArgumentList = invocationExpressionSyntax.ArgumentList.RemoveNode(invocationExpressionSyntax.ArgumentList.Arguments.First(), SyntaxRemoveOptions.KeepLeadingTrivia);
PublicPartialProgramClassFixer.cs (1)
44editor.RemoveNode(classDeclaration, SyntaxRemoveOptions.KeepExteriorTrivia);
Microsoft.AspNetCore.Components.Analyzers (1)
StateHasChangedCodeFixProvider.cs (1)
78var newRoot = root.RemoveNode(nodeToRemove, SyntaxRemoveOptions.KeepExteriorTrivia);
Microsoft.CodeAnalysis (4)
Syntax\SyntaxList.cs (1)
64protected internal override SyntaxNode RemoveNodesCore(IEnumerable<SyntaxNode> nodes, SyntaxRemoveOptions options)
Syntax\SyntaxNode.cs (1)
1636SyntaxRemoveOptions options);
Syntax\SyntaxNodeExtensions.cs (2)
276SyntaxRemoveOptions options) 292SyntaxRemoveOptions options)
Microsoft.CodeAnalysis.CodeStyle.Fixes (18)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
80var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
96editor.RemoveNode(fieldDeclaration, SyntaxRemoveOptions.KeepLeadingTrivia);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
73var options = SyntaxGenerator.DefaultRemoveOptions; 79options |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
647var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 656removeOptions = SyntaxRemoveOptions.KeepNoTrivia; 660removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 902var rootWithRemovedDeclaration = root.RemoveNode(newDecl, SyntaxGenerator.DefaultRemoveOptions | SyntaxRemoveOptions.KeepLeadingTrivia);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
224var syntaxRemoveOptions = CreateSyntaxRemoveOptions(fieldDocumentSyntaxFacts, nodeToRemove); 429private static SyntaxRemoveOptions CreateSyntaxRemoveOptions( 432var syntaxRemoveOptions = SyntaxGenerator.DefaultRemoveOptions; 435syntaxRemoveOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
93editor.RemoveNode(match.Node, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\UseConditionalExpressionHelpers.cs (4)
15public static SyntaxRemoveOptions GetRemoveOptions( 18var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 21removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 26removeOptions |= SyntaxRemoveOptions.KeepTrailingTrivia;
src\roslyn\src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
90editor.RemoveNode(match.Statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
Microsoft.CodeAnalysis.CSharp (28)
Syntax\CSharpSyntaxNode.cs (1)
503protected internal override SyntaxNode? RemoveNodesCore(IEnumerable<SyntaxNode> nodes, SyntaxRemoveOptions options)
Syntax\SyntaxNodeRemover.cs (27)
19SyntaxRemoveOptions options) 51private readonly SyntaxRemoveOptions _options; 58SyntaxRemoveOptions options) 295if ((_options & SyntaxRemoveOptions.KeepLeadingTrivia) != 0) 299else if ((_options & SyntaxRemoveOptions.KeepEndOfLine) != 0) 304if ((_options & (SyntaxRemoveOptions.KeepDirectives | SyntaxRemoveOptions.KeepUnbalancedDirectives)) != 0) 309if ((_options & SyntaxRemoveOptions.KeepTrailingTrivia) != 0) 313else if ((_options & SyntaxRemoveOptions.KeepEndOfLine) != 0) 318if ((_options & SyntaxRemoveOptions.AddElasticMarker) != 0) 327if ((_options & SyntaxRemoveOptions.KeepLeadingTrivia) != 0) 333else if ((_options & SyntaxRemoveOptions.KeepEndOfLine) != 0) 342if ((_options & (SyntaxRemoveOptions.KeepDirectives | SyntaxRemoveOptions.KeepUnbalancedDirectives)) != 0) 349if ((_options & SyntaxRemoveOptions.KeepTrailingTrivia) != 0) 353else if ((_options & SyntaxRemoveOptions.KeepEndOfLine) != 0) 358if ((_options & SyntaxRemoveOptions.AddElasticMarker) != 0) 367if ((_options & SyntaxRemoveOptions.KeepLeadingTrivia) != 0) 371else if ((_options & SyntaxRemoveOptions.KeepEndOfLine) != 0) 376if ((_options & (SyntaxRemoveOptions.KeepDirectives | SyntaxRemoveOptions.KeepUnbalancedDirectives)) != 0) 383if ((_options & SyntaxRemoveOptions.KeepTrailingTrivia) != 0) 389else if ((_options & SyntaxRemoveOptions.KeepEndOfLine) != 0) 398if ((_options & SyntaxRemoveOptions.AddElasticMarker) != 0) 408if ((_options & SyntaxRemoveOptions.KeepLeadingTrivia) != 0) 413if ((_options & SyntaxRemoveOptions.KeepTrailingTrivia) != 0) 440if ((_options & SyntaxRemoveOptions.KeepDirectives) != 0)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (24)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (4)
28private const SyntaxRemoveOptions RemovalOptions = 29SyntaxRemoveOptions.KeepExteriorTrivia | 30SyntaxRemoveOptions.KeepDirectives | 31SyntaxRemoveOptions.AddElasticMarker;
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
177: localDeclarationStatement, SyntaxRemoveOptions.KeepNoTrivia);
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
142editor.RemoveNode(localDeclarationStatement, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
89editor.RemoveNode(statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (4)
82var removalOptions = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker; 84removalOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseInferredMemberName\CSharpUseInferredMemberNameCodeFixProvider.cs (2)
19=> editor.RemoveNode(node, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLabeledJumpStatements\CSharpUseLabeledJumpStatementsCodeFixProvider.cs (3)
97editor.RemoveNode(labelDeclaration, SyntaxRemoveOptions.KeepUnbalancedDirectives); 173SyntaxRemoveOptions.KeepUnbalancedDirectives)!; 177editor.RemoveNode(declaration, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
73editor.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia); 125editor.RemoveNode(declarator, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
214SyntaxRemoveOptions GetConstructorRemovalOptions() 219var constructorRemoveOptions = GetRemoveOptions(constructorDeclaration); 232var memberRemoveOptions = GetRemoveOptions(priorMember); 549static SyntaxRemoveOptions GetRemoveOptions(MemberDeclarationSyntax memberDeclaration) 551? SyntaxRemoveOptions.KeepDirectives
Microsoft.CodeAnalysis.CSharp.Features (31)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
219editor.RemoveNode(localFunction, SyntaxRemoveOptions.KeepNoTrivia);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (4)
370? localDeclaration.RemoveNode(variableDeclarator, SyntaxRemoveOptions.KeepExteriorTrivia) 371: localDeclaration.RemoveNode(variableDeclarator, SyntaxRemoveOptions.KeepNoTrivia); 424return newScope.RemoveNode(globalStatement, SyntaxRemoveOptions.KeepNoTrivia); 427return newScope.RemoveNode(newLocalDeclaration, SyntaxRemoveOptions.KeepNoTrivia);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
183editor.RemoveNode(whenClause, SyntaxRemoveOptions.AddElasticMarker);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
117return root.RemoveNode(declarator, SyntaxRemoveOptions.KeepNoTrivia);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (4)
28private const SyntaxRemoveOptions RemovalOptions = 29SyntaxRemoveOptions.KeepExteriorTrivia | 30SyntaxRemoveOptions.KeepDirectives | 31SyntaxRemoveOptions.AddElasticMarker;
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
177: localDeclarationStatement, SyntaxRemoveOptions.KeepNoTrivia);
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
142editor.RemoveNode(localDeclarationStatement, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
89editor.RemoveNode(statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (4)
82var removalOptions = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker; 84removalOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseInferredMemberName\CSharpUseInferredMemberNameCodeFixProvider.cs (2)
19=> editor.RemoveNode(node, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLabeledJumpStatements\CSharpUseLabeledJumpStatementsCodeFixProvider.cs (3)
97editor.RemoveNode(labelDeclaration, SyntaxRemoveOptions.KeepUnbalancedDirectives); 173SyntaxRemoveOptions.KeepUnbalancedDirectives)!; 177editor.RemoveNode(declaration, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
73editor.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia); 125editor.RemoveNode(declarator, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
214SyntaxRemoveOptions GetConstructorRemovalOptions() 219var constructorRemoveOptions = GetRemoveOptions(constructorDeclaration); 232var memberRemoveOptions = GetRemoveOptions(priorMember); 549static SyntaxRemoveOptions GetRemoveOptions(MemberDeclarationSyntax memberDeclaration) 551? SyntaxRemoveOptions.KeepDirectives
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (7)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpDoNotInitializeUnnecessarily.Fixer.cs (1)
52newProp = newProp.RemoveNode(newProp.GetCurrentNode(node)!, SyntaxRemoveOptions.KeepExteriorTrivia)!;
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (1)
140propertyDeclaration = propertyDeclaration.WithAccessorList(propertyDeclaration.AccessorList.RemoveNode(oldInitAccessor, SyntaxRemoveOptions.KeepNoTrivia));
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (3)
320editor.RemoveNode(ifStatement.Else, SyntaxRemoveOptions.KeepNoTrivia); 327editor.RemoveNode(fix.DictionaryAddInvocation.Parent!, SyntaxRemoveOptions.KeepNoTrivia); 345editor.RemoveNode(fix.DictionaryAddInvocation.Parent!, SyntaxRemoveOptions.KeepNoTrivia);
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (2)
183parent = parent.RemoveNode(parent.GetCurrentNode(target)!, SyntaxRemoveOptions.KeepNoTrivia)! 192newParent = newParent.RemoveNode(newParent.GetCurrentNode(usingStatement)!, SyntaxRemoveOptions.KeepNoTrivia)!
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
3125public override SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options) 3146private SyntaxNode RemoveNodeInternal(SyntaxNode root, SyntaxNode declaration, SyntaxRemoveOptions options)
Microsoft.CodeAnalysis.Features (31)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (2)
143var newRoot = root.RemoveNodes(attributesToRemove, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
138documentEditor.RemoveNode(member, SyntaxRemoveOptions.KeepNoTrivia); 241documentEditor.RemoveNode(this.TypeDeclaration, SyntaxRemoveOptions.KeepUnbalancedDirectives);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
47editor.RemoveNode(this.TypeDeclaration, SyntaxRemoveOptions.KeepNoTrivia); 63editor.RemoveNode(nodeToRemove, SyntaxRemoveOptions.KeepNoTrivia);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
375SyntaxGenerator.DefaultRemoveOptions | SyntaxRemoveOptions.KeepLeadingTrivia);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
52root = root.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (5)
120var removeOptions = CreateSyntaxRemoveOptions(localDeclaration, blockFacts); 124private static SyntaxRemoveOptions CreateSyntaxRemoveOptions( 128var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 134removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 151removeOptions &= ~SyntaxRemoveOptions.AddElasticMarker;
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
80var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
96editor.RemoveNode(fieldDeclaration, SyntaxRemoveOptions.KeepLeadingTrivia);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
73var options = SyntaxGenerator.DefaultRemoveOptions; 79options |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
647var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 656removeOptions = SyntaxRemoveOptions.KeepNoTrivia; 660removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 902var rootWithRemovedDeclaration = root.RemoveNode(newDecl, SyntaxGenerator.DefaultRemoveOptions | SyntaxRemoveOptions.KeepLeadingTrivia);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
224var syntaxRemoveOptions = CreateSyntaxRemoveOptions(fieldDocumentSyntaxFacts, nodeToRemove); 429private static SyntaxRemoveOptions CreateSyntaxRemoveOptions( 432var syntaxRemoveOptions = SyntaxGenerator.DefaultRemoveOptions; 435syntaxRemoveOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
93editor.RemoveNode(match.Node, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\UseConditionalExpressionHelpers.cs (4)
15public static SyntaxRemoveOptions GetRemoveOptions( 18var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 21removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 26removeOptions |= SyntaxRemoveOptions.KeepTrailingTrivia;
src\roslyn\src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
90editor.RemoveNode(match.Statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
Microsoft.CodeAnalysis.NetAnalyzers (8)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumStorageShouldBeInt32.Fixer.cs (4)
42editor.RemoveNode(targetNode, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.KeepTrailingTrivia | SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.KeepEndOfLine);
Microsoft.NetCore.Analyzers\Performance\PreferHashDataOverComputeHash.Fixer.cs (3)
419SyntaxRemoveOptions option = 0; 422option |= SyntaxRemoveOptions.KeepLeadingTrivia; 427option |= SyntaxRemoveOptions.KeepTrailingTrivia;
Microsoft.NetCore.Analyzers\Usage\DoNotPassNonNullableValueToArgumentNullExceptionThrowIfNull.Fixer.cs (1)
91editor.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia);
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (4)
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (3)
249editor.RemoveNode(fix.DictionaryAddInvocation.Parent, SyntaxRemoveOptions.KeepNoTrivia) 256editor.RemoveNode(ifStatement.ElseBlock, SyntaxRemoveOptions.KeepNoTrivia) 258editor.RemoveNode(fix.DictionaryAddInvocation.Parent, SyntaxRemoveOptions.KeepNoTrivia)
Microsoft.NetCore.Analyzers\Performance\BasicPreferHashDataOverComputeHash.Fixer.vb (1)
82newParent = newParent.RemoveNode(newParent.GetCurrentNode(usingBlock), SyntaxRemoveOptions.KeepNoTrivia).WithAdditionalAnnotations(Formatter.Annotation)
Microsoft.CodeAnalysis.Workspaces (6)
Editing\SyntaxEditor.cs (2)
137public void RemoveNode(SyntaxNode node, SyntaxRemoveOptions options) 270private sealed class RemoveChange(SyntaxNode node, SyntaxRemoveOptions options) : Change(node)
Editing\SyntaxGenerator.cs (4)
35public static readonly SyntaxRemoveOptions DefaultRemoveOptions = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker; 1465public virtual SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options)
QuarantineTools.Tests (1)
QuarantineScriptTests.cs (1)
439updated = (CompilationUnitSyntax)root.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia)!;