83 references to Insert
Microsoft.CodeAnalysis (1)
Syntax\SyntaxList`1.cs (1)
222return this.Insert(this.Count, node);
Microsoft.CodeAnalysis.CSharp.Features (8)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
898return block.WithStatements(block.Statements.Insert(0, newStatement));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
321currentTypeDeclaration.Members.Insert(firstConstructorIndex, constructorDeclaration)); 336currentTypeDeclaration.Members.Insert(lastFieldOrProperty + 1, constructorDeclaration)); 341currentTypeDeclaration.Members.Insert(0, constructorDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
182typeDeclaration.Members.Insert(index, memberDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (3)
317currentBlock.Statements.Insert(firstAffectedStatementIndex, declarationStatement)); 330currentCompilationUnit.Members.Insert(firstAffectedGlobalStatementIndex, GlobalStatement(declarationStatement))); 470return oldStatements.Insert(statementIndex, newStatement);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxListTests.cs (4)
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.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\InitializeParameterHelpers.vb (1)
57Dim newStatements = GetStatements(functionDeclaration).Insert(0, statement)
Microsoft.CodeAnalysis.VisualBasic.Features (2)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
253typeDeclaration.Members.Insert(index, memberDeclaration))
SplitOrMergeIfStatements\VisualBasicIfLikeStatementGenerator.vb (1)
186Dim newIfBlock = ifBlock.WithElseIfBlocks(ifBlock.ElseIfBlocks.Insert(0, elseIfBlockToInsert))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (11)
Syntax\SyntaxListTests.vb (11)
43newList = list.Insert(0, nodeD) 47newList = list.Insert(1, nodeD) 51newList = list.Insert(2, nodeD) 55newList = list.Insert(3, nodeD) 132Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(-1, nodeD)) 133Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(list.Count + 1, nodeD)) 142Assert.Throws(Of ArgumentNullException)(Function() list.Insert(0, Nothing)) 167newList = list.Insert(0, nodeD) 180Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(1, nodeD)) 181Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(-1, nodeD)) 188Assert.Throws(Of ArgumentNullException)(Function() list.Insert(0, Nothing))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
222Dim elseIfBlocks = mifBlock.ElseIfBlocks.Insert(0, 1205stats = stats.Insert(0, baseCall)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\InitializeParameterHelpers.vb (1)
57Dim newStatements = GetStatements(functionDeclaration).Insert(0, statement)
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);
Microsoft.VisualStudio.LanguageServices.VisualBasic (31)
CodeModel\VisualBasicCodeModelService.vb (31)
3744Return compilationUnit.WithMembers(compilationUnit.Members.Insert(index, declarationStatement)) 3748Return namespaceBlock.WithMembers(namespaceBlock.Members.Insert(index, declarationStatement)) 3752Return classBlock.WithMembers(classBlock.Members.Insert(index, declarationStatement)) 3756Return interfaceBlock.WithMembers(interfaceBlock.Members.Insert(index, declarationStatement)) 3760Return structureBlock.WithMembers(structureBlock.Members.Insert(index, declarationStatement)) 3764Return moduleBlock.WithMembers(moduleBlock.Members.Insert(index, declarationStatement)) 3768Return enumBlock.WithMembers(enumBlock.Members.Insert(index, declarationStatement)) 3799Return attributes.Insert(index, attribute) 3804Return attributes.Insert(index, attribute) 3808Return attributes.Insert(index, attribute) 3840Dim attributeLists = moduleBlock.ModuleStatement.AttributeLists.Insert(index, attributeList) 3844Dim attributeLists = structureBlock.StructureStatement.AttributeLists.Insert(index, attributeList) 3848Dim attributeLists = interfaceBlock.InterfaceStatement.AttributeLists.Insert(index, attributeList) 3852Dim attributeLists = classBlock.ClassStatement.AttributeLists.Insert(index, attributeList) 3857Dim attributeLists = enumBlock.EnumStatement.AttributeLists.Insert(index, attributeList) 3861Dim attributeLists = enumMember.AttributeLists.Insert(index, attributeList) 3865Dim attributeLists = delegateStatement.AttributeLists.Insert(index, attributeList) 3869Dim attributeLists = declareStatement.AttributeLists.Insert(index, attributeList) 3873Dim attributeLists = methodStatement.AttributeLists.Insert(index, attributeList) 3879Dim attributeLists = constructor.AttributeLists.Insert(index, attributeList) 3883Dim attributeLists = operatorStatement.AttributeLists.Insert(index, attributeList) 3887Dim attributeLists = methodStatement.AttributeLists.Insert(index, attributeList) 3892Dim attributeLists = propertyStatement.AttributeLists.Insert(index, attributeList) 3896Dim attributeLists = propertyBlock.PropertyStatement.AttributeLists.Insert(index, attributeList) 3900Dim attributeLists = eventStatement.AttributeLists.Insert(index, attributeList) 3904Dim attributeLists = eventBlock.EventStatement.AttributeLists.Insert(index, attributeList) 3908Dim attributeLists = field.AttributeLists.Insert(index, attributeList) 3912Dim attributeLists = parameter.AttributeLists.Insert(index, attributeList) 3932Dim importsList = compilationUnit.Imports.Insert(index, importsStatement) 4276Dim inheritsStatements = typeBlock.Inherits.Insert(0, inheritsStatement) 4348Dim implementsStatements = typeBlock.Implements.Insert(insertionIndex, implementsStatement)