View Source Lexical.Document.Lines (lexical_shared v0.5.0)

A hyper-optimized, line-based backing store for text documents

Link to this section Summary

Functions

Gets the current line with the given index using fetch semantics

Create a new line store with the given text at the given starting index

Returns the number of lines in the line store

Turnss a line store into an iolist

Turns a line store into a string

Link to this section Types

@type t() :: %Lexical.Document.Lines{lines: term(), starting_index: term()}

Link to this section Functions

Link to this function

fetch_line(document, index)

View Source

Gets the current line with the given index using fetch semantics

Link to this function

new(text, starting_index \\ 1)

View Source
@spec new(String.t(), non_neg_integer()) :: t()

Create a new line store with the given text at the given starting index

Returns the number of lines in the line store

@spec to_iodata(t()) :: iodata()

Turnss a line store into an iolist

Turns a line store into a string