Skip to content

Commit 0b8e145

Browse files
committed
Print runnable kind on assertion failure for better debuggability
1 parent f640f2d commit 0b8e145

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/ide/src/runnables.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ pub(crate) fn runnables(db: &RootDatabase, file_id: FileId) -> Vec<Runnable> {
105105

106106
let mut res = Vec::new();
107107
let mut add_opt = |runnable: Option<Runnable>| {
108-
if let Some(runnable) = runnable.filter(|r| {
108+
if let Some(runnable) = runnable.filter(|runnable| {
109109
always!(
110-
r.nav.file_id == file_id,
111-
"tried adding a runnable pointing to a different file"
110+
runnable.nav.file_id == file_id,
111+
"tried adding a runnable pointing to a different file: {:?} for {:?}",
112+
runnable.kind,
113+
file_id
112114
)
113115
}) {
114116
res.push(runnable);

0 commit comments

Comments
 (0)