Skip to main content

griz_core/
lib.rs

1//! Pure edit engine for griz.
2//!
3//! Everything here computes; nothing here writes. A caller hands the engine
4//! operations and a way to read files, and gets back a [`Plan`]: the exact
5//! before and after text of every file, one [`Edit`] per change with the
6//! [`Confidence`] it was matched at, and every [`Problem`] that stopped an
7//! operation. Writing a plan to disk belongs to `griz-store`.
8
9mod anchor_input;
10mod definitions;
11mod diff;
12mod edits;
13mod find;
14mod find_cache;
15mod find_hits;
16mod find_position;
17mod hash;
18mod hash_cache;
19mod matcher;
20mod merge;
21mod model;
22mod overlay;
23mod patch;
24mod pattern_edit;
25mod pattern_locator;
26mod plan;
27mod position;
28mod problem;
29mod reindent;
30mod scope;
31mod source;
32mod splice;
33mod structural;
34mod syntax;
35mod uri;
36mod workspace_edit;
37mod workspace_edit_ops;
38
39pub use definitions::{DiffItem, ItemChange, diff_items};
40pub use diff::{FileDiff, render_diff};
41pub use find::{FileSummary, FindFilesPage, FindPage, FindQuery, Match, find, find_files};
42pub use hash::{content_hash, content_hash_bytes};
43pub use hash_cache::ContentHashCache;
44pub use merge::{MergeOutcome, three_way};
45pub use model::{
46    Anchor, ByteRange, ChangeKind, Confidence, Edit, FileChange, Occurrence, Op, Plan, Problem,
47    ProblemKind, Rung, Window,
48};
49pub use patch::{PatchError, parse_patch};
50pub use pattern_locator::PatternLocator;
51pub use plan::build_plan;
52pub use position::{Position, PositionEncoding};
53pub use source::{DiskSource, MapSource, Source};
54pub use syntax::{FileSyntax, PlanSyntax, SyntaxPosition, annotate, plan_syntax};
55pub use workspace_edit::{
56    CreateFile, DeleteFile, DocumentChange, Range, RenameFile, TextDocumentEdit,
57    TextDocumentIdentifier, TextEdit, WorkspaceEdit, WorkspaceEditError,
58};
59pub use workspace_edit_ops::to_ops as workspace_edit_to_ops;