aboutsummaryrefslogtreecommitdiff
path: root/crates/base_db/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/base_db/src')
-rw-r--r--crates/base_db/src/fixture.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 66e6443cb..98acd61b1 100644
--- a/crates/base_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
@@ -61,7 +61,9 @@ use std::{str::FromStr, sync::Arc};
61 61
62use cfg::CfgOptions; 62use cfg::CfgOptions;
63use rustc_hash::FxHashMap; 63use rustc_hash::FxHashMap;
64use test_utils::{extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER}; 64use test_utils::{
65 extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER, ESCAPED_CURSOR_MARKER,
66};
65use vfs::{file_set::FileSet, VfsPath}; 67use vfs::{file_set::FileSet, VfsPath};
66 68
67use crate::{ 69use crate::{
@@ -142,10 +144,14 @@ impl ChangeFixture {
142 144
143 for entry in fixture { 145 for entry in fixture {
144 let text = if entry.text.contains(CURSOR_MARKER) { 146 let text = if entry.text.contains(CURSOR_MARKER) {
145 let (range_or_offset, text) = extract_range_or_offset(&entry.text); 147 if entry.text.contains(ESCAPED_CURSOR_MARKER) {
146 assert!(file_position.is_none()); 148 entry.text.replace(ESCAPED_CURSOR_MARKER, CURSOR_MARKER)
147 file_position = Some((file_id, range_or_offset)); 149 } else {
148 text.to_string() 150 let (range_or_offset, text) = extract_range_or_offset(&entry.text);
151 assert!(file_position.is_none());
152 file_position = Some((file_id, range_or_offset));
153 text.to_string()
154 }
149 } else { 155 } else {
150 entry.text.clone() 156 entry.text.clone()
151 }; 157 };