8 overrides of Length
Microsoft.CodeAnalysis (6)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Microsoft.CodeAnalysis.Test.Utilities (1)
239 references to Length
Microsoft.CodeAnalysis (67)
Text\SourceText.cs (24)
396get { return this.Length; }
451/// greater than <see cref="Length"/>.</exception>
479if (span.End > this.Length)
497else if (spanLength == this.Length && span.Start == 0)
512if (start < 0 || start > this.Length)
523return this.GetSubText(new TextSpan(start, this.Length - start));
532this.Write(textWriter, new TextSpan(0, this.Length), cancellationToken);
603return ToString(new TextSpan(0, this.Length));
618int position = Math.Max(Math.Min(span.Start, this.Length), 0);
619int length = Math.Min(span.End, this.Length) - position;
621while (position < this.Length && length > 0)
658if (change.Span.End > this.Length)
709if (position < this.Length)
711var subText = this.GetSubText(new TextSpan(position, this.Length - position));
780return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldText.Length), this.Length));
878return TextLine.FromSpan(_text, TextSpan.FromBounds(start, _text.Length));
890if (position < 0 || position > _text.Length)
938var length = this.Length;
956if (0 == this.Length)
1060if (this.Length != other.Length)
1070while (position < this.Length)
1072int n = Math.Min(this.Length - position, buffer1.Length);
Microsoft.CodeAnalysis.CodeStyle (3)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (9)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (6)
64await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, document, new TextSpan(0, document.GetTextAsync().Result.Length));
92await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(ideEngineWorkspace, ideEngineDocument, new TextSpan(0, ideEngineDocument.GetTextAsync().Result.Length));
128return await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, document, new TextSpan(0, document.GetTextAsync().Result.Length));
174await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, sourceDocument, new TextSpan(0, sourceDocument.GetTextAsync().Result.Length));
206var diagnostics = await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, ideEngineDocument, new TextSpan(0, ideEngineDocument.GetTextAsync().Result.Length));
262var diagnostics = await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(ideEngineWorkspace, ideEngineDocument, new TextSpan(0, ideEngineDocument.GetTextAsync().Result.Length));
Microsoft.CodeAnalysis.CSharp.Features (6)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (8)
Microsoft.CodeAnalysis.EditorFeatures (6)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.Text (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (7)
Classification\ClassificationTests.vb (4)
97document, New TextSpan(0, text.Length), ClassificationOptions.Default, includeAdditiveSpans:=False, CancellationToken.None)
158document, New TextSpan(0, text.Length), ClassificationOptions.Default, includeAdditiveSpans:=False, CancellationToken.None)
331Await classificationService.AddSyntacticClassificationsAsync(wrongDocument, New TextSpan(0, text.Length), result, CancellationToken.None)
332Await classificationService.AddSemanticClassificationsAsync(wrongDocument, New TextSpan(0, text.Length), options:=Nothing, result, CancellationToken.None)
Microsoft.CodeAnalysis.Features (18)
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.UnitTests (37)
Text\TextChangeTests.cs (24)
224Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(newText.Length - 1, destination, 0, 2));
360Assert.Equal(str.Length + n, text.Length);
380Assert.Equal(str.Length, text.Length);
389Assert.Equal(26, text.Length);
393Assert.Equal(10, subtext.Length);
405Assert.Equal(6, newText.Length);
416Assert.Equal(20, newText.Length);
428Assert.Equal(25, newText.Length);
444Assert.Equal(27, textWithSegments.Length);
460Assert.Equal(27, textWithSegments.Length);
465Assert.Equal(24, textWithFewerSegments.Length);
479var textWithSegments = text.Replace(new TextSpan(0, text.Length), "");
480Assert.Equal(0, textWithSegments.Length);
491t = t.Replace(t.Length, 0, b); // add b's
502t = t.Replace(t.Length, 0, "c");
510Assert.Equal(new string('c', t.Segments[2].Length), t.Segments[2].ToString());
521t = t.Replace(t.Length, 0, b); // add b's
532t = t.Replace(t.Length, 0, c); // add c's that are the same segment size as the a's and b's
625Assert.Equal(text.Length + largeText.Length, newText.Length);
969var editedLength = originalText.Length;
973var oldMaxInsertLength = originalText.Length * 2;
976for (int i = 0; i < originalText.Length; i += random.Next(maxSkipLength))
979var newChange = new TextChange(new TextSpan(i, length: random.Next(originalText.Length - i)), newText);
Microsoft.CodeAnalysis.VisualBasic (7)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (4)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.vb (4)
33Await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, document, New TextSpan(0, document.GetTextAsync().Result.Length))
58Await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(ideEngineWorkspace, ideEngineDocument, New TextSpan(0, ideEngineDocument.GetTextAsync().Result.Length))
88Return Await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, document, New TextSpan(0, document.GetTextAsync().Result.Length))
121Await DiagnosticProviderTestUtilities.GetAllDiagnosticsAsync(workspace, sourceDocument, New TextSpan(0, sourceDocument.GetTextAsync().Result.Length))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces (18)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Microsoft.VisualStudio.LanguageServices (3)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)