25 references to Insert
Microsoft.CodeAnalysis (1)
Syntax\SyntaxTriviaList.cs (1)
264return Insert(this.Count, trivia);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
55(original, current) => current.WithLeadingTrivia(current.LeadingTrivia.Insert(0, endOfLineTrivia)));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (2)
129=> node.WithLeadingTrivia(node.GetLeadingTrivia().Insert(0, trivia)); 132=> token.WithLeadingTrivia(token.LeadingTrivia.Insert(0, trivia));
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
136return leadingTrivia.Insert(insertionIndex, newDocComment);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (2)
102var leadingTrivia = prependNewLineIfMissing ? token.LeadingTrivia.Insert(0, SyntaxFactory.ElasticCarriageReturnLineFeed) : token.LeadingTrivia; 103var trailingTrivia = appendNewLineIfMissing ? token.TrailingTrivia.Insert(0, SyntaxFactory.ElasticCarriageReturnLineFeed) : token.TrailingTrivia;
Microsoft.CodeAnalysis.CSharp.Features (4)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
71triviaList = triviaList.Insert(0, endOfLineTrivia);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (2)
129=> node.WithLeadingTrivia(node.GetLeadingTrivia().Insert(0, trivia)); 132=> token.WithLeadingTrivia(token.LeadingTrivia.Insert(0, trivia));
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (1)
136return leadingTrivia.Insert(insertionIndex, newDocComment);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
Syntax\SyntaxTriviaListTests.cs (11)
80newList = list.Insert(0, triviaD); 84newList = list.Insert(1, triviaD); 88newList = list.Insert(2, triviaD); 92newList = list.Insert(3, triviaD); 169Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, triviaD)); 170Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(list.Count + 1, triviaD)); 176Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(0, default(SyntaxTrivia))); 204newList = list.Insert(0, triviaD); 217Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(1, triviaD)); 218Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, triviaD)); 224Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(0, default(SyntaxTrivia)));
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (2)
102var leadingTrivia = prependNewLineIfMissing ? token.LeadingTrivia.Insert(0, SyntaxFactory.ElasticCarriageReturnLineFeed) : token.LeadingTrivia; 103var trailingTrivia = appendNewLineIfMissing ? token.TrailingTrivia.Insert(0, SyntaxFactory.ElasticCarriageReturnLineFeed) : token.TrailingTrivia;
Microsoft.CodeAnalysis.VisualBasic.Features (1)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (1)
72triviaList = triviaList.Insert(0, endOfLineTrivia)