43 references to InsertRange
Microsoft.CodeAnalysis (2)
Syntax\SyntaxList`1.cs (2)
232return this.InsertRange(this.Count, nodes); 247return InsertRange(index, new[] { node });
Microsoft.CodeAnalysis.CSharp (2)
Syntax\SyntaxReplacer.cs (2)
476return list.InsertRange(index + 1, _newNodes.Cast<TNode>()); 479return list.InsertRange(index, _newNodes.Cast<TNode>());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
639.InsertRange(summaryIndex + 1, propertyParamComments));
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
211var newUsings = namespaceDeclarationWithBlankLine.Usings.InsertRange(0, usingsToAdd);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
513return Cast<TDeclarationNode>(compilationUnit.WithMembers(compilationUnit.Members.InsertRange(insertionIndex, wrappedStatements))); 556newBlock = newBlock.WithStatements(newBlock.Statements.InsertRange(index, newStatements)); 560newBlock = block.WithStatements(block.Statements.InsertRange(index + 1, newStatements));
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
639.InsertRange(summaryIndex + 1, propertyParamComments));
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
211var newUsings = namespaceDeclarationWithBlankLine.Usings.InsertRange(0, usingsToAdd);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
Syntax\SyntaxListTests.cs (11)
98newList = list.InsertRange(0, new[] { nodeD, nodeE }); 102newList = list.InsertRange(1, new[] { nodeD, nodeE }); 106newList = list.InsertRange(2, new[] { nodeD, nodeE }); 110newList = list.InsertRange(3, new[] { nodeD, nodeE }); 173Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(-1, new[] { nodeD })); 174Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(list.Count + 1, new[] { nodeD })); 180Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxNode>)null)); 211newList = list.InsertRange(0, new[] { nodeD, nodeE }); 222Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(1, new[] { nodeD })); 223Assert.Throws<ArgumentOutOfRangeException>(() => list.InsertRange(-1, new[] { nodeD })); 229Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxNode>)null));
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CodeGeneration\CSharpSyntaxGenerator.cs (4)
1257CompilationUnitSyntax cu => cu.WithUsings(cu.Usings.InsertRange(index, usingsToInsert)), 1258BaseNamespaceDeclarationSyntax nd => nd.WithUsings(nd.Usings.InsertRange(index, usingsToInsert)), 2331var newSections = statement.Sections.InsertRange(index, switchSections.Cast<SwitchSectionSyntax>()); 2696var newList = currentList.WithAccessors(currentList.Accessors.InsertRange(index, newAccessors.Accessors));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
513return Cast<TDeclarationNode>(compilationUnit.WithMembers(compilationUnit.Members.InsertRange(insertionIndex, wrappedStatements))); 556newBlock = newBlock.WithStatements(newBlock.Statements.InsertRange(index, newStatements)); 560newBlock = block.WithStatements(block.Statements.InsertRange(index + 1, newStatements));
Microsoft.CodeAnalysis.VisualBasic (2)
Syntax\SyntaxReplacer.vb (2)
330Return list.InsertRange(index, Me._replacementNodes.Cast(Of TNode)) 332Return list.InsertRange(index + 1, Me._replacementNodes.Cast(Of TNode))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (9)
Syntax\SyntaxListTests.vb (9)
60newList = list.InsertRange(0, {nodeD, nodeE}) 64newList = list.InsertRange(1, {nodeD, nodeE}) 68newList = list.InsertRange(2, {nodeD, nodeE}) 72newList = list.InsertRange(3, {nodeD, nodeE}) 135Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.InsertRange(-1, {nodeD})) 136Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.InsertRange(list.Count + 1, {nodeD})) 172newList = list.InsertRange(0, {nodeD, nodeE}) 183Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.InsertRange(1, {nodeD})) 184Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.InsertRange(-1, {nodeD}))
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
513return Cast<TDeclarationNode>(compilationUnit.WithMembers(compilationUnit.Members.InsertRange(insertionIndex, wrappedStatements))); 556newBlock = newBlock.WithStatements(newBlock.Statements.InsertRange(index, newStatements)); 560newBlock = block.WithStatements(block.Statements.InsertRange(index + 1, newStatements));