44 references to Insert
Microsoft.AspNetCore.App.CodeFixes (2)
RouteParameterUnusedParameterFixer.cs (2)
109var newParameters = syntax.ParameterList.Parameters.Insert(parameterIndex, parameterSyntax); 120var newParameters = syntax.ParameterList.Parameters.Insert(parameterIndex, parameterSyntax);
Microsoft.CodeAnalysis (1)
Syntax\SeparatedSyntaxList.cs (1)
365return Insert(this.Count, node);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
105clause.Constraints.Insert(0, SyntaxFactory.ClassOrStructConstraint(
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
111newArgumentsList = newArgumentsList.Insert(0, (ArgumentSyntax)generator.Argument(generator.ThisExpression())); 187parameterList, parameterList.WithParameters(parameters.Insert(0, Parameter(Identifier("@this")).WithType(thisParameter.Type.GenerateTypeSyntax()))));
Microsoft.CodeAnalysis.CSharp.Features (4)
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (2)
91tupleLeftSyntax.WithArguments(tupleLeftSyntax.Arguments.Insert(insertionPosition, left))); 94tupleRightSyntax.WithArguments(tupleRightSyntax.Arguments.Insert(insertionPosition, right)));
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
105clause.Constraints.Insert(0, SyntaxFactory.ClassOrStructConstraint(
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
111newArgumentsList = newArgumentsList.Insert(0, (ArgumentSyntax)generator.Argument(generator.ThisExpression()));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Syntax\SeparatedSyntaxListTests.cs (7)
69var insertAfterComment = argsWithComment.Insert(1, SyntaxFactory.Argument(SyntaxFactory.ParseExpression("c"))); 77var insertAfterEOL = argsWithEOL.Insert(1, SyntaxFactory.Argument(SyntaxFactory.ParseExpression("c"))); 83var insertBeforeMultiLineComment = argsWithMultiLineComment.Insert(1, SyntaxFactory.Argument(SyntaxFactory.ParseExpression("c"))); 255newList = list.Insert(0, nodeD); 268Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(1, nodeD)); 269Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, nodeD)); 274Assert.Throws<ArgumentNullException>(() => list.Insert(0, null));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
CodeGeneration\CSharpSyntaxGenerator.cs (2)
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)
1119var arguments = originalNode.ArgumentList.Arguments.Insert(0, thisArgument);
Microsoft.CodeAnalysis.Features (1)
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
578return 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)
2668constraints = constraints.Insert(0, SyntaxFactory.ClassConstraint(SyntaxFactory.Token(SyntaxKind.ClassKeyword))) 2670constraints = 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)
3243var newMembers = enumDeclaration.Members.Insert(index, (EnumMemberDeclarationSyntax)member); 3251var newMembers = enumDeclaration.Members.Insert(index, (EnumMemberDeclarationSyntax)member); 3333var newArguments = argumentList.Arguments.Insert(index, (AttributeArgumentSyntax)attributeArgument); 3474var parameterList = method.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3479var parameterList = indexer.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3484var parameterList = delegateDeclaration.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3701? 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)