Improve formatting
This commit is contained in:
parent
1b46e5d237
commit
a1a339b23d
2 changed files with 19 additions and 3 deletions
|
|
@ -180,6 +180,20 @@ export function reconcile(
|
|||
return jsResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a compact diff representation between an original and changed text.
|
||||
*
|
||||
* These can be parsed and unpacked using Rust crate's EditedText::from_change_set.
|
||||
*
|
||||
* This function computes the differences between two versions of text and returns
|
||||
* a compact string representation of those changes. The returned format is
|
||||
* serialised JSON.
|
||||
*
|
||||
* @param original - The original/base version of the text
|
||||
* @param changed - The modified version of the text (either string or TextWithCursors with cursor positions)
|
||||
* @param tokenizer - The tokenisation strategy, which is the same as used in `reconcile`.
|
||||
* @returns A compact string representation of the diff between original and changed text
|
||||
*/
|
||||
export function getCompactDiff(
|
||||
original: string,
|
||||
changed: string | TextWithOptionalCursors,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue