Span

Swift
public struct Span: CustomStringConvertible, Sendable

A section of a stylesheet.


Topics

Types

struct Location

A single point in a stylesheet.

Declaration
Swift
public struct Location: CustomStringConvertible, Sendable

Properties

var text: String?

The text covered by the span, or nil if there is no associated text.

Declaration
Swift
public let text: String?

var url: URL?

The URL of the stylesheet to which the span refers, or nil if it refers to an inline compilation that doesn’t specify a URL.

Declaration
Swift
public let url: URL?

var start: Location

The location of the first character in the span.

Declaration
Swift
public let start: Location

var end: Location?

The location of the first character after this span, or nil to mean the span is zero-length and points just before start.

Declaration
Swift
public let end: Location?

var context: String?

Additional source text surrounding the span.

This usually contains the full lines the span begins and ends on if the span itself doesn’t cover the full lines.

Declaration
Swift
public let context: String?

var description: String

A short description of the span.

Declaration
Swift
public var description: String { get }