Rename package
This commit is contained in:
parent
ce4af278ac
commit
7e9ea69a08
41 changed files with 58 additions and 209 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -175,7 +175,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reconcile"
|
name = "reconcile-text"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.1",
|
"cfg-if 1.0.1",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "reconcile"
|
name = "reconcile-text"
|
||||||
description = "Think diff3 or git merge, but with automated conflict resolution that requires no user intervention"
|
description = "Think diff3 or git merge, but with automated conflict resolution that requires no user intervention"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
rust-version = "1.85"
|
rust-version = "1.85"
|
||||||
|
|
@ -16,6 +16,10 @@ exclude = ["reconcile-js", ".*", "examples/website"]
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "merge-file"
|
||||||
|
path = "examples/merge-file.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.219", optional = true, features = ["derive"] }
|
serde = { version = "1.0.219", optional = true, features = ["derive"] }
|
||||||
|
|
||||||
|
|
|
||||||
12
README.md
12
README.md
|
|
@ -23,17 +23,17 @@ TODO: add links for crates and npm
|
||||||
|
|
||||||
### Rust
|
### Rust
|
||||||
|
|
||||||
Add `reconcile` to your `Cargo.toml`:
|
Add `reconcile-text` to your `Cargo.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reconcile = "0.4"
|
reconcile-text = "0.4"
|
||||||
```
|
```
|
||||||
|
|
||||||
Then merge away:
|
Then merge away:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use reconcile::{reconcile, BuiltinTokenizer};
|
use reconcile_text::{reconcile, BuiltinTokenizer};
|
||||||
|
|
||||||
// Start with original text
|
// Start with original text
|
||||||
let parent = "Hello world";
|
let parent = "Hello world";
|
||||||
|
|
@ -51,13 +51,13 @@ assert_eq!(result.apply().text(), "Hi beautiful world");
|
||||||
Install via npm:
|
Install via npm:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install reconcile
|
npm install reconcile-text
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use in your application:
|
Then use in your application:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { init, reconcile } from 'reconcile';
|
import { init, reconcile } from 'reconcile-text';
|
||||||
|
|
||||||
// Same example as above
|
// Same example as above
|
||||||
const parent = 'Hello world';
|
const parent = 'Hello world';
|
||||||
|
|
@ -85,7 +85,7 @@ Reconcile offers different ways to split text for merging:
|
||||||
|
|
||||||
- **Word tokeniser** (`BuiltinTokenizer::Word`) — Splits on word boundaries (recommended for prose)
|
- **Word tokeniser** (`BuiltinTokenizer::Word`) — Splits on word boundaries (recommended for prose)
|
||||||
- **Character tokeniser** (`BuiltinTokenizer::Character`) — Individual characters (fine-grained control)
|
- **Character tokeniser** (`BuiltinTokenizer::Character`) — Individual characters (fine-grained control)
|
||||||
- **Line tokeniser** (`BuiltinTokenizer::Line`) — Line-by-line (similar to `git merge`)
|
- **Line tokeniser** (`BuiltinTokenizer::Line`) — Line-by-line (similar to `git merge` or more precisely [`git merge-file`](https://git-scm.com/docs/git-merge-file))
|
||||||
- **Custom tokeniser** — Roll your own for specialised use cases
|
- **Custom tokeniser** — Roll your own for specialised use cases
|
||||||
|
|
||||||
### Cursor tracking
|
### Cursor tracking
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
use std::{env, fs, process};
|
use std::{env, fs, process};
|
||||||
|
|
||||||
use reconcile_merge::{BuiltinTokenizer, reconcile};
|
use reconcile_text::{BuiltinTokenizer, reconcile};
|
||||||
|
|
||||||
/// Merges three versions of a file: mine, base, and theirs.
|
/// Merges three versions of a file: mine, base, and theirs.
|
||||||
/// Implement a trivial version git merge-file (https://git-scm.com/docs/git-merge-file)
|
/// Implement a trivial version git merge-file (<https://git-scm.com/docs/git-merge-file>)
|
||||||
///
|
///
|
||||||
/// Run it with:
|
/// Run it with:
|
||||||
/// `cargo run --example merge-file my.txt base.txt their.txt [output_file.txt]`
|
/// `cargo run --example merge-file my.txt base.txt their.txt [output_file.txt]`
|
||||||
|
|
@ -22,17 +22,17 @@ fn main() {
|
||||||
|
|
||||||
// Read files
|
// Read files
|
||||||
let mine_content = fs::read_to_string(mine_file).unwrap_or_else(|e| {
|
let mine_content = fs::read_to_string(mine_file).unwrap_or_else(|e| {
|
||||||
eprintln!("Error reading {}: {}", mine_file, e);
|
eprintln!("Error reading {mine_file}: {e}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
let base_content = fs::read_to_string(base_file).unwrap_or_else(|e| {
|
let base_content = fs::read_to_string(base_file).unwrap_or_else(|e| {
|
||||||
eprintln!("Error reading {}: {}", base_file, e);
|
eprintln!("Error reading {base_file}: {e}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
let theirs_content = fs::read_to_string(theirs_file).unwrap_or_else(|e| {
|
let theirs_content = fs::read_to_string(theirs_file).unwrap_or_else(|e| {
|
||||||
eprintln!("Error reading {}: {}", theirs_file, e);
|
eprintln!("Error reading {theirs_file}: {e}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -49,10 +49,10 @@ fn main() {
|
||||||
// Write the result
|
// Write the result
|
||||||
if let Some(output_path) = output_file {
|
if let Some(output_path) = output_file {
|
||||||
if let Err(e) = fs::write(output_path, merged_content) {
|
if let Err(e) = fs::write(output_path, merged_content) {
|
||||||
eprintln!("Error writing to {}: {}", output_path, e);
|
eprintln!("Error writing to {output_path}: {e}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print!("{}", merged_content);
|
print!("{merged_content}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { reconcileWithHistory } from 'reconcile';
|
import { reconcileWithHistory } from 'reconcile-text';
|
||||||
import type { Tokenizer } from 'reconcile';
|
import type { Tokenizer } from 'reconcile-text';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
const originalTextArea = document.getElementById('original') as HTMLTextAreaElement;
|
const originalTextArea = document.getElementById('original') as HTMLTextAreaElement;
|
||||||
|
|
|
||||||
25
examples/website/package-lock.json
generated
25
examples/website/package-lock.json
generated
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "portfolio",
|
"name": "reconcile-example-website",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "portfolio",
|
"name": "reconcile-example-website",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"css-loader": "^7.1.2",
|
"css-loader": "^7.1.2",
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
"inline-source-webpack-plugin": "^3.0.1",
|
"inline-source-webpack-plugin": "^3.0.1",
|
||||||
"mini-css-extract-plugin": "^2.9.2",
|
"mini-css-extract-plugin": "^2.9.2",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"reconcile": "file:../../reconcile-js",
|
"reconcile-text": "file:../../reconcile-js",
|
||||||
"resolve-url-loader": "^5.0.0",
|
"resolve-url-loader": "^5.0.0",
|
||||||
"sass": "^1.89.2",
|
"sass": "^1.89.2",
|
||||||
"sass-loader": "^16.0.5",
|
"sass-loader": "^16.0.5",
|
||||||
|
|
@ -26,19 +26,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"../../reconcile-js": {
|
"../../reconcile-js": {
|
||||||
"name": "reconcile",
|
"name": "reconcile-text",
|
||||||
"version": "0.4.0",
|
"version": "0.4.3",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^30.0.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^30.0.4",
|
||||||
"reconcile": "file:../pkg",
|
"prettier": "^3.6.2",
|
||||||
"ts-jest": "^29.3.4",
|
"reconcile-text": "file:../pkg",
|
||||||
|
"ts-jest": "^29.4.0",
|
||||||
"ts-loader": "^9.5.2",
|
"ts-loader": "^9.5.2",
|
||||||
"tslib": "2.8.1",
|
"tslib": "2.8.1",
|
||||||
"typescript": "5.8.3",
|
"typescript": "5.8.3",
|
||||||
"webpack": "^5.99.9",
|
"webpack": "^5.99.9",
|
||||||
"webpack-cli": "^6.0.1"
|
"webpack-cli": "^6.0.1",
|
||||||
|
"webpack-merge": "^6.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@discoveryjs/json-ext": {
|
"node_modules/@discoveryjs/json-ext": {
|
||||||
|
|
@ -3960,7 +3963,7 @@
|
||||||
"node": ">= 10.13.0"
|
"node": ">= 10.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/reconcile": {
|
"node_modules/reconcile-text": {
|
||||||
"resolved": "../../reconcile-js",
|
"resolved": "../../reconcile-js",
|
||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/schmelczer/reconcile#readme",
|
"homepage": "https://github.com/schmelczer/reconcile#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"reconcile": "file:../../reconcile-js",
|
"reconcile-text": "file:../../reconcile-js",
|
||||||
"css-loader": "^7.1.2",
|
"css-loader": "^7.1.2",
|
||||||
"html-webpack-plugin": "^5.6.3",
|
"html-webpack-plugin": "^5.6.3",
|
||||||
"mini-css-extract-plugin": "^2.9.2",
|
"mini-css-extract-plugin": "^2.9.2",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest/presets/js-with-babel-esm',
|
preset: 'ts-jest/presets/js-with-babel-esm',
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'^reconcile/reconcile_bg\\.wasm$': `<rootDir>/__mocks__/wasm.js`,
|
'^reconcile-text/reconcile_bg\\.wasm$': `<rootDir>/__mocks__/wasm.js`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
13
reconcile-js/package-lock.json
generated
13
reconcile-js/package-lock.json
generated
|
|
@ -1,17 +1,18 @@
|
||||||
{
|
{
|
||||||
"name": "reconcile",
|
"name": "reconcile-text",
|
||||||
"version": "0.4.3",
|
"version": "0.4.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "reconcile",
|
"name": "reconcile-text",
|
||||||
"version": "0.4.3",
|
"version": "0.4.3",
|
||||||
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"jest": "^30.0.4",
|
"jest": "^30.0.4",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"reconcile": "file:../pkg",
|
"reconcile-text": "file:../pkg",
|
||||||
"ts-jest": "^29.4.0",
|
"ts-jest": "^29.4.0",
|
||||||
"ts-loader": "^9.5.2",
|
"ts-loader": "^9.5.2",
|
||||||
"tslib": "2.8.1",
|
"tslib": "2.8.1",
|
||||||
|
|
@ -22,8 +23,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"../pkg": {
|
"../pkg": {
|
||||||
"name": "reconcile",
|
"name": "reconcile-text",
|
||||||
"version": "0.4.0",
|
"version": "0.4.3",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
|
@ -4542,7 +4543,7 @@
|
||||||
"node": ">= 10.13.0"
|
"node": ">= 10.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/reconcile": {
|
"node_modules/reconcile-text": {
|
||||||
"resolved": "../pkg",
|
"resolved": "../pkg",
|
||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "reconcile",
|
"name": "reconcile-text",
|
||||||
"version": "0.4.3",
|
"version": "0.4.3",
|
||||||
"description": "Think diff3 or git merge, but with automated conflict resolution that requires no user intervention",
|
"description": "Think diff3 or git merge, but with automated conflict resolution that requires no user intervention",
|
||||||
"main": "dist/reconcile.node.js",
|
"main": "dist/reconcile.node.js",
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"jest": "^30.0.4",
|
"jest": "^30.0.4",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"reconcile": "file:../pkg",
|
"reconcile-text": "file:../pkg",
|
||||||
"ts-jest": "^29.4.0",
|
"ts-jest": "^29.4.0",
|
||||||
"ts-loader": "^9.5.2",
|
"ts-loader": "^9.5.2",
|
||||||
"tslib": "2.8.1",
|
"tslib": "2.8.1",
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ import {
|
||||||
reconcileWithHistory as wasmReconcileWithHistory,
|
reconcileWithHistory as wasmReconcileWithHistory,
|
||||||
History,
|
History,
|
||||||
initSync,
|
initSync,
|
||||||
} from 'reconcile';
|
} from 'reconcile-text';
|
||||||
|
|
||||||
import wasmBytes from 'reconcile/reconcile_bg.wasm';
|
import wasmBytes from 'reconcile-text/reconcile_bg.wasm';
|
||||||
|
|
||||||
export interface TextWithCursors {
|
export interface TextWithCursors {
|
||||||
/** The document's entire content */
|
/** The document's entire content */
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
//! ✨ **[Try the interactive demo](https://schmelczer.dev/reconcile)** to see it in action!
|
//! ✨ **[Try the interactive demo](https://schmelczer.dev/reconcile)** to see it in action!
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use reconcile::{reconcile, BuiltinTokenizer};
|
//! use reconcile_text::{reconcile, BuiltinTokenizer};
|
||||||
//!
|
//!
|
||||||
//! // Start with original text
|
//! // Start with original text
|
||||||
//! let parent = "Merging text is hard!";
|
//! let parent = "Merging text is hard!";
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
//! ### Built-in tokenisers
|
//! ### Built-in tokenisers
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use reconcile::{reconcile, BuiltinTokenizer};
|
//! use reconcile_text::{reconcile, BuiltinTokenizer};
|
||||||
//!
|
//!
|
||||||
//! let parent = "The quick brown fox\n";
|
//! let parent = "The quick brown fox\n";
|
||||||
//! let left = "The very quick brown fox\n"; // Added "very"
|
//! let left = "The very quick brown fox\n"; // Added "very"
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
//! you can implement custom tokenisation logic:
|
//! you can implement custom tokenisation logic:
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use reconcile::{reconcile, Token, BuiltinTokenizer};
|
//! use reconcile_text::{reconcile, Token, BuiltinTokenizer};
|
||||||
//!
|
//!
|
||||||
//! // Example: custom sentence-based tokeniser
|
//! // Example: custom sentence-based tokeniser
|
||||||
//! let sentence_tokeniser = |text: &str| {
|
//! let sentence_tokeniser = |text: &str| {
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
//! cursors and selection ranges during merging:
|
//! cursors and selection ranges during merging:
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use reconcile::{reconcile, BuiltinTokenizer, TextWithCursors, CursorPosition};
|
//! use reconcile_text::{reconcile, BuiltinTokenizer, TextWithCursors, CursorPosition};
|
||||||
//!
|
//!
|
||||||
//! let parent = "Hello world";
|
//! let parent = "Hello world";
|
||||||
//! let left = TextWithCursors::new(
|
//! let left = TextWithCursors::new(
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use crate::{
|
||||||
/// granularity of words.
|
/// granularity of words.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use reconcile::{reconcile, BuiltinTokenizer};
|
/// use reconcile_text::{reconcile, BuiltinTokenizer};
|
||||||
///
|
///
|
||||||
/// let parent = "Merging text is hard!";
|
/// let parent = "Merging text is hard!";
|
||||||
/// let left = "Merging text is easy!";
|
/// let left = "Merging text is easy!";
|
||||||
|
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
---
|
|
||||||
source: reconcile/src/operations/edited_text.rs
|
|
||||||
expression: operations
|
|
||||||
snapshot_kind: text
|
|
||||||
---
|
|
||||||
EditedText {
|
|
||||||
text: "hello world! How are you? Adam",
|
|
||||||
operations: [
|
|
||||||
OrderedOperation {
|
|
||||||
order: 0,
|
|
||||||
operation: Insert {
|
|
||||||
index: 0,
|
|
||||||
text: "Hello, my friend! ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 0,
|
|
||||||
operation: Delete {
|
|
||||||
index: 18,
|
|
||||||
deleted_character_count: 13,
|
|
||||||
deleted_text: Some(
|
|
||||||
"hello world! ",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 21,
|
|
||||||
operation: Delete {
|
|
||||||
index: 26,
|
|
||||||
deleted_character_count: 5,
|
|
||||||
deleted_text: Some(
|
|
||||||
"you? ",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 26,
|
|
||||||
operation: Delete {
|
|
||||||
index: 26,
|
|
||||||
deleted_character_count: 5,
|
|
||||||
deleted_text: Some(
|
|
||||||
" Adam",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 31,
|
|
||||||
operation: Insert {
|
|
||||||
index: 26,
|
|
||||||
text: "you ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 31,
|
|
||||||
operation: Insert {
|
|
||||||
index: 30,
|
|
||||||
text: "doing? Albert",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
---
|
|
||||||
source: reconcile/src/operations/operation_sequence.rs
|
|
||||||
expression: operations
|
|
||||||
snapshot_kind: text
|
|
||||||
---
|
|
||||||
EditedText {
|
|
||||||
operations: [
|
|
||||||
OrderedOperation {
|
|
||||||
order: 0,
|
|
||||||
operation: Insert {
|
|
||||||
index: 0,
|
|
||||||
text: "Hello, my friend! ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 0,
|
|
||||||
operation: Delete {
|
|
||||||
index: 18,
|
|
||||||
deleted_character_count: 13,
|
|
||||||
deleted_text: Some(
|
|
||||||
"hello world! ",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 21,
|
|
||||||
operation: Delete {
|
|
||||||
index: 26,
|
|
||||||
deleted_character_count: 5,
|
|
||||||
deleted_text: Some(
|
|
||||||
"you? ",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 26,
|
|
||||||
operation: Delete {
|
|
||||||
index: 26,
|
|
||||||
deleted_character_count: 5,
|
|
||||||
deleted_text: Some(
|
|
||||||
" Adam",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 31,
|
|
||||||
operation: Insert {
|
|
||||||
index: 26,
|
|
||||||
text: "you ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OrderedOperation {
|
|
||||||
order: 31,
|
|
||||||
operation: Insert {
|
|
||||||
index: 30,
|
|
||||||
text: "doing? Albert",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
---
|
|
||||||
source: reconcile/src/tokenizer/word_tokenizer.rs
|
|
||||||
expression: "word_tokenizer(\" hello, \\nwhere are you?\")"
|
|
||||||
snapshot_kind: text
|
|
||||||
---
|
|
||||||
[
|
|
||||||
Token {
|
|
||||||
normalised: " ",
|
|
||||||
original: " ",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: "hello,",
|
|
||||||
original: "hello,",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: " \n",
|
|
||||||
original: " \n",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: "where",
|
|
||||||
original: "where",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: " ",
|
|
||||||
original: " ",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: "are",
|
|
||||||
original: "are",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: " ",
|
|
||||||
original: " ",
|
|
||||||
},
|
|
||||||
Token {
|
|
||||||
normalised: "you?",
|
|
||||||
original: "you?",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
source: src/tokenizer/character_tokenizer.rs
|
source: src/tokenizer/character_tokenizer.rs
|
||||||
expression: "character_tokenizer(\"\")"
|
expression: "character_tokenizer(\"\")"
|
||||||
|
snapshot_kind: text
|
||||||
---
|
---
|
||||||
[]
|
[]
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: reconcile/src/tokenizer/word_tokenizer.rs
|
source: src/tokenizer/word_tokenizer.rs
|
||||||
expression: "word_tokenizer(\"\")"
|
expression: "word_tokenizer(\"\")"
|
||||||
snapshot_kind: text
|
snapshot_kind: text
|
||||||
---
|
---
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
use reconcile::{CursorPosition, EditedText, TextWithCursors};
|
use reconcile_text::{CursorPosition, EditedText, TextWithCursors};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
/// `ExampleDocument` represents a test case for the reconciliation process.
|
/// `ExampleDocument` represents a test case for the reconciliation process.
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ mod example_document;
|
||||||
use std::{fs, path::Path};
|
use std::{fs, path::Path};
|
||||||
|
|
||||||
use example_document::ExampleDocument;
|
use example_document::ExampleDocument;
|
||||||
use reconcile::{BuiltinTokenizer, reconcile};
|
use reconcile_text::{BuiltinTokenizer, reconcile};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#![cfg(feature = "wasm")]
|
#![cfg(feature = "wasm")]
|
||||||
|
|
||||||
use reconcile::{BuiltinTokenizer, CursorPosition, TextWithCursors, wasm::*};
|
use reconcile_text::{BuiltinTokenizer, CursorPosition, TextWithCursors, wasm::*};
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
#[wasm_bindgen_test(unsupported = test)]
|
#[wasm_bindgen_test(unsupported = test)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue