Vixen
02b45cc4
csharp
public readonly record struct TextSpan

An immutable half-open interval [Start, End) into source text, measured in characters. The primary currency for spans and diagnostics.

No guide page documents this yet — the page shows what the code says about itself.

Fields and properties (4)

  • public int Start

    Zero-based character offset of the first character.

  • public int Length

    Number of characters covered.

  • public int End

    One past the last character. Exclusive, so an empty span has End == Start.

  • public bool IsEmpty

    Whether the span covers no characters.

Methods (11)

  • public TextSpan(int Start, int Length)

    An immutable half-open interval [Start, End) into source text, measured in characters. The primary currency for spans and diagnostics.

  • public static bool operator <(TextSpan left, TextSpan right)

    Orders by Start, then by Length.

  • public static bool operator <=(TextSpan left, TextSpan right)
  • public static bool operator >(TextSpan left, TextSpan right)
  • public static bool operator >=(TextSpan left, TextSpan right)
  • public bool Contains(int position)

    Whether falls inside the span. End is excluded.

  • public bool Contains(TextSpan span)

    Whether lies entirely within this one.

  • public bool OverlapsWith(TextSpan other)

    Whether the two spans share at least one character. Touching spans do not overlap.

  • public static TextSpan FromBounds(int start, int end)

    Builds a span from inclusive to exclusive .

  • public int CompareTo(TextSpan other)

    Orders by Start, breaking ties with Length.

  • public override string ToString()

    Renders as [start..end), matching the half-open convention.

Used by (31)

  • BinderVixen.Ui.Markup
  • BlenderVixen.Core.Syntax
  • DiagnosticsTestsVixen.Core.Syntax.Tests
  • IncrementalTestsVixen.Ui.Markup.Tests
  • LocationVixen.Core.Syntax
  • NavigationTestsVixen.Core.Syntax.Tests
  • RecoveryTestsVixen.Ui.Markup.Tests
  • RedTreeTestsVixen.Core.Syntax.Tests
  • SourceTextVixen.Core.Syntax
  • SourceTextTestsVixen.Core.Syntax.Tests
  • SyntaxNodeVixen.Core.Syntax
  • SyntaxTreeVixen.Ui.Markup
  • SyntaxTriviaVixen.Core.Syntax
  • TextChangeVixen.Core.Syntax
  • TextChangeRangeVixen.Core.Syntax
  • TextChangeTestsVixen.Core.Syntax.Tests
  • TextSpanTestsVixen.Core.Syntax.Tests
  • VxmlGeneratorVixen.Ui.Markup.Generators
  • VxmlLexerVixen.Ui.Markup
  • VxmlParserVixen.Ui.Markup
  • CompilationVixen.Raven
  • DiagnosticFormatterTestsVixen.Raven.Tests
  • DiagnosticsTestsVixen.Raven.Tests
  • IncrementalParseTestsVixen.Raven.Tests
  • NestedGenericTestsVixen.Raven.Tests
  • RavenLexerVixen.Raven
  • RavenParserVixen.Raven
  • RavenSyntaxErrorListenerVixen.Raven.Tests
  • RedTreeTestsVixen.Raven.Tests
  • SemanticModelTestsVixen.Raven.Tests
  • SyntaxNavigationTestsVixen.Raven.Tests