83 references to Insert
Microsoft.CodeAnalysis (1)
Syntax\SyntaxList`1.cs (1)
222
return this.
Insert
(this.Count, node);
Microsoft.CodeAnalysis.CSharp.Features (8)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
898
return block.WithStatements(block.Statements.
Insert
(0, newStatement));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
321
currentTypeDeclaration.Members.
Insert
(firstConstructorIndex, constructorDeclaration));
336
currentTypeDeclaration.Members.
Insert
(lastFieldOrProperty + 1, constructorDeclaration));
341
currentTypeDeclaration.Members.
Insert
(0, constructorDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
182
typeDeclaration.Members.
Insert
(index, memberDeclaration));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (3)
317
currentBlock.Statements.
Insert
(firstAffectedStatementIndex, declarationStatement));
330
currentCompilationUnit.Members.
Insert
(firstAffectedGlobalStatementIndex, GlobalStatement(declarationStatement)));
470
return oldStatements.
Insert
(statementIndex, newStatement);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxListTests.cs (4)
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)
222
Dim elseIfBlocks = mifBlock.ElseIfBlocks.
Insert
(0,
1205
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)
3744
Return compilationUnit.WithMembers(compilationUnit.Members.
Insert
(index, declarationStatement))
3748
Return namespaceBlock.WithMembers(namespaceBlock.Members.
Insert
(index, declarationStatement))
3752
Return classBlock.WithMembers(classBlock.Members.
Insert
(index, declarationStatement))
3756
Return interfaceBlock.WithMembers(interfaceBlock.Members.
Insert
(index, declarationStatement))
3760
Return structureBlock.WithMembers(structureBlock.Members.
Insert
(index, declarationStatement))
3764
Return moduleBlock.WithMembers(moduleBlock.Members.
Insert
(index, declarationStatement))
3768
Return enumBlock.WithMembers(enumBlock.Members.
Insert
(index, declarationStatement))
3799
Return attributes.
Insert
(index, attribute)
3804
Return attributes.
Insert
(index, attribute)
3808
Return attributes.
Insert
(index, attribute)
3840
Dim attributeLists = moduleBlock.ModuleStatement.AttributeLists.
Insert
(index, attributeList)
3844
Dim attributeLists = structureBlock.StructureStatement.AttributeLists.
Insert
(index, attributeList)
3848
Dim attributeLists = interfaceBlock.InterfaceStatement.AttributeLists.
Insert
(index, attributeList)
3852
Dim attributeLists = classBlock.ClassStatement.AttributeLists.
Insert
(index, attributeList)
3857
Dim attributeLists = enumBlock.EnumStatement.AttributeLists.
Insert
(index, attributeList)
3861
Dim attributeLists = enumMember.AttributeLists.
Insert
(index, attributeList)
3865
Dim attributeLists = delegateStatement.AttributeLists.
Insert
(index, attributeList)
3869
Dim attributeLists = declareStatement.AttributeLists.
Insert
(index, attributeList)
3873
Dim attributeLists = methodStatement.AttributeLists.
Insert
(index, attributeList)
3879
Dim attributeLists = constructor.AttributeLists.
Insert
(index, attributeList)
3883
Dim attributeLists = operatorStatement.AttributeLists.
Insert
(index, attributeList)
3887
Dim attributeLists = methodStatement.AttributeLists.
Insert
(index, attributeList)
3892
Dim attributeLists = propertyStatement.AttributeLists.
Insert
(index, attributeList)
3896
Dim attributeLists = propertyBlock.PropertyStatement.AttributeLists.
Insert
(index, attributeList)
3900
Dim attributeLists = eventStatement.AttributeLists.
Insert
(index, attributeList)
3904
Dim attributeLists = eventBlock.EventStatement.AttributeLists.
Insert
(index, attributeList)
3908
Dim attributeLists = field.AttributeLists.
Insert
(index, attributeList)
3912
Dim attributeLists = parameter.AttributeLists.
Insert
(index, attributeList)
3932
Dim importsList = compilationUnit.Imports.
Insert
(index, importsStatement)
4276
Dim inheritsStatements = typeBlock.Inherits.
Insert
(0, inheritsStatement)
4348
Dim implementsStatements = typeBlock.Implements.
Insert
(insertionIndex, implementsStatement)