Skip to main content

fission_text_engine/
lib.rs

1//! # fission-text-engine
2//!
3//! Production-quality text buffer for a code editor.
4//!
5//! This crate provides the **text storage and manipulation layer** — it is
6//! deliberately not an editor.  It owns:
7//!
8//! * A rope-backed [`TextBuffer`] with O(log n) edits,
9//! * A [`LineIndex`] that maps between byte offsets, `(line, col)` pairs, and
10//!   UTF-16 code-unit columns (the encoding used by the Language Server
11//!   Protocol),
12//! * An [`EditHistory`] with bounded undo / redo stacks built on
13//!   [`EditTransaction`]s,
14//! * A [`CoordinateMapper`] that translates freely between the three
15//!   coordinate systems (byte offset, line/col, LSP position).
16
17pub mod buffer;
18pub mod coordinate;
19pub mod edit;
20pub mod line_index;
21
22pub use buffer::TextBuffer;
23pub use coordinate::{CoordinateMapper, LspPosition};
24pub use edit::{EditHistory, EditTransaction, TextEdit};
25pub use line_index::{LineCol, LineIndex};
26
27#[cfg(test)]
28mod tests;