89 references to Insert
Microsoft.CodeAnalysis (1)
Syntax\SyntaxList`1.cs (1)
223
return this.
Insert
(this.Count, node);
Microsoft.CodeAnalysis.CSharp.Features (8)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
897
return block.WithStatements(block.Statements.
Insert
(0, newStatement));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
326
currentTypeDeclaration.Members.
Insert
(firstConstructorIndex, constructorDeclaration));
341
currentTypeDeclaration.Members.
Insert
(lastFieldOrProperty + 1, constructorDeclaration));
346
currentTypeDeclaration.Members.
Insert
(0, constructorDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
182
typeDeclaration.Members.
Insert
(index, memberDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (3)
335
currentBlock.Statements.
Insert
(firstAffectedStatementIndex, declarationStatement));
348
currentCompilationUnit.Members.
Insert
(firstAffectedGlobalStatementIndex, GlobalStatement(declarationStatement)));
487
return oldStatements.
Insert
(statementIndex, newStatement);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Syntax\SyntaxListTests.cs (10)
82
newList = list.
Insert
(0, nodeD);
86
newList = list.
Insert
(1, nodeD);
90
newList = list.
Insert
(2, nodeD);
94
newList = list.
Insert
(3, nodeD);
171
Assert.Throws<ArgumentOutOfRangeException>(() => list.
Insert
(-1, nodeD));
172
Assert.Throws<ArgumentOutOfRangeException>(() => list.
Insert
(list.Count + 1, nodeD));
207
newList = list.
Insert
(0, nodeD);
220
Assert.Throws<ArgumentOutOfRangeException>(() => list.
Insert
(1, nodeD));
221
Assert.Throws<ArgumentOutOfRangeException>(() => list.
Insert
(-1, nodeD));
228
Assert.Throws<ArgumentNullException>(() => list.
Insert
(0, null));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\InitializeParameterHelpers.vb (1)
57
Dim newStatements = GetStatements(functionDeclaration).
Insert
(0, statement)
Microsoft.CodeAnalysis.VisualBasic.Features (2)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
253
typeDeclaration.Members.
Insert
(index, memberDeclaration))
SplitOrMergeIfStatements\VisualBasicIfLikeStatementGenerator.vb (1)
186
Dim newIfBlock = ifBlock.WithElseIfBlocks(ifBlock.ElseIfBlocks.
Insert
(0, elseIfBlockToInsert))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (11)
Syntax\SyntaxListTests.vb (11)
43
newList = list.
Insert
(0, nodeD)
47
newList = list.
Insert
(1, nodeD)
51
newList = list.
Insert
(2, nodeD)
55
newList = list.
Insert
(3, nodeD)
132
Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.
Insert
(-1, nodeD))
133
Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.
Insert
(list.Count + 1, nodeD))
142
Assert.Throws(Of ArgumentNullException)(Function() list.
Insert
(0, Nothing))
167
newList = list.
Insert
(0, nodeD)
180
Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.
Insert
(1, nodeD))
181
Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.
Insert
(-1, nodeD))
188
Assert.Throws(Of ArgumentNullException)(Function() list.
Insert
(0, Nothing))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
199
Dim elseIfBlocks = mifBlock.ElseIfBlocks.
Insert
(0,
1160
stats = stats.
Insert
(0, baseCall)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\InitializeParameterHelpers.vb (1)
57
Dim newStatements = GetStatements(functionDeclaration).
Insert
(0, statement)
Microsoft.VisualStudio.LanguageServices.CSharp (22)
CodeModel\CSharpCodeModelService.cs (22)
3220
var newMembers = compilationUnit.Members.
Insert
(index, (MemberDeclarationSyntax)member);
3225
var newMembers = namespaceDeclaration.Members.
Insert
(index, (MemberDeclarationSyntax)member);
3230
var newMembers = typeDeclaration.Members.
Insert
(index, (MemberDeclarationSyntax)member);
3361
var newAttributeLists = compilationUnit.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3366
var newAttributeLists = enumDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3371
var newAttributeLists = classDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3376
var newAttributeLists = structDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3381
var newAttributeLists = interfaceDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3386
var newAttributeLists = method.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3391
var newAttributeLists = operationDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3396
var newAttributeLists = conversion.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3401
var newAttributeLists = constructor.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3406
var newAttributeLists = destructor.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3411
var newAttributeLists = property.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3416
var newAttributeLists = eventDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3421
var newAttributeLists = indexer.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3426
var newAttributeLists = field.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3431
var newAttributeLists = eventFieldDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3436
var newAttributeLists = delegateDeclaration.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3441
var newAttributeLists = member.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3446
var newAttributeLists = parameter.AttributeLists.
Insert
(index, (AttributeListSyntax)list);
3463
var usingsList = compilationUnit.Usings.
Insert
(index, import);
Microsoft.VisualStudio.LanguageServices.VisualBasic (31)
CodeModel\VisualBasicCodeModelService.vb (31)
3745
Return compilationUnit.WithMembers(compilationUnit.Members.
Insert
(index, declarationStatement))
3749
Return namespaceBlock.WithMembers(namespaceBlock.Members.
Insert
(index, declarationStatement))
3753
Return classBlock.WithMembers(classBlock.Members.
Insert
(index, declarationStatement))
3757
Return interfaceBlock.WithMembers(interfaceBlock.Members.
Insert
(index, declarationStatement))
3761
Return structureBlock.WithMembers(structureBlock.Members.
Insert
(index, declarationStatement))
3765
Return moduleBlock.WithMembers(moduleBlock.Members.
Insert
(index, declarationStatement))
3769
Return enumBlock.WithMembers(enumBlock.Members.
Insert
(index, declarationStatement))
3800
Return attributes.
Insert
(index, attribute)
3805
Return attributes.
Insert
(index, attribute)
3809
Return attributes.
Insert
(index, attribute)
3841
Dim attributeLists = moduleBlock.ModuleStatement.AttributeLists.
Insert
(index, attributeList)
3845
Dim attributeLists = structureBlock.StructureStatement.AttributeLists.
Insert
(index, attributeList)
3849
Dim attributeLists = interfaceBlock.InterfaceStatement.AttributeLists.
Insert
(index, attributeList)
3853
Dim attributeLists = classBlock.ClassStatement.AttributeLists.
Insert
(index, attributeList)
3858
Dim attributeLists = enumBlock.EnumStatement.AttributeLists.
Insert
(index, attributeList)
3862
Dim attributeLists = enumMember.AttributeLists.
Insert
(index, attributeList)
3866
Dim attributeLists = delegateStatement.AttributeLists.
Insert
(index, attributeList)
3870
Dim attributeLists = declareStatement.AttributeLists.
Insert
(index, attributeList)
3874
Dim attributeLists = methodStatement.AttributeLists.
Insert
(index, attributeList)
3880
Dim attributeLists = constructor.AttributeLists.
Insert
(index, attributeList)
3884
Dim attributeLists = operatorStatement.AttributeLists.
Insert
(index, attributeList)
3888
Dim attributeLists = methodStatement.AttributeLists.
Insert
(index, attributeList)
3893
Dim attributeLists = propertyStatement.AttributeLists.
Insert
(index, attributeList)
3897
Dim attributeLists = propertyBlock.PropertyStatement.AttributeLists.
Insert
(index, attributeList)
3901
Dim attributeLists = eventStatement.AttributeLists.
Insert
(index, attributeList)
3905
Dim attributeLists = eventBlock.EventStatement.AttributeLists.
Insert
(index, attributeList)
3909
Dim attributeLists = field.AttributeLists.
Insert
(index, attributeList)
3913
Dim attributeLists = parameter.AttributeLists.
Insert
(index, attributeList)
3933
Dim importsList = compilationUnit.Imports.
Insert
(index, importsStatement)
4277
Dim inheritsStatements = typeBlock.Inherits.
Insert
(0, inheritsStatement)
4349
Dim implementsStatements = typeBlock.Implements.
Insert
(insertionIndex, implementsStatement)