@@ -222,7 +222,7 @@ impl WorkspaceServer {
222222 }
223223 }
224224
225- Err ( WorkspaceError :: not_found ( ) )
225+ Err ( WorkspaceError :: not_found ( path . to_string ( ) ) )
226226 }
227227
228228 /// Checks whether the directory identified by the given `path` contains a
@@ -624,7 +624,7 @@ impl WorkspaceServer {
624624
625625 match syntax {
626626 Ok ( syntax) => match syntax {
627- None => Err ( WorkspaceError :: not_found ( ) ) ,
627+ None => Err ( WorkspaceError :: not_found ( path . to_string ( ) ) ) ,
628628 Some ( syntax) => Ok ( syntax) ,
629629 } ,
630630 Err ( FileTooLarge { .. } ) => Err ( WorkspaceError :: file_ignored ( path. to_string ( ) ) ) ,
@@ -642,11 +642,11 @@ impl WorkspaceServer {
642642 . pin ( )
643643 . get ( path)
644644 . cloned ( )
645- . ok_or_else ( WorkspaceError :: not_found) ?;
645+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
646646
647647 match syntax. transpose ( ) {
648648 Ok ( syntax) => match syntax {
649- None => Err ( WorkspaceError :: not_found ( ) ) ,
649+ None => Err ( WorkspaceError :: not_found ( path . to_string ( ) ) ) ,
650650 Some ( syntax) => Ok ( ( syntax. clone ( ) , services. clone ( ) ) ) ,
651651 } ,
652652 Err ( FileTooLarge { .. } ) => Err ( WorkspaceError :: file_ignored ( path. to_string ( ) ) ) ,
@@ -660,7 +660,7 @@ impl WorkspaceServer {
660660 self . documents
661661 . pin ( )
662662 . get ( path)
663- . ok_or_else ( WorkspaceError :: not_found)
663+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) )
664664 . and_then ( |doc| match & doc. syntax {
665665 Some ( syntax) => match syntax {
666666 Ok ( syntax) => Ok ( (
@@ -670,7 +670,7 @@ impl WorkspaceServer {
670670 ) ) ,
671671 Err ( FileTooLarge { .. } ) => Err ( WorkspaceError :: file_ignored ( path. to_string ( ) ) ) ,
672672 } ,
673- None => Err ( WorkspaceError :: not_found ( ) ) ,
673+ None => Err ( WorkspaceError :: not_found ( path . to_string ( ) ) ) ,
674674 } )
675675 }
676676
@@ -681,7 +681,7 @@ impl WorkspaceServer {
681681 self . documents
682682 . pin ( )
683683 . get ( path)
684- . ok_or_else ( WorkspaceError :: not_found)
684+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) )
685685 . and_then ( |doc| match & doc. syntax {
686686 Some ( syntax) => match syntax {
687687 Ok ( syntax) => Ok ( (
@@ -693,7 +693,7 @@ impl WorkspaceServer {
693693 ) ) ,
694694 Err ( FileTooLarge { .. } ) => Err ( WorkspaceError :: file_ignored ( path. to_string ( ) ) ) ,
695695 } ,
696- None => Err ( WorkspaceError :: not_found ( ) ) ,
696+ None => Err ( WorkspaceError :: not_found ( path . to_string ( ) ) ) ,
697697 } )
698698 }
699699
@@ -736,7 +736,7 @@ impl WorkspaceServer {
736736 ) -> Result < ParseResult , WorkspaceError > {
737737 let file_source = self
738738 . get_source ( file_source_index)
739- . ok_or_else ( WorkspaceError :: not_found) ?;
739+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
740740 let capabilities = self . features . get_capabilities ( file_source) ;
741741
742742 let parse = capabilities
@@ -945,7 +945,7 @@ impl WorkspaceServer {
945945 let package_path = path
946946 . parent ( )
947947 . map ( |parent| parent. to_path_buf ( ) )
948- . ok_or_else ( WorkspaceError :: not_found) ?;
948+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
949949
950950 match update_kind {
951951 UpdateKind :: AddedOrChanged ( _, root, _) => {
@@ -960,7 +960,7 @@ impl WorkspaceServer {
960960 let package_path = path
961961 . parent ( )
962962 . map ( |parent| parent. to_path_buf ( ) )
963- . ok_or_else ( WorkspaceError :: not_found) ?;
963+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
964964
965965 match update_kind {
966966 UpdateKind :: AddedOrChanged ( _, root, _) => {
@@ -978,7 +978,7 @@ impl WorkspaceServer {
978978 let package_path = path
979979 . parent ( )
980980 . map ( |parent| parent. to_path_buf ( ) )
981- . ok_or_else ( WorkspaceError :: not_found) ?;
981+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
982982
983983 match update_kind {
984984 UpdateKind :: AddedOrChanged ( _, root, _) => {
@@ -1506,7 +1506,7 @@ impl Workspace for WorkspaceServer {
15061506 . pin ( )
15071507 . get ( params. path . as_path ( ) )
15081508 . map ( |document| document. content . clone ( ) )
1509- . ok_or_else ( WorkspaceError :: not_found)
1509+ . ok_or_else ( || WorkspaceError :: not_found ( params . path . to_string ( ) ) )
15101510 }
15111511
15121512 fn check_file_size (
@@ -1515,7 +1515,7 @@ impl Workspace for WorkspaceServer {
15151515 ) -> Result < CheckFileSizeResult , WorkspaceError > {
15161516 let documents = self . documents . pin ( ) ;
15171517 let Some ( document) = documents. get ( params. path . as_path ( ) ) else {
1518- return Err ( WorkspaceError :: not_found ( ) ) ;
1518+ return Err ( WorkspaceError :: not_found ( params . path . to_string ( ) ) ) ;
15191519 } ;
15201520 let file_size = document. content . len ( ) ;
15211521 let limit = self
@@ -1543,7 +1543,7 @@ impl Workspace for WorkspaceServer {
15431543 let ( index, existing_version) = documents
15441544 . get ( path. as_path ( ) )
15451545 . map ( |document| ( document. file_source_index , document. version ) )
1546- . ok_or_else ( WorkspaceError :: not_found) ?;
1546+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
15471547
15481548 if existing_version. is_some_and ( |existing_version| existing_version >= version) {
15491549 warn ! ( %version, %path, "outdated_file_change" ) ;
@@ -1663,7 +1663,7 @@ impl Workspace for WorkspaceServer {
16631663
16641664 documents
16651665 . insert ( path. clone ( ) . into ( ) , document)
1666- . ok_or_else ( WorkspaceError :: not_found) ?;
1666+ . ok_or_else ( || WorkspaceError :: not_found ( path . to_string ( ) ) ) ?;
16671667
16681668 let mut final_diagnostics = vec ! [ ] ;
16691669
0 commit comments