53 references to Insert
Microsoft.CodeAnalysis (1)
Syntax\SeparatedSyntaxList.cs (1)
336return Insert(this.Count, node);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
111clause.Constraints.Insert(0, SyntaxFactory.ClassOrStructConstraint(
MakeLocalFunctionStaticCodeFixHelper.cs (2)
113newArgumentsList = newArgumentsList.Insert(0, (ArgumentSyntax)generator.Argument(generator.ThisExpression())); 194parameterList, parameterList.WithParameters(parameters.Insert(0, Parameter(Identifier("@this")).WithType(thisParameter.Type.GenerateTypeSyntax()))));
Microsoft.CodeAnalysis.CSharp.Features (5)
CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
111clause.Constraints.Insert(0, SyntaxFactory.ClassOrStructConstraint(
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (2)
136tupleLeftSyntax.WithArguments(tupleLeftSyntax.Arguments.Insert(insertionPosition, left))); 139tupleRightSyntax.WithArguments(tupleRightSyntax.Arguments.Insert(insertionPosition, right)));
MakeLocalFunctionStaticCodeFixHelper.cs (2)
113newArgumentsList = newArgumentsList.Insert(0, (ArgumentSyntax)generator.Argument(generator.ThisExpression())); 194parameterList, parameterList.WithParameters(parameters.Insert(0, Parameter(Identifier("@this")).WithType(thisParameter.Type.GenerateTypeSyntax()))));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (16)
Syntax\SeparatedSyntaxListTests.cs (16)
52var addList = list.Insert(0, SyntaxFactory.ParseExpression("x")); 55var insertBefore = addList.Insert(0, SyntaxFactory.ParseExpression("y")); 58var insertAfter = addList.Insert(1, SyntaxFactory.ParseExpression("y")); 68var insertAfterComment = argsWithComment.Insert(1, SyntaxFactory.Argument(SyntaxFactory.ParseExpression("c"))); 76var insertAfterEOL = argsWithEOL.Insert(1, SyntaxFactory.Argument(SyntaxFactory.ParseExpression("c"))); 82var insertBeforeMultiLineComment = argsWithMultiLineComment.Insert(1, SyntaxFactory.Argument(SyntaxFactory.ParseExpression("c"))); 120newList = list.Insert(0, nodeD); 128newList = list.Insert(1, nodeD); 132newList = list.Insert(2, nodeD); 136newList = list.Insert(3, nodeD); 213Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, nodeD)); 214Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(list.Count + 1, nodeD)); 248newList = list.Insert(0, nodeD); 261Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(1, nodeD)); 262Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, nodeD)); 267Assert.Throws<ArgumentNullException>(() => list.Insert(0, null));
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CodeGeneration\CSharpSyntaxGenerator.cs (3)
1856constraints = constraints.Insert(0, SyntaxFactory.ClassOrStructConstraint(isReferenceType ? SyntaxKind.ClassConstraint : SyntaxKind.StructConstraint)); 2691return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(0, SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)))); 2705return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(baseList.Types.Count, SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType))));
Simplification\CSharpSimplificationService.Expander.cs (1)
1118var arguments = originalNode.ArgumentList.Arguments.Insert(0, thisArgument);
Microsoft.CodeAnalysis.Features (1)
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
589return invocationArguments.Insert(insertionIndex, argument);
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (11)
Syntax\SeparatedSyntaxListTests.vb (11)
49newList = list.Insert(0, nodeD) 53newList = list.Insert(1, nodeD) 57newList = list.Insert(2, nodeD) 61newList = list.Insert(3, nodeD) 138Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(-1, nodeD)) 139Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(list.Count + 1, nodeD)) 148Assert.Throws(Of ArgumentNullException)(Function() list.Insert(0, Nothing)) 173newList = list.Insert(0, nodeD) 186Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(1, nodeD)) 187Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(-1, nodeD)) 194Assert.Throws(Of ArgumentNullException)(Function() list.Insert(0, Nothing))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeGeneration\VisualBasicSyntaxGenerator.vb (2)
2887constraints = constraints.Insert(0, SyntaxFactory.ClassConstraint(SyntaxFactory.Token(SyntaxKind.ClassKeyword))) 2889constraints = constraints.Insert(0, SyntaxFactory.StructureConstraint(SyntaxFactory.Token(SyntaxKind.StructureKeyword)))
Simplification\VisualBasicSimplificationService.Expander.vb (1)
271Dim arguments = originalNode.ArgumentList.Arguments.Insert(0, thisArgument)
Microsoft.VisualStudio.LanguageServices.CSharp (7)
CodeModel\CSharpCodeModelService.cs (7)
3247var newMembers = enumDeclaration.Members.Insert(index, (EnumMemberDeclarationSyntax)member); 3255var newMembers = enumDeclaration.Members.Insert(index, (EnumMemberDeclarationSyntax)member); 3339var newArguments = argumentList.Arguments.Insert(index, (AttributeArgumentSyntax)attributeArgument); 3480var parameterList = method.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3485var parameterList = indexer.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3490var parameterList = delegateDeclaration.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3706? typeDeclaration.BaseList.WithTypes(typeDeclaration.BaseList.Types.Insert(insertionIndex, SyntaxFactory.SimpleBaseType(typeName)))
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService.vb (2)
3786Dim newArguments = argumentList.Arguments.Insert(index, DirectCast(attributeArgument, ArgumentSyntax)) 3942Dim parameters = list.Parameters.Insert(index, parameter)