1 write to Length
Microsoft.CodeAnalysis (1)
1298 references to Length
CSharpSyntaxGenerator (1)
GenerateDocumentationAndConfigFiles (62)
Metrics (58)
Metrics.Legacy (58)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.AspNetCore.App.Analyzers (11)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.CodeAnalysis (65)
Syntax\SyntaxDiffer.cs (21)
116delta += change.Range.NewLength - change.Range.Span.Length;
311if (sim >= Math.Max(_oldNodes.Peek().FullSpan.Length, _newNodes.Peek().FullSpan.Length))
329if (child.FullSpan.Length > 0)
359var sim = node.FullSpan.Length;
373if (sim == node.FullSpan.Length && node.IsToken)
405similarity = node.FullSpan.Length;
460w += tr.FullSpan.Length;
469w += tr.FullSpan.Length;
491w += n2.FullSpan.Length;
550RecordChange(new TextChangeRange(oldSpan, newSpan.Length), removedNode, insertedNode);
560RecordChange(new ChangeRecord(new TextChangeRange(oldSpan, newSpan.Length), removedNodes, insertedNodes));
570RecordChange(new ChangeRecord(new TextChangeRange(new TextSpan(start, 0), newSpan.Length), null, insertedNodes));
582new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + change.Range.Span.Length), last.Range.NewLength + change.Range.NewLength),
605new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + textChangeRange.Span.Length), last.Range.NewLength + textChangeRange.NewLength),
749if (cr.Range.Span.Length > 0 && cr.Range.NewLength > 0)
764new TextSpan(range.Span.Start + commonLeadingCount, range.Span.Length - (commonLeadingCount + commonTrailingCount)),
779if (range.Span.Length > 0 || range.NewLength > 0)
828var builder = new StringBuilder(span.Length);
Microsoft.CodeAnalysis.Analyzers (63)
Microsoft.CodeAnalysis.AnalyzerUtilities (58)
Microsoft.CodeAnalysis.BannedApiAnalyzers (62)
Microsoft.CodeAnalysis.CodeStyle (59)
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
Microsoft.CodeAnalysis.CSharp (12)
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (5)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (24)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (51)
LexicalAndXml\LexicalTests.cs (26)
3880Assert.True(trivia.Span.Length == 8);
3959Assert.Equal(22, trivia.Span.Length);
3972Assert.Equal(16, trivia.Span.Length);
3982Assert.Equal(2, trivia.Span.Length);
3987Assert.Equal(13, trivia.Span.Length);
3996Assert.Equal(16, trivia.Span.Length);
4005Assert.Equal(2, trivia.Span.Length);
4009Assert.Equal(34, trivia.Span.Length);
4017Assert.Equal(16, trivia1.Span.Length);
4027Assert.Equal(2, trivia2.Span.Length);
4032Assert.Equal(15, trivia3.Span.Length);
4037Assert.Equal(24, trivia4.Span.Length);
4050Assert.Equal(16, trivia1.Span.Length);
4060Assert.Equal(2, trivia2.Span.Length);
4065Assert.Equal(24, trivia3.Span.Length);
4098Assert.Equal(22, trivia.Span.Length);
4106Assert.Equal(16, trivia.Span.Length);
4111Assert.Equal(2, trivia.Span.Length);
4116Assert.Equal(13, trivia.Span.Length);
4125Assert.Equal(16, trivia.Span.Length);
4129Assert.Equal(2, trivia.Span.Length);
4133Assert.Equal(34, trivia.Span.Length);
4141Assert.Equal(16, trivia1.Span.Length);
4146Assert.Equal(2, trivia2.Span.Length);
4151Assert.Equal(15, trivia3.Span.Length);
4156Assert.Equal(24, trivia4.Span.Length);
Syntax\SyntaxNodeTests.cs (20)
1780Assert.Equal(rootNode.FullSpan.Length, rootNode.ToFullString().Length);
1781Assert.Equal(rootNode.Span.Length, rootNode.ToString().Length);
1798Assert.Equal(rootNode.FullSpan.Length, rootNode.ToFullString().Length);
1799Assert.Equal(rootNode.Span.Length, rootNode.ToString().Length);
3754Assert.Equal(0, idToken.LeadingTrivia.Span.Length); // zero-width elastic trivia
3757Assert.Equal(0, idToken.TrailingTrivia.Span.Length); // zero-width elastic trivia
3770Assert.Equal(1, idToken.LeadingTrivia.Span.Length);
3773Assert.Equal(2, idToken.TrailingTrivia.Span.Length);
3779Assert.Equal(0, namedNode.GetLeadingTrivia().Span.Length); // zero-width elastic trivia
3782Assert.Equal(0, namedNode.GetTrailingTrivia().Span.Length); // zero-width elastic trivia
3795Assert.Equal(1, namedNode.GetLeadingTrivia().Span.Length);
3798Assert.Equal(2, namedNode.GetTrailingTrivia().Span.Length);
3804Assert.Equal(0, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia
3807Assert.Equal(0, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia
3813Assert.Equal(0, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia
3816Assert.Equal(0, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia
3836Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia
3839Assert.Equal(2, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia
3845Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia
3848Assert.Equal(2, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia
Microsoft.CodeAnalysis.CSharp.Workspaces (12)
Microsoft.CodeAnalysis.EditorFeatures (6)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (9)
Microsoft.CodeAnalysis.EditorFeatures.Text (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
RenameTracking\RenameTrackingTaggerProviderTests.cs (5)
381state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "cation");
395state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Complex");
409state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Dog");
429state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "_");
853state.EditorOperations.ReplaceText(new Span(textSpan.Start, textSpan.Length), "Go");
Microsoft.CodeAnalysis.Features (38)
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
168if (span.Length != 0)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (62)
Microsoft.CodeAnalysis.PublicApiAnalyzers (58)
Microsoft.CodeAnalysis.ResxSourceGenerator (58)
Microsoft.CodeAnalysis.UnitTests (24)
Microsoft.CodeAnalysis.VisualBasic (13)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
Microsoft.CodeAnalysis.VisualBasic.Features (14)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (26)
TestSyntaxNodes.vb (19)
772Assert.Equal(5, keyword.Span.Length)
773Assert.Equal(6, keyword.FullSpan.Length)
784Assert.Equal(5, keyword.Span.Length)
785Assert.Equal(12, keyword.FullSpan.Length)
793Assert.Equal(7, keyword.Span.Length)
794Assert.Equal(8, keyword.FullSpan.Length)
804Assert.Equal(7, keyword.Span.Length)
805Assert.Equal(16, keyword.FullSpan.Length)
817Assert.Equal(7, endTry.Span.Length)
818Assert.Equal(8, endTry.FullSpan.Length)
924Assert.Equal(0, eof.Span.Length)
928Assert.Equal(0, endIfStmt.Span.Length)
991Assert.Equal(6, kwModule.Span.Length)
992Assert.Equal(7, kwModule.FullSpan.Length)
997Assert.Equal(6, kwModule.Span.Length)
998Assert.Equal(7, kwModule.FullSpan.Length)
1737Assert.Equal(0, tree.GetRoot().FindToken(node.FullSpan.Length - 1).TrailingTrivia.Count)
2188Assert.Equal(sN.FullWidth, cS.FullSpan.Length)
2189Assert.Equal(sN.Width, cS.Span.Length)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (11)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (18)
Microsoft.CodeAnalysis.Workspaces (104)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.VisualStudio.LanguageServices (4)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (3)
Roslyn.Diagnostics.Analyzers (62)
Roslyn.Diagnostics.CSharp.Analyzers (6)
System.Text.RegularExpressions.Generator (1)
Test.Utilities (58)
Text.Analyzers (62)