@@ -6,7 +6,6 @@ use colored::Colorize;
66use parser:: EmbeddedFileSourceMap ;
77use ruff_db:: Db ;
88use ruff_db:: files:: File ;
9- use ruff_db:: source:: line_index;
109use similar:: { ChangeTag , TextDiff } ;
1110
1211use ruff_db:: diagnostic:: { Diagnostic , DisplayDiagnosticConfig , FileResolver } ;
@@ -355,14 +354,15 @@ pub(crate) fn apply_snapshot_filters(rendered: &str) -> std::borrow::Cow<'_, str
355354}
356355
357356pub fn validate_inline_snapshot (
358- db : & dyn ruff_db :: Db ,
357+ resolver : & dyn FileResolver ,
359358 tool_name : & ' static str ,
360359 test_file : & TestFile < ' _ > ,
361360 inline_diagnostics : & [ Diagnostic ] ,
362361 markdown_edits : & mut Vec < MarkdownEdit > ,
363362) -> Result < ( ) , matcher:: FailuresByLine > {
364363 let update_snapshots = is_update_inline_snapshots_enabled ( ) ;
365- let line_index = line_index ( db, test_file. file ) ;
364+ let input = resolver. input ( test_file. file ) ;
365+ let line_index = input. line_index ( ) ;
366366 let mut failures = matcher:: FailuresByLine :: default ( ) ;
367367 let mut inline_diagnostics = inline_diagnostics;
368368
@@ -416,8 +416,9 @@ pub fn validate_inline_snapshot(
416416 continue ;
417417 } ;
418418
419- let actual = apply_snapshot_filters ( & render_diagnostics ( & db, tool_name, block_diagnostics) )
420- . into_owned ( ) ;
419+ let actual =
420+ apply_snapshot_filters ( & render_diagnostics ( resolver, tool_name, block_diagnostics) )
421+ . into_owned ( ) ;
421422
422423 let Some ( snapshot_code_block) = code_block. inline_snapshot_block ( ) else {
423424 if update_snapshots {
0 commit comments