48 references to Insert
Microsoft.CodeAnalysis (1)
Syntax\SyntaxList`1.cs (1)
223return this.Insert(this.Count, node);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
189return declarationList.Insert(index, declaration.WithLeadingTrivia(ElasticCarriageReturnLineFeed)); 192return declarationList.Insert(index, declaration);
Microsoft.CodeAnalysis.CSharp.Features (9)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
896return block.WithStatements(block.Statements.Insert(0, newStatement));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
329currentTypeDeclaration.Members.Insert(firstConstructorIndex, constructorDeclaration)); 344currentTypeDeclaration.Members.Insert(lastFieldOrProperty + 1, constructorDeclaration)); 349currentTypeDeclaration.Members.Insert(0, constructorDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
76var newRoot = newCompilationUnit.WithMembers(newCompilationUnit.Members.Insert(insertionIndex, newFieldDeclaration)); 182typeDeclaration.Members.Insert(index, memberDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (3)
335currentBlock.Statements.Insert(firstAffectedStatementIndex, declarationStatement)); 348currentCompilationUnit.Members.Insert(firstAffectedGlobalStatementIndex, GlobalStatement(declarationStatement))); 487return oldStatements.Insert(statementIndex, newStatement);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Syntax\SyntaxListTests.cs (10)
82newList = list.Insert(0, nodeD); 86newList = list.Insert(1, nodeD); 90newList = list.Insert(2, nodeD); 94newList = list.Insert(3, nodeD); 171Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, nodeD)); 172Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(list.Count + 1, nodeD)); 207newList = list.Insert(0, nodeD); 220Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(1, nodeD)); 221Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, nodeD)); 228Assert.Throws<ArgumentNullException>(() => list.Insert(0, null));
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
189return declarationList.Insert(index, declaration.WithLeadingTrivia(ElasticCarriageReturnLineFeed)); 192return declarationList.Insert(index, declaration);
Microsoft.VisualStudio.LanguageServices.CSharp (22)
CodeModel\CSharpCodeModelService.cs (22)
3220var newMembers = compilationUnit.Members.Insert(index, (MemberDeclarationSyntax)member); 3225var newMembers = namespaceDeclaration.Members.Insert(index, (MemberDeclarationSyntax)member); 3230var newMembers = typeDeclaration.Members.Insert(index, (MemberDeclarationSyntax)member); 3361var newAttributeLists = compilationUnit.AttributeLists.Insert(index, (AttributeListSyntax)list); 3366var newAttributeLists = enumDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3371var newAttributeLists = classDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3376var newAttributeLists = structDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3381var newAttributeLists = interfaceDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3386var newAttributeLists = method.AttributeLists.Insert(index, (AttributeListSyntax)list); 3391var newAttributeLists = operationDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3396var newAttributeLists = conversion.AttributeLists.Insert(index, (AttributeListSyntax)list); 3401var newAttributeLists = constructor.AttributeLists.Insert(index, (AttributeListSyntax)list); 3406var newAttributeLists = destructor.AttributeLists.Insert(index, (AttributeListSyntax)list); 3411var newAttributeLists = property.AttributeLists.Insert(index, (AttributeListSyntax)list); 3416var newAttributeLists = eventDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3421var newAttributeLists = indexer.AttributeLists.Insert(index, (AttributeListSyntax)list); 3426var newAttributeLists = field.AttributeLists.Insert(index, (AttributeListSyntax)list); 3431var newAttributeLists = eventFieldDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3436var newAttributeLists = delegateDeclaration.AttributeLists.Insert(index, (AttributeListSyntax)list); 3441var newAttributeLists = member.AttributeLists.Insert(index, (AttributeListSyntax)list); 3446var newAttributeLists = parameter.AttributeLists.Insert(index, (AttributeListSyntax)list); 3463var usingsList = compilationUnit.Usings.Insert(index, import);
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
189return declarationList.Insert(index, declaration.WithLeadingTrivia(ElasticCarriageReturnLineFeed)); 192return declarationList.Insert(index, declaration);