Skip to main content

Crate fission_text_engine

Crate fission_text_engine 

Source
Expand description

§fission-text-engine

Production-quality text buffer for a code editor.

This crate provides the text storage and manipulation layer — it is deliberately not an editor. It owns:

  • A rope-backed TextBuffer with O(log n) edits,
  • A LineIndex that maps between byte offsets, (line, col) pairs, and UTF-16 code-unit columns (the encoding used by the Language Server Protocol),
  • An EditHistory with bounded undo / redo stacks built on EditTransactions,
  • A CoordinateMapper that translates freely between the three coordinate systems (byte offset, line/col, LSP position).

Re-exports§

pub use buffer::TextBuffer;
pub use coordinate::CoordinateMapper;
pub use coordinate::LspPosition;
pub use edit::EditHistory;
pub use edit::EditTransaction;
pub use edit::TextEdit;
pub use line_index::LineCol;
pub use line_index::LineIndex;

Modules§

buffer
Rope-backed text buffer with revision tracking.
coordinate
Coordinate mapper: byte offset <-> line/col <-> LSP position (UTF-16).
edit
Edit primitives, transactions, and undo/redo history.
line_index
Efficient mapping between byte offsets and line/column positions.