Revert "sum_tree: Replace rayon with futures (#41586) (#41846)

This causes the background executor to hang

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-11-03 19:25:15 +00:00
committed by GitHub
parent cb5055aaec
commit 5fc54986c7
67 changed files with 650 additions and 1287 deletions
+10 -29
View File
@@ -75,7 +75,6 @@ fn test_set_line_ending(cx: &mut TestAppContext) {
Capability::ReadWrite,
base.read(cx).to_proto(cx),
None,
cx.background_executor(),
)
.unwrap()
});
@@ -256,18 +255,14 @@ async fn test_first_line_pattern(cx: &mut TestAppContext) {
.is_none()
);
assert!(
cx.read(|cx| languages.language_for_file(
&file("the/script"),
Some(&Rope::from_str("nothing", cx.background_executor())),
cx
))
.is_none()
cx.read(|cx| languages.language_for_file(&file("the/script"), Some(&"nothing".into()), cx))
.is_none()
);
assert_eq!(
cx.read(|cx| languages.language_for_file(
&file("the/script"),
Some(&Rope::from_str("#!/bin/env node", cx.background_executor())),
Some(&"#!/bin/env node".into()),
cx
))
.unwrap()
@@ -411,7 +406,6 @@ fn test_edit_events(cx: &mut gpui::App) {
ReplicaId::new(1),
Capability::ReadWrite,
"abcdef",
cx.background_executor(),
)
});
let buffer1_ops = Arc::new(Mutex::new(Vec::new()));
@@ -2787,14 +2781,8 @@ fn test_serialization(cx: &mut gpui::App) {
.background_executor()
.block(buffer1.read(cx).serialize_ops(None, cx));
let buffer2 = cx.new(|cx| {
let mut buffer = Buffer::from_proto(
ReplicaId::new(1),
Capability::ReadWrite,
state,
None,
cx.background_executor(),
)
.unwrap();
let mut buffer =
Buffer::from_proto(ReplicaId::new(1), Capability::ReadWrite, state, None).unwrap();
buffer.apply_ops(
ops.into_iter()
.map(|op| proto::deserialize_operation(op).unwrap()),
@@ -2818,7 +2806,6 @@ fn test_branch_and_merge(cx: &mut TestAppContext) {
Capability::ReadWrite,
base.read(cx).to_proto(cx),
None,
cx.background_executor(),
)
.unwrap()
});
@@ -3133,14 +3120,9 @@ fn test_random_collaboration(cx: &mut App, mut rng: StdRng) {
let ops = cx
.background_executor()
.block(base_buffer.read(cx).serialize_ops(None, cx));
let mut buffer = Buffer::from_proto(
ReplicaId::new(i as u16),
Capability::ReadWrite,
state,
None,
cx.background_executor(),
)
.unwrap();
let mut buffer =
Buffer::from_proto(ReplicaId::new(i as u16), Capability::ReadWrite, state, None)
.unwrap();
buffer.apply_ops(
ops.into_iter()
.map(|op| proto::deserialize_operation(op).unwrap()),
@@ -3269,7 +3251,6 @@ fn test_random_collaboration(cx: &mut App, mut rng: StdRng) {
Capability::ReadWrite,
old_buffer_state,
None,
cx.background_executor(),
)
.unwrap();
new_buffer.apply_ops(
@@ -3433,7 +3414,7 @@ fn test_contiguous_ranges() {
}
#[gpui::test(iterations = 500)]
fn test_trailing_whitespace_ranges(mut rng: StdRng, cx: &mut TestAppContext) {
fn test_trailing_whitespace_ranges(mut rng: StdRng) {
// Generate a random multi-line string containing
// some lines with trailing whitespace.
let mut text = String::new();
@@ -3457,7 +3438,7 @@ fn test_trailing_whitespace_ranges(mut rng: StdRng, cx: &mut TestAppContext) {
_ => {}
}
let rope = Rope::from_str(text.as_str(), cx.background_executor());
let rope = Rope::from(text.as_str());
let actual_ranges = trailing_whitespace_ranges(&rope);
let expected_ranges = TRAILING_WHITESPACE_REGEX
.find_iter(&text)