editor: Render diagnostic popover even if the source is out of view (#41449)

This happens quite often with cargo based diagnostics which may spawn
several lines (sometimes the entire screen), forcing the user to scroll
up to the start of the diagnostic just to see the hover message is not
great.

Release Notes:

- Fixed diagnostics hovers not working if the diagnostic spans out of
view
This commit is contained in:
Lukas Wirth
2025-10-29 12:18:34 +00:00
committed by GitHub
parent b7d31fabc5
commit bde7e55adb
3 changed files with 31 additions and 6 deletions
+3 -2
View File
@@ -281,7 +281,8 @@ impl BackgroundExecutor {
});
let mut cx = std::task::Context::from_waker(&waker);
let mut test_should_end_by = Instant::now() + Duration::from_secs(500);
let duration = Duration::from_secs(500);
let mut test_should_end_by = Instant::now() + duration;
loop {
match future.as_mut().poll(&mut cx) {
@@ -319,7 +320,7 @@ impl BackgroundExecutor {
test_should_end_by.saturating_duration_since(Instant::now()),
);
if Instant::now() > test_should_end_by {
panic!("test timed out with allow_parking")
panic!("test timed out after {duration:?} with allow_parking")
}
}
}