226 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.CodeAnalysis (4)
Syntax\SyntaxList.cs (1)
64protected internal override SyntaxNode RemoveNodesCore(IEnumerable<SyntaxNode> nodes, SyntaxRemoveOptions options)
Syntax\SyntaxNode.cs (1)
1601SyntaxRemoveOptions options);
Syntax\SyntaxNodeExtensions.cs (2)
265SyntaxRemoveOptions options) 281SyntaxRemoveOptions options)
Microsoft.CodeAnalysis.CodeStyle.Fixes (18)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
80var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia);
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
97editor.RemoveNode(fieldDeclaration, SyntaxRemoveOptions.KeepLeadingTrivia);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
73var options = SyntaxGenerator.DefaultRemoveOptions; 79options |= SyntaxRemoveOptions.KeepLeadingTrivia;
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\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
242var syntaxRemoveOptions = CreateSyntaxRemoveOptions(fieldDocumentSyntaxFacts, nodeToRemove); 397private static SyntaxRemoveOptions CreateSyntaxRemoveOptions( 400var syntaxRemoveOptions = SyntaxGenerator.DefaultRemoveOptions; 403syntaxRemoveOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
93editor.RemoveNode(match.Node, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\UseConditionalExpressionHelpers.cs (4)
15public static SyntaxRemoveOptions GetRemoveOptions( 18var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 21removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 26removeOptions |= SyntaxRemoveOptions.KeepTrailingTrivia;
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 (21)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (4)
28private const SyntaxRemoveOptions RemovalOptions = 29SyntaxRemoveOptions.KeepExteriorTrivia | 30SyntaxRemoveOptions.KeepDirectives | 31SyntaxRemoveOptions.AddElasticMarker;
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
178: localDeclarationStatement, SyntaxRemoveOptions.KeepNoTrivia);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
145editor.RemoveNode(localDeclarationStatement, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
91editor.RemoveNode(statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (4)
82var removalOptions = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker; 84removalOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\Analyzers\CSharp\CodeFixes\UseInferredMemberName\CSharpUseInferredMemberNameCodeFixProvider.cs (2)
19=> editor.RemoveNode(node, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
74editor.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia); 126editor.RemoveNode(declarator, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
216SyntaxRemoveOptions GetConstructorRemovalOptions() 221var constructorRemoveOptions = GetRemoveOptions(constructorDeclaration); 234var memberRemoveOptions = GetRemoveOptions(priorMember); 551static SyntaxRemoveOptions GetRemoveOptions(MemberDeclarationSyntax memberDeclaration) 553? SyntaxRemoveOptions.KeepDirectives
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Formatting\CodeCleanupTests.TestFixers.cs (3)
38var newRoot = root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia); 107var newRoot = root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia); 157var newRoot = root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia);
Microsoft.CodeAnalysis.CSharp.Features (28)
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\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (4)
28private const SyntaxRemoveOptions RemovalOptions = 29SyntaxRemoveOptions.KeepExteriorTrivia | 30SyntaxRemoveOptions.KeepDirectives | 31SyntaxRemoveOptions.AddElasticMarker;
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
178: localDeclarationStatement, SyntaxRemoveOptions.KeepNoTrivia);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
145editor.RemoveNode(localDeclarationStatement, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
91editor.RemoveNode(statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (4)
82var removalOptions = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker; 84removalOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\Analyzers\CSharp\CodeFixes\UseInferredMemberName\CSharpUseInferredMemberNameCodeFixProvider.cs (2)
19=> editor.RemoveNode(node, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.AddElasticMarker);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
74editor.RemoveNode(statement, SyntaxRemoveOptions.KeepNoTrivia); 126editor.RemoveNode(declarator, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
216SyntaxRemoveOptions GetConstructorRemovalOptions() 221var constructorRemoveOptions = GetRemoveOptions(constructorDeclaration); 234var memberRemoveOptions = GetRemoveOptions(priorMember); 551static SyntaxRemoveOptions GetRemoveOptions(MemberDeclarationSyntax memberDeclaration) 553? SyntaxRemoveOptions.KeepDirectives
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (7)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpDoNotInitializeUnnecessarily.Fixer.cs (1)
54newProp = newProp.RemoveNode(newProp.GetCurrentNode(node)!, SyntaxRemoveOptions.KeepExteriorTrivia)!;
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (1)
136propertyDeclaration = propertyDeclaration.WithAccessorList(propertyDeclaration.AccessorList.RemoveNode(oldInitAccessor, SyntaxRemoveOptions.KeepNoTrivia));
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (3)
247editor.RemoveNode(ifStatement.Else, SyntaxRemoveOptions.KeepNoTrivia); 254editor.RemoveNode(dictionaryAddInvocation.Parent!, SyntaxRemoveOptions.KeepNoTrivia); 272editor.RemoveNode(dictionaryAddInvocation.Parent!, SyntaxRemoveOptions.KeepNoTrivia);
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (2)
182parent = parent.RemoveNode(parent.GetCurrentNode(target)!, SyntaxRemoveOptions.KeepNoTrivia)! 191newParent = newParent.RemoveNode(newParent.GetCurrentNode(usingStatement)!, SyntaxRemoveOptions.KeepNoTrivia)!
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (38)
Syntax\SyntaxNodeTests.cs (36)
2556var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2571var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2587var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2604var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2625var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2644var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2660var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2676var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2692var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2712var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2729var expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia); 2743var expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia); 2757var expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia); 2771var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2785var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2803var m2 = m.RemoveNode(m.Body, SyntaxRemoveOptions.KeepExteriorTrivia); 2836var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.KeepUnbalancedDirectives); 2871var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepUnbalancedDirectives); 2909var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepUnbalancedDirectives); 2949var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepDirectives); 2981var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 2998var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3014var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine | SyntaxRemoveOptions.KeepDirectives); 3031var cu2 = cu.RemoveNode(cu, SyntaxRemoveOptions.KeepEndOfLine); 3073var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3114var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3158var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3200var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepTrailingTrivia); 3242var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3282var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3325var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3366var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepLeadingTrivia); 3390var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine | SyntaxRemoveOptions.KeepDirectives);
Syntax\SyntaxRewriterTests.cs (2)
516var newRoot = root.RemoveNode(root.DescendantNodes().First(), SyntaxRemoveOptions.KeepDirectives); 652var newRoot = oldRoot.RemoveNode(xmlNode, SyntaxRemoveOptions.KeepDirectives);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
3121public override SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options) 3142private 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)
373SyntaxGenerator.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\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
80var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia);
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
97editor.RemoveNode(fieldDeclaration, SyntaxRemoveOptions.KeepLeadingTrivia);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
73var options = SyntaxGenerator.DefaultRemoveOptions; 79options |= SyntaxRemoveOptions.KeepLeadingTrivia;
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\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
242var syntaxRemoveOptions = CreateSyntaxRemoveOptions(fieldDocumentSyntaxFacts, nodeToRemove); 397private static SyntaxRemoveOptions CreateSyntaxRemoveOptions( 400var syntaxRemoveOptions = SyntaxGenerator.DefaultRemoveOptions; 403syntaxRemoveOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
93editor.RemoveNode(match.Node, SyntaxRemoveOptions.KeepUnbalancedDirectives);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\UseConditionalExpressionHelpers.cs (4)
15public static SyntaxRemoveOptions GetRemoveOptions( 18var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 21removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 26removeOptions |= SyntaxRemoveOptions.KeepTrailingTrivia;
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
90editor.RemoveNode(match.Statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
Microsoft.CodeAnalysis.VisualBasic (28)
Syntax\SyntaxNodeRemover.vb (27)
11Friend Shared Function RemoveNodes(Of TRoot As SyntaxNode)(root As TRoot, nodes As IEnumerable(Of SyntaxNode), options As SyntaxRemoveOptions) As TRoot 34Private ReadOnly _options As SyntaxRemoveOptions 39Public Sub New(nodes As SyntaxNode(), options As SyntaxRemoveOptions) 207If (Me._options And SyntaxRemoveOptions.KeepLeadingTrivia) <> 0 Then 209ElseIf (Me._options And SyntaxRemoveOptions.KeepEndOfLine) <> 0 AndAlso HasEndOfLine(node.GetLeadingTrivia()) Then 213If (Me._options And (SyntaxRemoveOptions.KeepDirectives Or SyntaxRemoveOptions.KeepUnbalancedDirectives)) <> 0 Then 217If (Me._options And SyntaxRemoveOptions.KeepTrailingTrivia) <> 0 Then 219ElseIf (Me._options And SyntaxRemoveOptions.KeepEndOfLine) <> 0 AndAlso HasEndOfLine(node.GetTrailingTrivia()) Then 223If (Me._options And SyntaxRemoveOptions.AddElasticMarker) <> 0 Then 229If (Me._options And SyntaxRemoveOptions.KeepLeadingTrivia) <> 0 Then 233ElseIf (Me._options And SyntaxRemoveOptions.KeepEndOfLine) <> 0 AndAlso 238If (Me._options And (SyntaxRemoveOptions.KeepDirectives Or SyntaxRemoveOptions.KeepUnbalancedDirectives)) <> 0 Then 244If (Me._options And SyntaxRemoveOptions.KeepTrailingTrivia) <> 0 Then 246ElseIf (Me._options And SyntaxRemoveOptions.KeepEndOfLine) <> 0 AndAlso HasEndOfLine(node.GetTrailingTrivia()) Then 250If (Me._options And SyntaxRemoveOptions.AddElasticMarker) <> 0 Then 256If (Me._options And SyntaxRemoveOptions.KeepLeadingTrivia) <> 0 Then 258ElseIf (Me._options And SyntaxRemoveOptions.KeepEndOfLine) <> 0 AndAlso HasEndOfLine(node.GetLeadingTrivia()) Then 262If (Me._options And (SyntaxRemoveOptions.KeepDirectives Or SyntaxRemoveOptions.KeepUnbalancedDirectives)) <> 0 Then 268If (Me._options And SyntaxRemoveOptions.KeepTrailingTrivia) <> 0 Then 272ElseIf (Me._options And SyntaxRemoveOptions.KeepEndOfLine) <> 0 AndAlso 277If (Me._options And SyntaxRemoveOptions.AddElasticMarker) <> 0 Then 284If (Me._options And SyntaxRemoveOptions.KeepLeadingTrivia) <> 0 Then 287If (Me._options And SyntaxRemoveOptions.KeepTrailingTrivia) <> 0 Then 306If (Me._options And SyntaxRemoveOptions.KeepDirectives) <> 0 Then
Syntax\VisualBasicSyntaxNode.vb (1)
400Protected Overrides Function RemoveNodesCore(nodes As IEnumerable(Of SyntaxNode), options As SyntaxRemoveOptions) As SyntaxNode
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (4)
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (3)
212editor.RemoveNode(dictionaryAddInvocation.Parent, SyntaxRemoveOptions.KeepNoTrivia) 219editor.RemoveNode(ifStatement.ElseBlock, SyntaxRemoveOptions.KeepNoTrivia) 221editor.RemoveNode(dictionaryAddInvocation.Parent, SyntaxRemoveOptions.KeepNoTrivia)
Microsoft.NetCore.Analyzers\Performance\BasicPreferHashDataOverComputeHash.Fixer.vb (1)
81newParent = 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)
Microsoft.DotNet.ApiDiff (1)
MemoryOutputDiffGenerator.cs (1)
583c => c is MemberDeclarationSyntax or BaseTypeDeclarationSyntax or DelegateDeclarationSyntax), SyntaxRemoveOptions.KeepNoTrivia)!;
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (4)
2761var newFieldDeclaration = fieldDeclaration.RemoveNode(node, SyntaxRemoveOptions.KeepNoTrivia); 2808var newAttributeList = attributeList.RemoveNode(node, SyntaxRemoveOptions.KeepNoTrivia); 2819var newArgumentList = argumentList.RemoveNode(node, SyntaxRemoveOptions.KeepNoTrivia); 2829var newParameterList = parameterList.RemoveNode(node, SyntaxRemoveOptions.KeepNoTrivia);
QuarantineTools.Tests (1)
QuarantineScriptTests.cs (1)
439updated = (CompilationUnitSyntax)root.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia)!;