@@ -252,8 +252,8 @@ fn test_r_file_created_routes_through_add_file() {
252252
253253 let root = state. db . workspace_roots ( ) . roots ( & state. db ) [ 0 ] ;
254254 assert_eq ! ( root. scripts( & state. db) . len( ) , 1 ) ;
255- let url = FilePath :: from_path_buf ( path. clone ( ) ) . unwrap ( ) ;
256- let file = state. db . file_by_path ( & url ) . unwrap ( ) ;
255+ let file_path = FilePath :: from_path_buf ( path. clone ( ) ) . unwrap ( ) ;
256+ let file = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
257257 assert_eq ! ( file. contents( & state. db) , "x <- 1\n " ) ;
258258}
259259
@@ -272,10 +272,10 @@ fn test_r_file_changed_for_editor_open_file_is_skipped() {
272272 . documents
273273 . insert ( url. clone ( ) , Document :: new ( "editor_v2\n " , None ) ) ;
274274 // Pretend the editor pushed its content into oak too.
275- let url_id = FilePath :: from_url ( & url) ;
275+ let file_path = FilePath :: from_url ( & url) ;
276276 state
277277 . db
278- . upsert_editor ( url_id . clone ( ) , "editor_v2\n " . to_string ( ) ) ;
278+ . upsert_editor ( file_path . clone ( ) , "editor_v2\n " . to_string ( ) ) ;
279279
280280 // Now disk-side `Changed` fires with stale disk content.
281281 fs:: write ( & path, "disk_v3\n " ) . unwrap ( ) ;
@@ -284,7 +284,7 @@ fn test_r_file_changed_for_editor_open_file_is_skipped() {
284284 } ;
285285 did_change_watched_files ( params, & mut state) . unwrap ( ) ;
286286
287- let file = state. db . file_by_path ( & url_id ) . unwrap ( ) ;
287+ let file = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
288288 assert_eq ! ( file. contents( & state. db) , "editor_v2\n " ) ;
289289}
290290
@@ -296,15 +296,15 @@ fn test_r_file_deleted_routes_through_remove_file() {
296296 let mut state = workspace_state ( tmp. path ( ) ) ;
297297
298298 let path = tmp. path ( ) . join ( "a.R" ) ;
299- let url_id = FilePath :: from_path_buf ( path. clone ( ) ) . unwrap ( ) ;
299+ let file_path = FilePath :: from_path_buf ( path. clone ( ) ) . unwrap ( ) ;
300300 let params = DidChangeWatchedFilesParams {
301301 changes : vec ! [ event( & path, FileChangeType :: DELETED ) ] ,
302302 } ;
303303 did_change_watched_files ( params, & mut state) . unwrap ( ) ;
304304
305305 let root = state. db . workspace_roots ( ) . roots ( & state. db ) [ 0 ] ;
306306 assert_eq ! ( root. scripts( & state. db) . len( ) , 1 ) ;
307- assert ! ( state. db. file_by_path( & url_id ) . is_none( ) ) ;
307+ assert ! ( state. db. file_by_path( & file_path ) . is_none( ) ) ;
308308}
309309
310310#[ test]
@@ -317,9 +317,13 @@ fn test_r_file_changed_for_unopened_file_updates_contents() {
317317 fs:: write ( & path, "v1\n " ) . unwrap ( ) ;
318318 let mut state = workspace_state ( tmp. path ( ) ) ;
319319
320- let url_id = FilePath :: from_path_buf ( path. clone ( ) ) . unwrap ( ) ;
320+ let file_path = FilePath :: from_path_buf ( path. clone ( ) ) . unwrap ( ) ;
321321 assert_eq ! (
322- state. db. file_by_path( & url_id) . unwrap( ) . contents( & state. db) ,
322+ state
323+ . db
324+ . file_by_path( & file_path)
325+ . unwrap( )
326+ . contents( & state. db) ,
323327 "v1\n "
324328 ) ;
325329
@@ -330,7 +334,11 @@ fn test_r_file_changed_for_unopened_file_updates_contents() {
330334 did_change_watched_files ( params, & mut state) . unwrap ( ) ;
331335
332336 assert_eq ! (
333- state. db. file_by_path( & url_id) . unwrap( ) . contents( & state. db) ,
337+ state
338+ . db
339+ . file_by_path( & file_path)
340+ . unwrap( )
341+ . contents( & state. db) ,
334342 "v2\n "
335343 ) ;
336344}
@@ -352,18 +360,18 @@ fn test_r_file_deleted_for_editor_open_file_is_skipped() {
352360 state
353361 . documents
354362 . insert ( url. clone ( ) , Document :: new ( "editor_v2\n " , None ) ) ;
355- let url_id = FilePath :: from_url ( & url) ;
363+ let file_path = FilePath :: from_url ( & url) ;
356364 state
357365 . db
358- . upsert_editor ( url_id . clone ( ) , "editor_v2\n " . to_string ( ) ) ;
366+ . upsert_editor ( file_path . clone ( ) , "editor_v2\n " . to_string ( ) ) ;
359367
360368 fs:: remove_file ( & path) . unwrap ( ) ;
361369 let params = DidChangeWatchedFilesParams {
362370 changes : vec ! [ event( & path, FileChangeType :: DELETED ) ] ,
363371 } ;
364372 did_change_watched_files ( params, & mut state) . unwrap ( ) ;
365373
366- let file = state. db . file_by_path ( & url_id ) . unwrap ( ) ;
374+ let file = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
367375 assert_eq ! ( file. contents( & state. db) , "editor_v2\n " ) ;
368376}
369377
@@ -393,8 +401,8 @@ fn test_description_deleted_demotes_package_to_scripts() {
393401 assert ! ( root. packages( & state. db) . is_empty( ) ) ;
394402 assert_eq ! ( root. scripts( & state. db) . len( ) , 1 ) ;
395403
396- let a_url = FilePath :: from_path_buf ( tmp. path ( ) . join ( "pkg/R/a.R" ) ) . unwrap ( ) ;
397- let file = state. db . file_by_path ( & a_url ) . unwrap ( ) ;
404+ let file_path = FilePath :: from_path_buf ( tmp. path ( ) . join ( "pkg/R/a.R" ) ) . unwrap ( ) ;
405+ let file = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
398406 assert_eq ! ( file. package( & state. db) , None ) ;
399407}
400408
@@ -568,23 +576,23 @@ fn test_did_change_workspace_folders_preserves_open_buffer_across_churn() {
568576 // Simulate `didOpen` on the package file with editor-side content.
569577 let r_path = tmp. path ( ) . join ( "pkg/R/a.R" ) ;
570578 let url = Url :: from_file_path ( & r_path) . unwrap ( ) ;
571- let url_id = FilePath :: from_url ( & url) ;
579+ let file_path = FilePath :: from_url ( & url) ;
572580 state
573581 . documents
574582 . insert ( url. clone ( ) , Document :: new ( "editor <- 2\n " , None ) ) ;
575583 state
576584 . db
577- . upsert_editor ( url_id . clone ( ) , "editor <- 2\n " . to_string ( ) ) ;
585+ . upsert_editor ( file_path . clone ( ) , "editor <- 2\n " . to_string ( ) ) ;
578586
579- let file_before = state. db . file_by_path ( & url_id ) . unwrap ( ) ;
587+ let file_before = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
580588
581589 // Remove the workspace folder. The handler builds the editor_owned set
582590 // from state.documents.keys() and passes it to oak; the buffer's file
583591 // routes to OrphanRoot rather than StaleRoot.
584592 let params = folders_change ( vec ! [ ] , vec ! [ folder_for( tmp. path( ) ) ] ) ;
585593 did_change_workspace_folders ( params, & mut state) . unwrap ( ) ;
586594
587- let after_remove = state. db . file_by_path ( & url_id ) . unwrap ( ) ;
595+ let after_remove = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
588596 assert_eq ! ( file_before, after_remove) ;
589597 assert_eq ! ( after_remove. package( & state. db) , None ) ;
590598 assert ! ( state
@@ -600,7 +608,7 @@ fn test_did_change_workspace_folders_preserves_open_buffer_across_churn() {
600608 let params = folders_change ( vec ! [ folder_for( tmp. path( ) ) ] , vec ! [ ] ) ;
601609 did_change_workspace_folders ( params, & mut state) . unwrap ( ) ;
602610
603- let after_readd = state. db . file_by_path ( & url_id ) . unwrap ( ) ;
611+ let after_readd = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
604612 assert_eq ! ( file_before, after_readd) ;
605613 assert ! ( after_readd. package( & state. db) . is_some( ) ) ;
606614 assert_eq ! ( after_readd. contents( & state. db) , "editor <- 2\n " ) ;
@@ -625,7 +633,7 @@ fn test_did_close_releases_orphan_file_to_stale() {
625633
626634 let r_path = tmp. path ( ) . join ( "pkg/R/a.R" ) ;
627635 let url = Url :: from_file_path ( & r_path) . unwrap ( ) ;
628- let url_id = FilePath :: from_url ( & url) ;
636+ let file_path = FilePath :: from_url ( & url) ;
629637
630638 // Simulate `didOpen` via state mutation (matches the rest of the file's
631639 // pattern).
@@ -637,15 +645,15 @@ fn test_did_close_releases_orphan_file_to_stale() {
637645 . insert ( url. clone ( ) , tree_sitter:: Parser :: new ( ) ) ;
638646 state
639647 . db
640- . upsert_editor ( url_id . clone ( ) , "edited\n " . to_string ( ) ) ;
648+ . upsert_editor ( file_path . clone ( ) , "edited\n " . to_string ( ) ) ;
641649
642650 // Remove the workspace folder; file goes to orphan (editor-owned).
643651 did_change_workspace_folders (
644652 folders_change ( vec ! [ ] , vec ! [ folder_for( tmp. path( ) ) ] ) ,
645653 & mut state,
646654 )
647655 . unwrap ( ) ;
648- let file = state. db . file_by_path ( & url_id ) . unwrap ( ) ;
656+ let file = state. db . file_by_path ( & file_path ) . unwrap ( ) ;
649657 assert ! ( state. db. orphan_root( ) . files( & state. db) . contains( & file) ) ;
650658
651659 // Init the aux channel here, after the workspace-folders churn: the
0 commit comments