244 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)
1599SyntaxRemoveOptions options);
Syntax\SyntaxNodeExtensions.cs (2)
265SyntaxRemoveOptions options) 281SyntaxRemoveOptions options)
Microsoft.CodeAnalysis.CodeStyle.Fixes (14)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
81var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia);
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
98editor.RemoveNode(fieldDeclaration, SyntaxRemoveOptions.KeepLeadingTrivia);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
75var options = SyntaxGenerator.DefaultRemoveOptions; 81options |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
647var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 656removeOptions = SyntaxRemoveOptions.KeepNoTrivia; 660removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 903var rootWithRemovedDeclaration = root.RemoveNode(newDecl, SyntaxGenerator.DefaultRemoveOptions | 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)
92editor.RemoveNode(match.Statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
Microsoft.CodeAnalysis.CSharp (28)
Syntax\CSharpSyntaxNode.cs (1)
505protected 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 (17)
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)
177: 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 (1)
216SyntaxRemoveOptions GetConstructorRemovalOptions()
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); 163var newRoot = root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia);
Microsoft.CodeAnalysis.CSharp.Features (24)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
222editor.RemoveNode(localFunction, SyntaxRemoveOptions.KeepNoTrivia);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (4)
301? localDeclaration.RemoveNode(variableDeclarator, SyntaxRemoveOptions.KeepExteriorTrivia) 302: localDeclaration.RemoveNode(variableDeclarator, SyntaxRemoveOptions.KeepNoTrivia); 355return newScope.RemoveNode(globalStatement, SyntaxRemoveOptions.KeepNoTrivia); 358return 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)
177: 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 (1)
216SyntaxRemoveOptions GetConstructorRemovalOptions()
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (38)
Syntax\SyntaxNodeTests.cs (36)
2482var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2497var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2513var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2530var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2551var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2570var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2586var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2602var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2618var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2638var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2655var expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia); 2669var expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia); 2683var expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia); 2697var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia); 2711var expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia); 2729var m2 = m.RemoveNode(m.Body, SyntaxRemoveOptions.KeepExteriorTrivia); 2762var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepExteriorTrivia | SyntaxRemoveOptions.KeepUnbalancedDirectives); 2797var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepUnbalancedDirectives); 2835var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepUnbalancedDirectives); 2875var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepDirectives); 2907var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 2924var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 2940var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine | SyntaxRemoveOptions.KeepDirectives); 2957var cu2 = cu.RemoveNode(cu, SyntaxRemoveOptions.KeepEndOfLine); 2999var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3040var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3084var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3126var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepTrailingTrivia); 3168var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3208var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3251var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepEndOfLine); 3292var cu2 = cu.RemoveNode(m, SyntaxRemoveOptions.KeepLeadingTrivia); 3316var 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)
2952public override SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options) 2973private SyntaxNode RemoveNodeInternal(SyntaxNode root, SyntaxNode declaration, SyntaxRemoveOptions options)
Microsoft.CodeAnalysis.Features (32)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (2)
143var newRoot = root.RemoveNodes(attributesToRemove, SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
137documentEditor.RemoveNode(member, SyntaxRemoveOptions.KeepNoTrivia); 243documentEditor.RemoveNode(State.TypeNode, SyntaxRemoveOptions.KeepUnbalancedDirectives);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
50editor.RemoveNode(typeToMove, SyntaxRemoveOptions.KeepNoTrivia); 66editor.RemoveNode(nodeToRemove, SyntaxRemoveOptions.KeepNoTrivia);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
211newRoot = root.RemoveNode(destinationNode, SyntaxRemoveOptions.KeepNoTrivia)!;
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
373SyntaxGenerator.DefaultRemoveOptions | SyntaxRemoveOptions.KeepLeadingTrivia);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
54root = root.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (5)
125var removeOptions = CreateSyntaxRemoveOptions(localDeclaration, blockFacts); 129private static SyntaxRemoveOptions CreateSyntaxRemoveOptions( 133var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 139removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 156removeOptions &= ~SyntaxRemoveOptions.AddElasticMarker;
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
81var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia);
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
98editor.RemoveNode(fieldDeclaration, SyntaxRemoveOptions.KeepLeadingTrivia);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
75var options = SyntaxGenerator.DefaultRemoveOptions; 81options |= SyntaxRemoveOptions.KeepLeadingTrivia;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
647var removeOptions = SyntaxGenerator.DefaultRemoveOptions; 656removeOptions = SyntaxRemoveOptions.KeepNoTrivia; 660removeOptions |= SyntaxRemoveOptions.KeepLeadingTrivia; 903var rootWithRemovedDeclaration = root.RemoveNode(newDecl, SyntaxGenerator.DefaultRemoveOptions | 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)
92editor.RemoveNode(match.Statement, SyntaxRemoveOptions.KeepUnbalancedDirectives);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
236var syntaxRemoveOptions = CreateSyntaxRemoveOptions(nodeToRemove); 309private static SyntaxRemoveOptions CreateSyntaxRemoveOptions(SyntaxNode nodeToRemove) 311var syntaxRemoveOptions = SyntaxGenerator.DefaultRemoveOptions; 316syntaxRemoveOptions |= SyntaxRemoveOptions.KeepLeadingTrivia;
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)
404Protected Overrides Function RemoveNodesCore(nodes As IEnumerable(Of SyntaxNode), options As SyntaxRemoveOptions) As SyntaxNode
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
41Return node.RemoveNodes(node.ImportsClauses.Where(AddressOf _unnecessaryImports.Contains), SyntaxRemoveOptions.KeepNoTrivia)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Analyzers\VisualBasic\CodeFixes\MakeMethodSynchronous\VisualBasicMakeMethodSynchronousCodeFixProvider.vb (1)
77subStatement = subStatement.RemoveNode(subStatement.AsClause, SyntaxRemoveOptions.KeepTrailingTrivia)
src\Analyzers\VisualBasic\CodeFixes\UseInferredMemberName\VisualBasicUseInferredMemberNameCodeFixProvider.vb (2)
25editor.RemoveNode(node, SyntaxRemoveOptions.KeepExteriorTrivia Or SyntaxRemoveOptions.AddElasticMarker)
Microsoft.CodeAnalysis.VisualBasic.Features (9)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (2)
262Return localDeclaration.RemoveNode(variableDeclarator, SyntaxRemoveOptions.KeepEndOfLine) 266Return localDeclaration.RemoveNode(modifiedIdentifier, SyntaxRemoveOptions.KeepEndOfLine)
CodeRefactorings\RemoveStatementCodeAction.vb (1)
31Dim updatedRoot = root.RemoveNode(_node, SyntaxRemoveOptions.KeepUnbalancedDirectives)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (1)
50result = result.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia)
IntroduceVariable\VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb (2)
44SyntaxRemoveOptions.KeepUnbalancedDirectives Or SyntaxRemoveOptions.AddElasticMarker)
src\Analyzers\VisualBasic\CodeFixes\MakeMethodSynchronous\VisualBasicMakeMethodSynchronousCodeFixProvider.vb (1)
77subStatement = subStatement.RemoveNode(subStatement.AsClause, SyntaxRemoveOptions.KeepTrailingTrivia)
src\Analyzers\VisualBasic\CodeFixes\UseInferredMemberName\VisualBasicUseInferredMemberNameCodeFixProvider.vb (2)
25editor.RemoveNode(node, SyntaxRemoveOptions.KeepExteriorTrivia Or SyntaxRemoveOptions.AddElasticMarker)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (17)
Syntax\SyntaxRewriterTests.vb (2)
500Dim newRoot = oldRoot.RemoveNode(xmlNode, SyntaxRemoveOptions.KeepDirectives) 686Dim newRoot = root.RemoveNode(root.DescendantNodes().First(), SyntaxRemoveOptions.KeepDirectives)
TestSyntaxNodes.vb (15)
2539Dim expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepExteriorTrivia) 2553Dim expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2567Dim expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia) 2581Dim expr2 = expr.RemoveNode(b, SyntaxRemoveOptions.KeepNoTrivia) 2594Dim expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2607Dim expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2620Dim expr2 = expr.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2643Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2668Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2693Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia) 2724Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepUnbalancedDirectives) 2753Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepUnbalancedDirectives) 2791Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepExteriorTrivia Or SyntaxRemoveOptions.KeepUnbalancedDirectives) 2833Dim cu2 = cu.RemoveNode(n, SyntaxRemoveOptions.KeepDirectives)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
3601Public Overrides Function RemoveNode(root As SyntaxNode, declaration As SyntaxNode, options As SyntaxRemoveOptions) As SyntaxNode 3609Private Shared Function RemoveNodeInternal(root As SyntaxNode, node As SyntaxNode, options As SyntaxRemoveOptions) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (1)
41Return node.RemoveNodes(node.ImportsClauses.Where(AddressOf _unnecessaryImports.Contains), SyntaxRemoveOptions.KeepNoTrivia)
Microsoft.CodeAnalysis.Workspaces (5)
Editing\SyntaxEditor.cs (1)
138public void RemoveNode(SyntaxNode node, SyntaxRemoveOptions options)
Editing\SyntaxGenerator.cs (4)
34public static readonly SyntaxRemoveOptions DefaultRemoveOptions = SyntaxRemoveOptions.KeepUnbalancedDirectives | SyntaxRemoveOptions.AddElasticMarker; 1408public virtual SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options)
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);
Microsoft.VisualStudio.LanguageServices.VisualBasic (10)
CodeModel\VisualBasicCodeModelService.vb (10)
1331Dim newDeclarator = declarator.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1344Dim newDeclaration = declaration.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1364Dim newAttributeList = attributeList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine) 1372Dim newArgumentList = argumentList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 1379Dim newParameterList = parameterList.RemoveNode(node, SyntaxRemoveOptions.KeepEndOfLine).WithAdditionalAnnotations(Formatter.Annotation) 3541parameter = parameter.RemoveNode(parameter.Default, SyntaxRemoveOptions.KeepNoTrivia) 3560variableDeclarator = variableDeclarator.RemoveNode(variableDeclarator.Initializer, SyntaxRemoveOptions.KeepExteriorTrivia) 3582enumMemberDeclaration = enumMemberDeclaration.RemoveNode(enumMemberDeclaration.Initializer, SyntaxRemoveOptions.KeepExteriorTrivia) 4301Dim newInheritsStatement = inheritsStatement.RemoveNode(inheritsType, SyntaxRemoveOptions.KeepEndOfLine) 4373Dim newImplementsStatement = implementsStatement.RemoveNode(inheritsType, SyntaxRemoveOptions.KeepEndOfLine)