You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// * `change`: The range-adjusted change to use for statement changes
247
+
/// * `original_change`: The original change to use for text changes (yes, this is a bit confusing, and we might want to refactor this entire thing at some point.)
248
+
fnapply_change(
249
+
&mutself,
250
+
change:&ChangeParams,
251
+
original_change:&ChangeParams,
252
+
) -> Vec<StatementChange>{
250
253
// if range is none, we have a full change
251
254
if change.range.is_none(){
255
+
// doesnt matter what change since range is null
252
256
returnself.apply_full_change(change);
253
257
}
254
258
@@ -261,7 +265,7 @@ impl Document {
261
265
262
266
let change_range = change.range.unwrap();
263
267
let previous_content = self.content.clone();
264
-
let new_content = change.apply_to_text(&self.content);
268
+
let new_content = original_change.apply_to_text(&self.content);
265
269
266
270
// we first need to determine the affected range and all affected statements, as well as
267
271
// the index of the prev and the next statement, if any. The full affected range is the
@@ -1691,13 +1695,11 @@ KEY (\"organisation_id\") REFERENCES \"public\".\"organisation\"(\"id\") ON UPDA
1691
1695
],
1692
1696
};
1693
1697
1694
-
let changes = doc.apply_file_change(&change1);
1695
-
1696
-
println!("changes: {:#?}", changes);
1698
+
let _changes = doc.apply_file_change(&change1);
1697
1699
1698
1700
assert_eq!(
1699
1701
doc.content,
1700
-
"select 1, 2, 22322313133933193 from unknown_users;\n"
1702
+
"select 1, 2, 223223131339331931 from unknown_users;\n"
0 commit comments